mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Installer: Prevented duplicate startup shortcut
This commit is contained in:
parent
73525ea999
commit
14ea42120e
@ -731,13 +731,18 @@ SkipIniMove:
|
||||
${EndIf}
|
||||
CreateShortcut "$0" "$INSTDIR\Rainmeter.exe" "" "$INSTDIR\Rainmeter.exe" 0
|
||||
|
||||
${If} $AutoStartup == 1
|
||||
${If} ${FileExists} "$SMSTARTUP\Rainmeter.lnk"
|
||||
; Remove user shortcut to prevent duplicate with all users shortcut
|
||||
!insertmacro UAC_AsUser_Call Function RemoveUserStartupShortcut ${UAC_SYNCREGISTERS}
|
||||
${Else}
|
||||
!insertmacro UAC_AsUser_Call Function CreateUserStartupShortcut ${UAC_SYNCREGISTERS}
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
SetShellVarContext current
|
||||
Call RemoveStartMenuShortcuts
|
||||
|
||||
${If} $AutoStartup == 1
|
||||
!insertmacro UAC_AsUser_Call Function CreateStartupShortcut ${UAC_SYNCREGISTERS}
|
||||
${EndIf}
|
||||
|
||||
!insertmacro UAC_AsUser_Call Function RemoveStartMenuShortcuts ${UAC_SYNCREGISTERS}
|
||||
|
||||
WriteUninstaller "$INSTDIR\uninst.exe"
|
||||
@ -763,8 +768,14 @@ Function RemoveStartMenuShortcuts
|
||||
!insertmacro RemoveStartMenuShortcuts "$SMPROGRAMS\Rainmeter"
|
||||
FunctionEnd
|
||||
|
||||
Function CreateStartupShortcut
|
||||
CreateShortcut "$SMSTARTUP\Rainmeter.lnk" "$INSTDIR\Rainmeter.exe" "" "$INSTDIR\Rainmeter.exe" 0
|
||||
Function CreateUserStartupShortcut
|
||||
SetShellVarContext current
|
||||
CreateShortcut "$SMSTARTUP\Rainmeter.lnk" "$INSTDIR\Rainmeter.exe" "" "$INSTDIR\Rainmeter.exe" 0
|
||||
FunctionEnd
|
||||
|
||||
Function RemoveUserStartupShortcut
|
||||
SetShellVarContext current
|
||||
Delete "$SMSTARTUP\Rainmeter.lnk"
|
||||
FunctionEnd
|
||||
|
||||
Function FinishRun
|
||||
|
Loading…
Reference in New Issue
Block a user