fixed reinstall (uninstall & install)

This commit is contained in:
DT Netsolution GmbH 2012-04-27 15:01:32 +02:00
parent eef9900764
commit 33db18d1be
2 changed files with 18 additions and 31 deletions

View File

@ -3,44 +3,33 @@
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
DefVar $SecMonitorProgram$
Set $SecMonitorProgram$ = $InstallDir$ + "\SecMonitor.exe"
Set $MsiId$ = '{106BB145-4FF6-4473-B0AE-CD8502CD123A}'
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
if FileExists($SecMonitorProgram$)
Message "Uninstalling " + $ProductId$ + " ..."
Message "Uninstalling " + $ProductId$ + " ..."
comment "Delete files"
Files_uninstall /32Bit
comment "Cleanup registry"
Registry_uninstall /32Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall
sub_check_exitcode
endif
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
comment "Trigger reboot"
ExitWindows /ImmediateReboot
endif
comment "Delete files"
Files_uninstall /32Bit
comment "Cleanup registry"
Registry_uninstall /32Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
[Winbatch_uninstall]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; "$UninstallProgram$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgram$" /silent /norestart
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
msiexec /x "$Msi32$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb!
[Files_uninstall]
; Example for recursively deleting the installation directory (don't forget the trailing backslash):
@ -64,6 +53,7 @@ msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
; set_subfolder ""
; delete_element $ProductId$
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode

View File

@ -39,9 +39,6 @@ Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub32.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub32.ins"
comment "Trigger reboot"
ExitWindows /Reboot
endif
if $LicenseRequired$ = "true"