add ProductProperty DesktopLink, CustomPostInstall, CustomPostUninstall

This commit is contained in:
Dominik Daehn
2019-10-18 10:03:51 +02:00
parent 015472abcf
commit ab8035806c
8 changed files with 227 additions and 0 deletions

View File

@@ -34,6 +34,10 @@ set $languageInfo$ = getLocaleInfoMap
DefVar $LanguageId$
set $LanguageId$ = getValue("default_language_id_decimal", $languageInfo$)
;Property Variables
DefVar $Property_CustomPostInstall$
DefVar $Property_DesktopLink$
Set $LogDir$ = "%opsiLogDir%"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@@ -120,9 +124,24 @@ else
comment "Create shortcuts"
LinkFolder_install
Set $Property_DesktopLink$ = GetProductProperty("DesktopLink","false")
if ($Property_DesktopLink$ = "true")
LinkFolder_install_DesktopLink
endif
comment "File Type Association"
DosInAnIcon_FileTypeAssoc_install
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
[Winbatch_install]
@@ -206,6 +225,22 @@ delete_element "$NAME$"
; icon_index: 2
; end_link
[LinkFolder_install_DesktopLink]
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
set_basefolder common_desktopdirectory
set_subfolder ""
;
set_link
name: $NAME$
target: "$InstallDir$\$ProgramExecutable$"
parameters:
working_dir: $InstallDir$
icon_file:
icon_index:
end_link
[DosInAnIcon_FileTypeAssoc_install]
; Requires danysys.sfta
; Sample Usage:
@@ -229,6 +264,9 @@ delete_element "$NAME$"
; Update value of an element
; xml ed -u "/xml/table/rec[@id=1]/numField" -v 0 "$InstallDir$\config.xml"> "$InstallDir$\config.model.xml"
[sub_CustomPostInstall]
include_insert "%ScriptPath%\custom\" + $Property_CustomPostInstall$
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used"