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

This commit is contained in:
Dominik Daehn 2019-06-19 07:23:22 +02:00
parent 7eacc13d7f
commit 93e429a671
4 changed files with 75 additions and 17 deletions

View File

@ -38,6 +38,17 @@ Registry_uninstall /32Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
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$" /SILENT
@ -62,9 +73,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 $NAME$
[sub_CustomPostUninstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostUninstall$
[Sub_check_exitcode]
comment "Test for installation success via exit code"

View File

@ -19,7 +19,11 @@ DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
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:
@ -70,8 +74,21 @@ else
comment "Patch Registry"
Registry_install /32Bit
Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
if ($Property_DesktopLink$ = "true")
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
@ -116,17 +133,20 @@ copy "$IniCfgFile$" "$InstallDir$"
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
set_basefolder common_desktopdirectory
set_subfolder ""
;
; set_link
; name: $ProductId$
; target: <path to the program>
; parameters: <some_param>
; working_dir: $InstallDir$
; icon_file: <path to icon file>
; icon_index: 2
; end_link
set_link
name: $NAME$
target: "$InstallDir$\FreeCommander.exe"
parameters:
working_dir: $InstallDir$
icon_file:
icon_index:
end_link
[sub_CustomPostInstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$
[Sub_check_exitcode]
comment "Test for installation success via exit code"

View File

@ -18,7 +18,7 @@ DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $LogDir$ = "%SystemDrive%\tmp"
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:

View File

@ -30,6 +30,30 @@ description: which architecture (32/64 bit) has to be installed
values: ["32 only", "64 only", "both", "system specific"]
default: ["system specific"]
[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"]
[ProductDependency]
action: setup
requiredProduct: sereby.aio