From f0d8a10f321306d0f904c6d70c7e97b23db7d13c Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 27 Aug 2016 09:50:31 +0200 Subject: [PATCH] change package to use the new msi --- CLIENT_DATA/delsub32.ins | 35 ++++++++++++++------------------ CLIENT_DATA/setup32.ins | 7 +++---- CLIENT_DATA/uninstall32.ins | 3 +-- builder-product.cfg | 10 ++++----- putty-0.67-installer.exe.sha1sum | 1 - putty-0.67-installer.msi.sha1sum | 1 + 6 files changed, 25 insertions(+), 32 deletions(-) delete mode 100644 putty-0.67-installer.exe.sha1sum create mode 100644 putty-0.67-installer.msi.sha1sum diff --git a/CLIENT_DATA/delsub32.ins b/CLIENT_DATA/delsub32.ins index 19af72e..7d1271c 100644 --- a/CLIENT_DATA/delsub32.ins +++ b/CLIENT_DATA/delsub32.ins @@ -4,7 +4,6 @@ ; credits: http://www.opsi.org/en/credits/ -Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$ Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini" if FileExists($IniFile$) @@ -14,23 +13,20 @@ if FileExists($IniFile$) endif Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..." +Dosbatch_uninstall +sub_check_exitcode if FileExists($IniFile$) - Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe") - Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$ - if FileExists($UninstallProgramOld$) - comment "Uninstall program found, starting uninstall" - Dosbatch_uninstall - sub_check_exitcode - Winbatch_uninstall_old /WaitforProcessending "Au_.exe" /Timeoutseconds 10 - sub_check_exitcode - endif + Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "") + comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version" + Winbatch_uninstall_msi_old + sub_check_exitcode + endif endif -if FileExists($UninstallProgram$) - comment "Uninstall program found, starting uninstall" - Dosbatch_uninstall - sub_check_exitcode - Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10 +if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "") + comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall" + Winbatch_uninstall_msi sub_check_exitcode endif @@ -47,12 +43,11 @@ LinkFolder_uninstall ; PuTTY 0.58+ uninstallers call 'putty -cleanup-during-uninstall' during uninstall. This causes a pop-up to appear which breaks the silent uninstall. copy /Y "%System%\print.exe" "$InstallDir$\putty.exe" -[Winbatch_uninstall_old] -"$UninstallProgramOld$" /sp- /verysilent /norestart +[Winbatch_uninstall_msi_old] +msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress - -[Winbatch_uninstall] -"$UninstallProgram$" /sp- /verysilent /norestart +[Winbatch_uninstall_msi] +msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress [Files_uninstall] ; Example for recursively deleting the installation directory: diff --git a/CLIENT_DATA/setup32.ins b/CLIENT_DATA/setup32.ins index ce68d4b..2606e3e 100644 --- a/CLIENT_DATA/setup32.ins +++ b/CLIENT_DATA/setup32.ins @@ -6,8 +6,7 @@ [Actions] requiredWinstVersion >= "4.11.2.6" -DefVar $UninstallProgram$ -DefVar $UninstallProgramOld$ +DefVar $MsiIdOld$ DefVar $IniFile$ DefVar $IniCfgFile$ DefVar $LogDir$ @@ -37,7 +36,7 @@ Set $LogDir$ = "%SystemDrive%\tmp" ;$ProductId$ should be the name of the product in opsi ; therefore please: only lower letters, no umlauts, ; no white space use '-' as a seperator -Set $MinimumSpace$ = "20 MB" +Set $MinimumSpace$ = "1 MB" ; the path were we find the product after the installation Set $InstallDir$ = "%ProgramFiles32Dir%\PuTTY" ; ---------------------------------------------------------------- @@ -76,7 +75,7 @@ else endif [Winbatch_install] -"$InstallExe$" /sp- /verysilent +msiexec /i "$InstallMsi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress [Files_install] ; copy the ini file to the InstallDir diff --git a/CLIENT_DATA/uninstall32.ins b/CLIENT_DATA/uninstall32.ins index d35d4ca..b10c820 100644 --- a/CLIENT_DATA/uninstall32.ins +++ b/CLIENT_DATA/uninstall32.ins @@ -6,8 +6,7 @@ [Actions] requiredWinstVersion >= "4.11.2.6" -DefVar $UninstallProgram$ -DefVar $UninstallProgramOld$ +DefVar $MsiIdOld$ DefVar $IniFile$ DefVar $IniCfgFile$ DefVar $LogDir$ diff --git a/builder-product.cfg b/builder-product.cfg index 5f89ac5..11f9285 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -19,14 +19,14 @@ TYPE="public" DL_FILE[0]="putty_by_apathy22.png" DL_SOURCE[0]="http://fc03.deviantart.net/fs8/i/2005/302/a/0/putty_by_apathy22.png" -DL_FILE[1]="putty-${VERSION}-installer.exe" -DL_SOURCE[1]="http://the.earth.li/~sgtatham/putty/latest/x86/putty-${VERSION}-installer.exe" +DL_FILE[1]="putty-${VERSION}-installer.msi" +DL_SOURCE[1]="http://the.earth.li/~sgtatham/putty/latest/x86/putty-${VERSION}-installer.msi" DL_ARCH[1]="X86" -DL_WINST_NAME[1]="InstallExe" +DL_WINST_NAME[1]="InstallMsi" # File array index for the image showing while installing the program ICON_DL_INDEX=0 OPSI_INI_SECTION[0]="X86" -OPSI_INI_OPTION[0]="UninstallProg" -OPSI_INI_VALUE[0]="unins000.exe" +OPSI_INI_OPTION[0]="MsiId" +OPSI_INI_VALUE[0]="{ED9EF59B-0799-428E-823D-6D2B7B4FE2E0}" diff --git a/putty-0.67-installer.exe.sha1sum b/putty-0.67-installer.exe.sha1sum deleted file mode 100644 index 00961e1..0000000 --- a/putty-0.67-installer.exe.sha1sum +++ /dev/null @@ -1 +0,0 @@ -3911d72eb2371b9a530744a4afef993ecdd2f57e /home/mario/.opsi-dist-cache/bitvise.putty-0.67/X86/putty-0.67-installer.exe diff --git a/putty-0.67-installer.msi.sha1sum b/putty-0.67-installer.msi.sha1sum new file mode 100644 index 0000000..2f84018 --- /dev/null +++ b/putty-0.67-installer.msi.sha1sum @@ -0,0 +1 @@ +f7e4eff6ef17a88c4854654f93d87e1de01d7182 /home/mario/.opsi-dist-cache/bitvise.putty-0.67/X86/putty-0.67-installer.msi