File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ $pp = Get-PackageParameters
7
7
if ($pp [' StartAfterInstall' ]) {
8
8
$silentArgs += ' /StartAfterInstall'
9
9
}
10
+ if ($pp [' DesktopShortcut' ]) {
11
+ $silentArgs += ' /DesktopShortcut'
12
+ }
13
+ if ($pp [' StartMenuShortcut' ]) {
14
+ $silentArgs += ' /StartMenuShortcut'
15
+ }
10
16
11
17
$packageArgs = @ {
12
18
packageName = $env: ChocolateyPackageName
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ UninstPage uninstConfirm
55
55
UninstPage instfiles
56
56
57
57
58
+ Var Parameters
58
59
Var StartMenuShortcut
59
60
Var DesktopShortcut
60
61
@@ -81,9 +82,14 @@ Function ShortcutPageLeave
81
82
FunctionEnd
82
83
83
84
84
- Function checkLaunchParam
85
- ${GetParameters} $0
85
+ Function getParams
86
+ ${GetParameters} $Parameters
86
87
ClearErrors
88
+ FunctionEnd
89
+
90
+
91
+ Function checkLaunchParam
92
+ Call getParams
87
93
${GetOptions} $0 " /StartAfterInstall" $1
88
94
${IfNot} ${Errors}
89
95
Exec " $INSTDIR\${PRODUCT}.exe"
@@ -122,12 +128,18 @@ Section "Installer"
122
128
; Run on startup
123
129
WriteRegStr HKCU " Software\Microsoft\Windows\CurrentVersion\Run" " RestoreWindowPos" ' "$InstDir\${PRODUCT}.exe"'
124
130
131
+ Call getParams
132
+
125
133
; Add start menu shortcut if option enabled
134
+ ${GetOptions} $Parameters " /StartMenuShortcut" $1
126
135
${IF} $StartMenuShortcut <> 0
136
+ ${OrIfNot} ${Errors}
127
137
createShortCut " $SMPROGRAMS\${PRODUCT}.lnk" " $INSTDIR\${PRODUCT}.exe" " --open-gui" " " " " SW_SHOWNORMAL
128
138
${ENDIF}
129
139
140
+ ${GetOptions} $Parameters " /DesktopShortcut" $1
130
141
${IF} $DesktopShortcut <> 0
142
+ ${OrIfNot} ${Errors}
131
143
createShortCut " $DESKTOP\${PRODUCT}.lnk" " $INSTDIR\${PRODUCT}.exe" " --open-gui" " " " " SW_SHOWNORMAL
132
144
${ENDIF}
133
145
You can’t perform that action at this time.
0 commit comments