Skip to content

Commit 2db7193

Browse files
committed
feat: place windows shortcut in start menu programs directory, closes #13
1 parent b714bef commit 2db7193

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

suap/templates/nsis_installer_script.nsi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ SetCompressor /SOLID Lzma
3030
# installer, it's where the installation
3131
# of the application and uninstaller happens.
3232
Section "MainSection"
33+
SetShellVarContext all
34+
3335
# Where we place our application binary file and other files.
3436
SetOutPath "$INSTDIR"
3537

@@ -43,17 +45,21 @@ Section "MainSection"
4345
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\{suap-project-name}" "DisplayName" "{suap-display-name}"
4446
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\{suap-project-name}" "UninstallString" "$INSTDIR\uninstall.exe"
4547

46-
CreateShortcut "$DESKTOP\{suap-project-name}.lnk" "$INSTDIR\{suap-binary-name}.exe" "" "$INSTDIR\{suap-icon-file-name}" 0
48+
# Placing shortcut in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"
49+
CreateDirectory "$SMPROGRAMS\Cloudy"
50+
CreateShortcut "$SMPROGRAMS\Cloudy\{suap-project-name}.lnk" "$INSTDIR\{suap-binary-name}.exe" "" "$INSTDIR\{suap-icon-file-name}" 0
4751
SectionEnd
4852

4953
Section "Uninstall"
54+
SetShellVarContext all
55+
5056
# Where we remove our application binary file and other files.
5157
Delete "$INSTDIR\{suap-binary-name}.exe"
5258
Delete "$INSTDIR\{suap-icon-file-name}"
5359
Delete "$INSTDIR\uninstall.exe"
5460
RMDir "$INSTDIR"
5561

56-
Delete "$DESKTOP\{suap-project-name}.lnk"
62+
Delete "$SMPROGRAMS\Cloudy\{suap-project-name}.lnk"
5763

5864
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\{suap-project-name}"
5965
SectionEnd

0 commit comments

Comments
 (0)