diff --git a/sample/All/CLIENT_DATA/delsub32.opsiscript b/sample/All/CLIENT_DATA/delsub32.opsiscript index 35faa49..9f18884 100644 --- a/sample/All/CLIENT_DATA/delsub32.opsiscript +++ b/sample/All/CLIENT_DATA/delsub32.opsiscript @@ -24,12 +24,14 @@ if FileExists($IniFile$) comment "Uninstall program found, starting uninstall" Winbatch_uninstall_old sub_check_exitcode + ;set $Reboot$="1" endif endif if FileExists($UninstallProgram$) comment "Uninstall program found, starting uninstall" Winbatch_uninstall sub_check_exitcode + ;set $Reboot$="1" endif if FileExists($IniFile$) @@ -38,12 +40,14 @@ if FileExists($IniFile$) comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version" Winbatch_uninstall_msi_old sub_check_exitcode + ;set $Reboot$="1" endif 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 + ;set $Reboot$="1" endif ;comment "Kill Web Browser" @@ -58,6 +62,10 @@ Registry_uninstall /32Bit comment "Delete program shortcuts" LinkFolder_uninstall +if $Reboot$="1" + ExitWindows /ImmediateReboot +endif + [Winbatch_uninstall_old] ; Choose one of the following examples as basis for program uninstall ; diff --git a/sample/All/CLIENT_DATA/delsub3264.opsiscript b/sample/All/CLIENT_DATA/delsub3264.opsiscript index 604854a..8a16efc 100644 --- a/sample/All/CLIENT_DATA/delsub3264.opsiscript +++ b/sample/All/CLIENT_DATA/delsub3264.opsiscript @@ -108,6 +108,10 @@ endif comment "Delete program shortcuts" LinkFolder_uninstall +if $Reboot$="1" + ExitWindows /ImmediateReboot +endif + [Winbatch_uninstall_old_32] ; Choose one of the following examples as basis for program uninstall ; diff --git a/sample/All/CLIENT_DATA/delsub64.opsiscript b/sample/All/CLIENT_DATA/delsub64.opsiscript index 2775a51..81c067d 100644 --- a/sample/All/CLIENT_DATA/delsub64.opsiscript +++ b/sample/All/CLIENT_DATA/delsub64.opsiscript @@ -58,6 +58,10 @@ Registry_uninstall /64Bit comment "Delete program shortcuts" LinkFolder_uninstall +if $Reboot$="1" + ExitWindows /ImmediateReboot +endif + [Winbatch_uninstall_old] ; Choose one of the following examples as basis for program uninstall ; diff --git a/sample/All/CLIENT_DATA/setup32.opsiscript b/sample/All/CLIENT_DATA/setup32.opsiscript index 6e9f853..5345c16 100644 --- a/sample/All/CLIENT_DATA/setup32.opsiscript +++ b/sample/All/CLIENT_DATA/setup32.opsiscript @@ -26,6 +26,8 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ +DefVar $Reboot$ + DefStringList $languageInfo$ set $languageInfo$ = getLocaleInfoMap DefVar $LanguageId$ diff --git a/sample/All/CLIENT_DATA/setup3264.opsiscript b/sample/All/CLIENT_DATA/setup3264.opsiscript index 95f2f48..a08dfbc 100644 --- a/sample/All/CLIENT_DATA/setup3264.opsiscript +++ b/sample/All/CLIENT_DATA/setup3264.opsiscript @@ -33,6 +33,8 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ +DefVar $Reboot$ + Set $INST_SystemType$ = GetSystemType set $INST_architecture$ = GetProductProperty("install_architecture","system specific") diff --git a/sample/All/CLIENT_DATA/setup64.opsiscript b/sample/All/CLIENT_DATA/setup64.opsiscript index f7ecb88..0128823 100644 --- a/sample/All/CLIENT_DATA/setup64.opsiscript +++ b/sample/All/CLIENT_DATA/setup64.opsiscript @@ -26,6 +26,8 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ +DefVar $Reboot$ + DefStringList $languageInfo$ set $languageInfo$ = getLocaleInfoMap DefVar $LanguageId$ diff --git a/sample/All/CLIENT_DATA/uninstall32.opsiscript b/sample/All/CLIENT_DATA/uninstall32.opsiscript index c870492..3b65e4d 100644 --- a/sample/All/CLIENT_DATA/uninstall32.opsiscript +++ b/sample/All/CLIENT_DATA/uninstall32.opsiscript @@ -22,6 +22,8 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ +DefVar $Reboot$ + Set $LogDir$ = "%opsiLogDir%" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh diff --git a/sample/All/CLIENT_DATA/uninstall3264.opsiscript b/sample/All/CLIENT_DATA/uninstall3264.opsiscript index 28e65a6..2a13cae 100644 --- a/sample/All/CLIENT_DATA/uninstall3264.opsiscript +++ b/sample/All/CLIENT_DATA/uninstall3264.opsiscript @@ -29,10 +29,11 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ +DefVar $Reboot$ + Set $INST_SystemType$ = GetSystemType set $INST_architecture$ = GetProductProperty("install_architecture","system specific") - Set $LogDir$ = "%opsiLogDir%" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh diff --git a/sample/All/CLIENT_DATA/uninstall64.opsiscript b/sample/All/CLIENT_DATA/uninstall64.opsiscript index 85d295a..bfdbe76 100644 --- a/sample/All/CLIENT_DATA/uninstall64.opsiscript +++ b/sample/All/CLIENT_DATA/uninstall64.opsiscript @@ -22,6 +22,8 @@ DefVar $OLD_VERSION$ DefVar $OLD_CREATOR_TAG$ DefVar $OLD_RELEASE$ +DefVar $Reboot$ + Set $LogDir$ = "%opsiLogDir%" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh