Skip to content

Commit b2cee63

Browse files
committed
adjusts build win
1 parent 20eb400 commit b2cee63

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

build/windows/installer/project.nsi

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,25 @@ RequestExecutionLevel user ;
7373

7474
Name "${INFO_PRODUCTNAME}"
7575
OutFile "..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file.
76-
InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder).
76+
InstallDir "$LOCALAPPDATA\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder).
7777
ShowInstDetails show # This will always show the installation details.
7878

7979
Function .onInit
8080
!insertmacro wails.checkArchitecture
8181
FunctionEnd
8282

83+
Section "Desktop Shortcut" DeskShort
84+
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$LOCALAPPDATA\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}\${PRODUCT_EXECUTABLE}"
85+
SectionEnd
86+
87+
Section "Start Menu Shortcuts (required)"
88+
SectionIn RO
89+
90+
CreateDirectory "$SMPROGRAMS\${INFO_PRODUCTNAME}"
91+
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
92+
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" "" "$INSTDIR\${PRODUCT_EXECUTABLE}" 0
93+
SectionEnd
94+
8395
Section
8496
!insertmacro wails.setShellContext
8597

@@ -89,24 +101,19 @@ Section
89101

90102
!insertmacro wails.files
91103

92-
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
93-
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
94-
95104
!insertmacro wails.associateFiles
96105
!insertmacro wails.associateCustomProtocols
97106

98107
!insertmacro wails.writeUninstaller
99108
SectionEnd
100109

101110
Section "uninstall"
102-
!insertmacro wails.setShellContext
103-
104111
RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
105112

106113
RMDir /r $INSTDIR
107114

108-
Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
109115
Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
116+
Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}\*.*"
110117

111118
!insertmacro wails.unassociateFiles
112119
!insertmacro wails.unassociateCustomProtocols

0 commit comments

Comments
 (0)