change LogDir; add ProductProperty desktoplink, custom-post-install, custom-post-uninstall

fix incorrect path for the InstallDir
This commit is contained in:
Dominik Daehn 2019-06-19 07:12:06 +02:00
parent c26caf20e4
commit 0be36aeaab
4 changed files with 70 additions and 9 deletions

View File

@ -67,6 +67,17 @@ if $Reboot$="1"
ExitWindows /ImmediateReboot
endif
DefVar $Property_CustomPostUninstall$
Set $Property_CustomPostUninstall$ = getProductProperty("custom-post-uninstall","none")
if not ($Property_CustomPostUninstall$ = "none")
comment "Include custom post uninstall file"
if FileExists("%ScriptPath%\custom\" + $Property_CustomPostUninstall$)
sub_CustomPostUninstall
else
LogError "Include script NOT exists (" + $Property_CustomPostUninstall$ +")"
endif
endif
[Winbatch_uninstall_old]
"$UninstallProgramOld$" /S
@ -91,9 +102,12 @@ del -sf "$InstallDir$\"
;
; Example of deleting a shortcut from AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
; delete_element $ProductId$
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element Kleopatra
[sub_CustomPostUninstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostUninstall$
[Sub_check_exitcode]
comment "Test for installation success via exit code"

View File

@ -20,7 +20,11 @@ DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
DefVar $Reboot$
Set $LogDir$ = "%SystemDrive%\tmp"
;Property Variables
DefVar $Property_CustomPostInstall$
DefVar $Property_DesktopLink$
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
@ -40,7 +44,7 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; no white space use '-' as a seperator
Set $MinimumSpace$ = "20 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\GnuPG"
Set $InstallDir$ = "%ProgramFiles32Dir%\Gpg4win"
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
@ -71,8 +75,21 @@ else
comment "Patch Registry"
Registry_install /32Bit
comment "Create shortcuts"
LinkFolder_install
Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
if ($Property_DesktopLink$ = "false")
comment "Create shortcuts"
LinkFolder_install
endif
Set $Property_CustomPostInstall$ = getProductProperty("custom-post-install","none")
if not ($Property_CustomPostInstall$ = "none")
comment "Include custom post install file"
if FileExists("%ScriptPath%\custom\" + $Property_CustomPostInstall$)
sub_CustomPostInstall
else
LogError "Include script NOT exists (" + $Property_CustomPostInstall$ +")"
endif
endif
endif
@ -96,6 +113,9 @@ copy "$IniCfgFile$" "$InstallDir$"
; set "name3" = REG_BINARY:00 af 99 cd
[LinkFolder_install]
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element Kleopatra
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
@ -129,6 +149,9 @@ copy "$IniCfgFile$" "$InstallDir$"
; icon_index: 2
; end_link
[sub_CustomPostInstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode

View File

@ -19,7 +19,7 @@ DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
DefVar $Reboot$
Set $LogDir$ = "%SystemDrive%\tmp"
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
@ -34,7 +34,7 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\GnuPG"
Set $InstallDir$ = "%ProgramFiles32Dir%\Gpg4win"
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"

View File

@ -21,6 +21,30 @@ onceScript:
customScript:
userLoginScript:
[ProductProperty]
type: bool
name: desktoplink
description: Show Desktop Link on/off
default: False
[ProductProperty]
type: unicode
name: custom-post-install
multivalue: False
editable: True
description: Define filename for include script in custom directory after installation
values: ["none"]
default: ["none"]
[ProductProperty]
type: unicode
name: custom-post-uninstall
multivalue: False
editable: True
description: Define filename for include script in custom directory after uninstallation
values: ["none"]
default: ["none"]
[Changelog]
gpg4win (2.1.0-5) stable; urgency=low