change package to use the new msi

This commit is contained in:
Mario Fetka 2016-08-27 09:50:31 +02:00
parent 0a60a8aa53
commit f0d8a10f32
6 changed files with 25 additions and 32 deletions

View File

@ -4,7 +4,6 @@
; credits: http://www.opsi.org/en/credits/ ; credits: http://www.opsi.org/en/credits/
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini" Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
if FileExists($IniFile$) if FileExists($IniFile$)
@ -14,23 +13,20 @@ if FileExists($IniFile$)
endif endif
Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..." Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
Dosbatch_uninstall
sub_check_exitcode
if FileExists($IniFile$) if FileExists($IniFile$)
Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe") Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$ if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "")
if FileExists($UninstallProgramOld$) comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version"
comment "Uninstall program found, starting uninstall" Winbatch_uninstall_msi_old
Dosbatch_uninstall sub_check_exitcode
sub_check_exitcode endif
Winbatch_uninstall_old /WaitforProcessending "Au_.exe" /Timeoutseconds 10
sub_check_exitcode
endif
endif endif
if FileExists($UninstallProgram$) if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
comment "Uninstall program found, starting uninstall" comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
Dosbatch_uninstall Winbatch_uninstall_msi
sub_check_exitcode
Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
sub_check_exitcode sub_check_exitcode
endif 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. ; 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" copy /Y "%System%\print.exe" "$InstallDir$\putty.exe"
[Winbatch_uninstall_old] [Winbatch_uninstall_msi_old]
"$UninstallProgramOld$" /sp- /verysilent /norestart msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi]
[Winbatch_uninstall] msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
"$UninstallProgram$" /sp- /verysilent /norestart
[Files_uninstall] [Files_uninstall]
; Example for recursively deleting the installation directory: ; Example for recursively deleting the installation directory:

View File

@ -6,8 +6,7 @@
[Actions] [Actions]
requiredWinstVersion >= "4.11.2.6" requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram$ DefVar $MsiIdOld$
DefVar $UninstallProgramOld$
DefVar $IniFile$ DefVar $IniFile$
DefVar $IniCfgFile$ DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
@ -37,7 +36,7 @@ Set $LogDir$ = "%SystemDrive%\tmp"
;$ProductId$ should be the name of the product in opsi ;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, ; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator ; 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 ; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\PuTTY" Set $InstallDir$ = "%ProgramFiles32Dir%\PuTTY"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -76,7 +75,7 @@ else
endif endif
[Winbatch_install] [Winbatch_install]
"$InstallExe$" /sp- /verysilent msiexec /i "$InstallMsi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
[Files_install] [Files_install]
; copy the ini file to the InstallDir ; copy the ini file to the InstallDir

View File

@ -6,8 +6,7 @@
[Actions] [Actions]
requiredWinstVersion >= "4.11.2.6" requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram$ DefVar $MsiIdOld$
DefVar $UninstallProgramOld$
DefVar $IniFile$ DefVar $IniFile$
DefVar $IniCfgFile$ DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$

View File

@ -19,14 +19,14 @@ TYPE="public"
DL_FILE[0]="putty_by_apathy22.png" 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_SOURCE[0]="http://fc03.deviantart.net/fs8/i/2005/302/a/0/putty_by_apathy22.png"
DL_FILE[1]="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.exe" DL_SOURCE[1]="http://the.earth.li/~sgtatham/putty/latest/x86/putty-${VERSION}-installer.msi"
DL_ARCH[1]="X86" 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 # File array index for the image showing while installing the program
ICON_DL_INDEX=0 ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86" OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg" OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="unins000.exe" OPSI_INI_VALUE[0]="{ED9EF59B-0799-428E-823D-6D2B7B4FE2E0}"

View File

@ -1 +0,0 @@
3911d72eb2371b9a530744a4afef993ecdd2f57e /home/mario/.opsi-dist-cache/bitvise.putty-0.67/X86/putty-0.67-installer.exe

View File

@ -0,0 +1 @@
f7e4eff6ef17a88c4854654f93d87e1de01d7182 /home/mario/.opsi-dist-cache/bitvise.putty-0.67/X86/putty-0.67-installer.msi