From dcba3c3faf721935fd7a3e22c33d45ba9ce63569 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Mon, 6 May 2013 12:11:16 +0200 Subject: [PATCH] change to msi pack template --- CLIENT_DATA/delsub64.ins | 25 +++++++++++-------------- CLIENT_DATA/setup64.ins | 8 ++++---- CLIENT_DATA/uninstall64.ins | 3 +-- builder-product.cfg | 5 ++--- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/CLIENT_DATA/delsub64.ins b/CLIENT_DATA/delsub64.ins index ba7259e..c7db77f 100644 --- a/CLIENT_DATA/delsub64.ins +++ b/CLIENT_DATA/delsub64.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$) @@ -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: diff --git a/CLIENT_DATA/setup64.ins b/CLIENT_DATA/setup64.ins index dafb202..006c2cf 100644 --- a/CLIENT_DATA/setup64.ins +++ b/CLIENT_DATA/setup64.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$ = "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 diff --git a/CLIENT_DATA/uninstall64.ins b/CLIENT_DATA/uninstall64.ins index ee40b22..01c156e 100644 --- a/CLIENT_DATA/uninstall64.ins +++ b/CLIENT_DATA/uninstall64.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 538a6da..d66728b 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -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}"