change to msi pack template

This commit is contained in:
Mario Fetka 2013-05-06 12:11:16 +02:00
parent 1217513ee9
commit dcba3c3faf
4 changed files with 18 additions and 23 deletions

View File

@ -4,7 +4,6 @@
; credits: http://www.opsi.org/en/credits/
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
if FileExists($IniFile$)
@ -15,17 +14,16 @@ endif
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
if FileExists($IniFile$)
Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe")
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$
if FileExists($UninstallProgramOld$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_old
Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86_64","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"
Winbatch_uninstall
if not (GetRegistryStringValue64("[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
@ -38,12 +36,11 @@ Registry_uninstall /64Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
[Winbatch_uninstall_old]
"$UninstallProgramOld$" -ms
[Winbatch_uninstall]
"$UninstallProgram$" -ms
[Winbatch_uninstall_msi_old]
msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
[Files_uninstall]
; Example for recursively deleting the installation directory:

View File

@ -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$ = "50 MB"
Set $MinimumSpace$ = "100 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles64Dir%\Waterfox"
; ----------------------------------------------------------------
@ -76,7 +75,8 @@ else
endif
[Winbatch_install]
"$InstallExe$" -ms
"$InstallExe$" /qb /l* "$LogDir$\$ProductId$.install_log.txt" ALLUSERS=1 REBOOT=ReallySuppress
; msiexec /i "%ScriptPath%\some.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
[Files_install]
; copy the ini file to the InstallDir

View File

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

View File

@ -27,6 +27,5 @@ DL_WINST_NAME[1]=InstallExe
ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86_64"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_VALUE[0]="uninstall\helper.exe"
OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="{FD7DEB7B-8CEA-44E5-AB2D-7C66786C0563}"