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}
|
${EndIf}
|
||||||
CreateShortcut "$0" "$INSTDIR\Rainmeter.exe" "" "$INSTDIR\Rainmeter.exe" 0
|
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
|
SetShellVarContext current
|
||||||
Call RemoveStartMenuShortcuts
|
Call RemoveStartMenuShortcuts
|
||||||
|
|
||||||
${If} $AutoStartup == 1
|
|
||||||
!insertmacro UAC_AsUser_Call Function CreateStartupShortcut ${UAC_SYNCREGISTERS}
|
|
||||||
${EndIf}
|
|
||||||
|
|
||||||
!insertmacro UAC_AsUser_Call Function RemoveStartMenuShortcuts ${UAC_SYNCREGISTERS}
|
!insertmacro UAC_AsUser_Call Function RemoveStartMenuShortcuts ${UAC_SYNCREGISTERS}
|
||||||
|
|
||||||
WriteUninstaller "$INSTDIR\uninst.exe"
|
WriteUninstaller "$INSTDIR\uninst.exe"
|
||||||
@ -763,8 +768,14 @@ Function RemoveStartMenuShortcuts
|
|||||||
!insertmacro RemoveStartMenuShortcuts "$SMPROGRAMS\Rainmeter"
|
!insertmacro RemoveStartMenuShortcuts "$SMPROGRAMS\Rainmeter"
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function CreateStartupShortcut
|
Function CreateUserStartupShortcut
|
||||||
CreateShortcut "$SMSTARTUP\Rainmeter.lnk" "$INSTDIR\Rainmeter.exe" "" "$INSTDIR\Rainmeter.exe" 0
|
SetShellVarContext current
|
||||||
|
CreateShortcut "$SMSTARTUP\Rainmeter.lnk" "$INSTDIR\Rainmeter.exe" "" "$INSTDIR\Rainmeter.exe" 0
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function RemoveUserStartupShortcut
|
||||||
|
SetShellVarContext current
|
||||||
|
Delete "$SMSTARTUP\Rainmeter.lnk"
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function FinishRun
|
Function FinishRun
|
||||||
|
Loading…
Reference in New Issue
Block a user