This is an old revision of the document!
Adaptation of the opsi-template scripts for Foxit PDF Reader.
The Foxit Reader is a small, fast, and feature rich PDF viewer which allows you to open, view, and print any PDF file.
We use the Enterprise version, but this script will probably also work with the normal version: http://www.foxitsoftware.com/Secure_PDF_Reader/enterprise.php
The registry settings are for setting of the preferences. setup.ins and uninstall.ins have some double code, but I find it easier this way, seperate scripts for setup and uninstall.
[Package] version: 2 depends: incremental: False [Product] type: localboot id: foxit-pdf-reader name: Foxit PDF Reader description: Small and fast PDF Reader advice: version: 5.3.1.0606 priority: -50 licenseRequired: False productClasses: setupScript: setup.ins uninstallScript: uninstall.ins updateScript: alwaysScript: onceScript: customScript: userLoginScript: [Changelog] foxit-pdf-reader (5.3.1.0606-1) testing; urgency=low * Initial package -- ICT <ict@your-mom.com> Fri, 13 Jul 2012 13:14:18 +0000
[Actions] requiredWinstVersion >= "4.11.2.1" DefVar $MsiId$ DefVar $LogDir$ DefVar $ProductId$ DefVar $MinimumSpace$ DefVar $InstallDir$ DefVar $ExitCode$ Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- Set $ProductId$ = "foxit-pdf-reader" Set $MinimumSpace$ = "100 MB" Set $MsiId$ = '{F2039701-72DE-499E-A464-15F3C9EEC3AA}' Set $InstallDir$ = "%ProgramFiles32Dir%\Foxit PDF Reader" ; ---------------------------------------------------------------- if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$)) LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$ isFatalError ; Stop process and set installation status to failed else comment "Show product picture" ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "") comment "MSI id " + $MsiId$ + " found in registry, starting uninstall" Winbatch_uninstall sub_check_exitcode endif Message "Installing " + $ProductId$ + " ..." comment "Start setup program" Winbatch_install Sub_check_exitcode comment "Patch Registry" Registry_install /AllNTUserDats endif [Winbatch_install] msiexec /qn /package "%ScriptPath%\files\EnterpriseFoxitReader531.0606_enu.msi" ALLUSERS=1 DESKTOP_SHORTCUT=0 VIEW_IN_BROWSER=0 ADDLOCAL=ALL REMOVE=FX_FIREFOXPLUGIN,FX_SPELLCHECK,FX_SE INSTALLLOCATION="$InstallDir$" [Registry_install] openkey [HKEY_CURRENT_USER\Software\Foxit Software\Foxit Reader 5.0\StartPage\Advertisement] set "bShowAdvertise"=REG_DWORD:00000000 openkey [HKEY_CURRENT_USER\Software\Foxit Software\Foxit Reader 5.0\SpellCheck] set "Enabled"=REG_DWORD:00000000 openkey [HKEY_CURRENT_USER\Software\Foxit Software\Foxit Reader 5.0\plugins\Updater] set "IsAutoUpdater"="0" set "UpdateMode"="0" openkey [HKEY_CURRENT_USER\Software\Foxit Software\Foxit Reader 5.0\Windows] set "DefaultStyle"=REG_DWORD:00000001 openkey [HKEY_CURRENT_USER\Software\Foxit Software\Foxit Reader 5.0\Windows\Toolbars\Toolbar\View] set "ID"=REG_DWORD:000059595 set "RectRecentFloat"=REG_BINARY:15 00 00 00 36 00 00 00 b6 01 00 00 6e 00 00 00 set "RectRecentDocked"=REG_BINARY:d3 02 00 00 19 00 00 00 97 04 00 00 3d 00 00 00 set "RecentFrameAlignment"=REG_DWORD:00008192 set "RecentRowIndex"=REG_DWORD:00000001 set "IsFloating"=REG_DWORD:00000000 set "MRUWidth"=REG_DWORD:00000409 set "PinState"=REG_DWORD:00000000 set "IsVisible"=REG_DWORD:00000001 set "IsDefaultLayout"=REG_DWORD:00000000 [Winbatch_uninstall] msiexec /qn /uninstall $MsiId$ [Sub_check_exitcode] comment "Test for installation success via exit code" set $ExitCode$ = getLastExitCode ; informations to exit codes see ; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx ; http://msdn.microsoft.com/en-us/library/aa368542.aspx if ($ExitCode$ = "0") comment "Looks good: setup program gives exitcode zero" else comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ if ($ExitCode$ = "1605") comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed." comment "Uninstall of a not installed product failed - no problem" else if ($ExitCode$ = "1641") comment "looks good: setup program gives exitcode 1641" comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success." else if ($ExitCode$ = "3010") comment "looks good: setup program gives exitcode 3010" comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success." else logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$ isFatalError endif endif endif endif
[Actions] requiredWinstVersion >= "4.11.2.1" DefVar $MsiId$ DefVar $LogDir$ DefVar $ProductId$ DefVar $InstallDir$ DefVar $ExitCode$ Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- Set $ProductId$ = "foxit-pdf-reader" Set $MsiId$ = '{F2039701-72DE-499E-A464-15F3C9EEC3AA}' Set $InstallDir$ = "%ProgramFiles32Dir%\Foxit PDF Reader" ; ---------------------------------------------------------------- comment "Show product picture" ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ Message "Uninstalling " + $ProductId$ + " ..." if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "") comment "MSI id " + $MsiId$ + " found in registry, starting uninstall" Winbatch_uninstall sub_check_exitcode endif [Winbatch_uninstall] msiexec /qn /uninstall $MsiId$ [Sub_check_exitcode] comment "Test for installation success via exit code" set $ExitCode$ = getLastExitCode ; informations to exit codes see ; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx ; http://msdn.microsoft.com/en-us/library/aa368542.aspx if ($ExitCode$ = "0") comment "Looks good: setup program gives exitcode zero" else comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ if ($ExitCode$ = "1605") comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed." comment "Uninstall of a not installed product failed - no problem" else if ($ExitCode$ = "1641") comment "looks good: setup program gives exitcode 1641" comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success." else if ($ExitCode$ = "3010") comment "looks good: setup program gives exitcode 3010" comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success." else logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$ isFatalError endif endif endif endif