Code: Select all
/*
Adobe Reader Installer
Written for Adobe Reader 7.0.8. May need tweaking for a different version!
Download the full installer for Adobe Reader 7.0.8 from:
http://ardownload.adobe.com/pub/adobe/reader/win/7x/7.0.8/enu/AdbeRdr708_en_US.exe
Ensure Adobe Reader is NOT already installed before running this
Modify line 31 to suit path to installer
How this works:
Because all the setup windows have the same title I have used some simple loops
with the FindWindowWithText command to detect the changing messages _within_ the
setup windows. This means there are no fixed wait times to ensure this will
run generically regardless of the speed of the environment etc.
Note that some installers offer a quiet install mode using the /qn switch. This doesn't
appear to work with Adobe Reader. If it did we'd only need one or two lines of code!
*/
//Path to installer file
Let>Installer=D:\AdbeRdr708_en_US.exe
//Title of installer - will be different per version
Let>InstallTitle=Adobe Reader 7.0.8 - Setup
//Run installer
Run>%Installer%
//Wait for installer window to appear
WaitWindowOpen>%InstallTitle%
SetFocus>%InstallTitle%
//Wait for initial Splash screen then Press Enter (Next is default)
Let>title=
Label>WaitSplash
//Spelling mistake is intentional - the label is spelled incorrectly on install screen
FindWindowWithText>ReaderSpalsh,0,title
If>%title%<>%InstallTitle%,WaitSplash
SetFocus>%InstallTitle%
Press Enter
//Wait for Welcome message
Let>title=
Label>WaitWelcome
FindWindowWithText>Welcome to Setup for Adobe Reader,0,title
If>%title%<>%InstallTitle%,WaitWelcome
SetFocus>%InstallTitle%
Press Enter
//Wait for Destination Folder message
Let>title=
Label>WaitDestination
FindWindowWithText>Destination Folder,0,title
If>%title%<>%InstallTitle%,WaitDestination
SetFocus>%InstallTitle%
Press Enter
//Wait for Ready to Install message
Let>title=
Label>WaitInstallReady
FindWindowWithText>Ready to Install the Program,0,title
If>%title%<>%InstallTitle%,WaitInstallReady
SetFocus>%InstallTitle%
Press Enter
//Wait for Setup Completed
Let>title=
Label>WaitCompleted
FindWindowWithText>Setup Completed,0,title
If>%title%<>%InstallTitle%,WaitCompleted
//Press final Finish button
SetFocus>%InstallTitle%
Press Enter