3939 StrCpy $0 " $0 --updated"
4040 ${endif}
4141
42- ExecWait ' "$PLUGINSDIR\old-uninstaller.exe" /S /KEEP_APP_DATA $0 _?=$R1'
42+ ExecWait ' "$PLUGINSDIR\old-uninstaller.exe" /S /KEEP_APP_DATA $0 $shortcuts _?=$R1'
4343 ${endif}
4444 ${endif}
4545!macroend
@@ -84,6 +84,15 @@ ${IfNot} ${Silent}
8484 SetDetailsPrint none
8585${endif}
8686
87+ StrCpy $appExe " $INSTDIR\${APP_EXECUTABLE_FILENAME}"
88+ Var /GLOBAL shortcuts
89+ StrCpy $shortcuts " "
90+ !ifndef allowToChangeInstallationDirectory
91+ ${if} ${FileExists} " $appExe"
92+ StrCpy $shortcuts " --keep-shortcuts"
93+ ${endIf}
94+ !endif
95+
8796!ifdef ONE_CLICK
8897 !ifdef HEADER_ICO
8998 File /oname= $PLUGINSDIR \installerHeaderico.ico " ${HEADER_ICO}"
@@ -102,7 +111,7 @@ ${endif}
102111 ${endif}
103112 !insertmacro CHECK_APP_RUNNING
104113!else
105- ${IfNot } ${UAC_IsInnerInstance}
114+ ${ifNot } ${UAC_IsInnerInstance}
106115 !insertmacro CHECK_APP_RUNNING
107116 ${endif}
108117!endif
@@ -168,27 +177,27 @@ SetOutPath $INSTDIR
168177
169178File " /oname=${UNINSTALL_FILENAME}" " ${UNINSTALLER_OUT_FILE}"
170179
171- StrCpy $appExe " $INSTDIR\${APP_EXECUTABLE_FILENAME}"
172180!insertmacro registryAddInstallInfo
173-
174181!insertmacro setLinkVars
175182
176183!ifdef MENU_FILENAME
177184 CreateDirectory " $SMPROGRAMS\${MENU_FILENAME}"
178185!endif
179186
180- # create shortcuts in the start menu and on the desktop
181- # shortcut for uninstall is bad cause user can choose this by mistake during search, so, we don't add it
182- CreateShortCut " $startMenuLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
183-
184- ${GetParameters} $R0
185- ${GetOptions} $R0 " --no-desktop-shortcut" $R1
186- ${If} ${Errors}
187- CreateShortCut " $desktopLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
188- ${EndIf}
189-
190- WinShell::SetLnkAUMI " $startMenuLink" " ${APP_ID}"
191- WinShell::SetLnkAUMI " $desktopLink" " ${APP_ID}"
187+ ${if} $shortcuts == " "
188+ # create shortcuts in the start menu and on the desktop
189+ # shortcut for uninstall is bad cause user can choose this by mistake during search, so, we don't add it
190+ CreateShortCut " $startMenuLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
191+ WinShell::SetLnkAUMI " $startMenuLink" " ${APP_ID}"
192+
193+ ClearErrors
194+ ${GetParameters} $R0
195+ ${GetOptions} $R0 " --no-desktop-shortcut" $R1
196+ ${If} ${Errors}
197+ CreateShortCut " $desktopLink" " $appExe" " " " $appExe" 0 " " " " " ${APP_DESCRIPTION}"
198+ WinShell::SetLnkAUMI " $desktopLink" " ${APP_ID}"
199+ ${endIf}
200+ ${endif}
192201
193202!ifmacrodef registerFileAssociations
194203 !insertmacro registerFileAssociations
0 commit comments