This is an old revision of the document!


Adobe Reader 9.5.x

Script by phimeca

Tested with opsi 4.0.2
Tested with Windows XP Professional and Windows 7 Enterprise x64

Installation Script for Adobe Reader 9.5 with patchs and uninstalling version 10.0
Uninstallation Script for Adobe Reader Versions 9.5.0 - 9.5.4

The installation files can be downloaded from: ftp://ftp.adobe.com/pub/adobe/reader/win/9.x/

setup.ins

[Actions]
 
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $MsiFile$
DefVar $LogDir$
DefVar $InstallDir$
DefVar $DisplayVersion$
 
Set $LogDir$ = "%SystemDrive%\tmp"
Set $ProductId$ = "AdobeReader"
Set $MinimumSpace$ = "150 MB"
Set $MsiFile$ = "%ScriptPath%\AdbeRdr950_fr_FR.msi"
Set $InstallDir$ = "%ProgramFilesDir%\Adobe\Reader 9.0\Reader\AcroRd32.exe"
 
; Retrieve version already install
Set $DisplayVersion$ = GetRegistrystringvalue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1036-7B44-A95000000001}] DisplayVersion")
 
 
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
  LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
  isFatalError
else
  ShowBitmap "%ScriptPath%\"  + $ProductId$ + ".png"
  Message "Installing " + $ProductId$ + ". It can takes several minutes, please be patient..."
endif
 
 
; remove version 10.0
if FileExists("%ProgramFilesDir%\Adobe\Reader 10.0\Reader\AcroRd32.exe")
  Message "Uninstalling " + $ProductId$ + " ..."
  Winbatch_uninstall_v10
endif
 
; install adobe 9.5.0
if not(FileExists(""+$InstallDir$+""))
  Winbatch_install
  Sub "%ScriptPath%\check_exit_code.ins"
endif
 
Set $DisplayVersion$ = GetRegistrystringvalue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1036-7B44-A95000000001}] DisplayVersion")
 
if ($DisplayVersion$ = "9.5.0")
  Winbatch_patch_install_951
  Sub "%ScriptPath%\check_exit_code.ins"
endif
 
Set $DisplayVersion$ = GetRegistrystringvalue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1036-7B44-A95000000001}] DisplayVersion")
 
if ($DisplayVersion$ = "9.5.1")
  Winbatch_patch_install_952
  Sub "%ScriptPath%\check_exit_code.ins"
endif
 
Set $DisplayVersion$ = GetRegistrystringvalue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1036-7B44-A95000000001}] DisplayVersion")
 
if ($DisplayVersion$ = "9.5.2")
  Winbatch_patch_install_953
  Sub "%ScriptPath%\check_exit_code.ins"
endif
 
Set $DisplayVersion$ = GetRegistrystringvalue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1036-7B44-A95000000001}] DisplayVersion")
 
if ($DisplayVersion$ = "9.5.3")
  Winbatch_patch_install_954
  Sub "%ScriptPath%\check_exit_code.ins"
endif
 
Files_remove_shortcut
 
if not(FileExists(""+$InstallDir$+""))
  Message "Error: file " + $InstallDir$ + " not found after installing " + $ProductId$ + "!"
  isFatalError
endif
 
 
[Winbatch_install]
msiexec /i "$MsiFile$" /l* "$LogDir$\$ProductId$.install_log.txt" /qn ALLUSERS=2 REBOOT=ReallySuppress EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES
; delete tasks update
chtasks /delete /TN "Adobe Flash Player Updater" /F
 
 
[Files_remove_shortcut]
delete "%CommonDesktopDir%\Adobe Reader 9.lnk"
 
; install patch
[Winbatch_patch_install_951]
msiexec /p "%ScriptPath%\AdbeRdrUpd951_all_incr.msp" /qn
 
[Winbatch_patch_install_952]
msiexec /p "%ScriptPath%\AdbeRdrUpd952_all_incr.msp" /qn
 
[Winbatch_patch_install_953]
msiexec /p "%ScriptPath%\AdbeRdrUpd953_all_incr.msp" /qn
 
[Winbatch_patch_install_954]
msiexec /p "%ScriptPath%\AdbeRdrUpd954_all_incr.msp" /qn
 
 
[Winbatch_uninstall_v10]
msiexec /qn /x{AC76BA86-7AD7-1033-7B44-AA1000000001}
msiexec /qn /x{AC76BA86-7AD7-1036-7B44-AA1000000001}

uninstall.ins

[Actions]
DefVar $MsiFile$
DefVar $InstallDir$
DefVar $ProductId$
 
Set $ProductId$ = "AdobeReader"
Set $MsiFile$ = "%ScriptPath%\AdbeRdr950_fr_FR.msi"
Set $InstallDir$ = "%ProgramFilesDir%\Adobe\Reader 9.0\Reader\AcroRd32.exe"
 
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png"
KillTask "AcroRd32.exe"
 
if FileExists(""+$InstallDir$+"")
  Message "Uninstalling " + $ProductId$ + " ..."
  Winbatch_uninstall_v950
  Sub "%ScriptPath%\check_exit_code.ins"
endif
 
 
[Winbatch_uninstall_v950]
msiexec /x "$MsiFile$" REBOOT=ReallySuppress /qn

check_exit_code.ins

; $ProductId$ must be defined and set 
 
comment "Test for installation success via exit code."
if (getLastExitCode = "0")
    comment "Looks good: " + $ProductId$ + " program gives exitcode zero"
else
    LogError $ProductId$ + " program gives a exitcode unequal zero: " + getLastExitCode
    comment "program gives an exitcode unequal to zero: " + getLastExitCode
    isFatalError
endif

QR Code
QR Code userspace:adobe_reader_9.x (generated for current page)