nandi/oripublic Fork 0
3017563d783a895a85f8f8ad162b58bb5d944946
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

project.nsi · 122 lines · 5.0 KBNSIS Blame HistoryRaw
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday1Unicode true
2
3####
4## Please note: Template replacements don't work in this file. They are provided with default defines like
5## mentioned underneath.
6## If the keyword is not defined, "wails_tools.nsh" will populate them with the values from ProjectInfo.
7## If they are defined here, "wails_tools.nsh" will not touch them. This allows to use this project.nsi manually
8## from outside of Wails for debugging and development of the installer.
9##
10## For development first make a wails nsis build to populate the "wails_tools.nsh":
11## > wails build --target windows/amd64 --nsis
12## Then you can call makensis on this file with specifying the path to your binary:
13## For a AMD64 only installer:
14## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app.exe
15## For a ARM64 only installer:
16## > makensis -DARG_WAILS_ARM64_BINARY=..\..\bin\app.exe
17## For a installer with both architectures:
18## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app-amd64.exe -DARG_WAILS_ARM64_BINARY=..\..\bin\app-arm64.exe
19####
20## The following information is taken from the ProjectInfo file, but they can be overwritten here.
21####
22## !define INFO_PROJECTNAME "MyProject" # Default "{{.Name}}"
23## !define INFO_COMPANYNAME "MyCompany" # Default "{{.Info.CompanyName}}"
24## !define INFO_PRODUCTNAME "MyProduct" # Default "{{.Info.ProductName}}"
25## !define INFO_PRODUCTVERSION "1.0.0" # Default "{{.Info.ProductVersion}}"
26## !define INFO_COPYRIGHT "Copyright" # Default "{{.Info.Copyright}}"
27###
28## !define PRODUCT_EXECUTABLE "Application.exe" # Default "${INFO_PROJECTNAME}.exe"
29## !define UNINST_KEY_NAME "UninstKeyInRegistry" # Default "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
30####
31## !define REQUEST_EXECUTION_LEVEL "admin" # Default "admin" see also https://nsis.sourceforge.io/Docs/Chapter4.html
32####
33## Include the wails tools
34####
35!include "wails_tools.nsh"
36
37# The version information for this two must consist of 4 parts
38VIProductVersion "${INFO_PRODUCTVERSION}.0"
39VIFileVersion "${INFO_PRODUCTVERSION}.0"
40
41VIAddVersionKey "CompanyName" "${INFO_COMPANYNAME}"
42VIAddVersionKey "FileDescription" "${INFO_PRODUCTNAME} Installer"
43VIAddVersionKey "ProductVersion" "${INFO_PRODUCTVERSION}"
44VIAddVersionKey "FileVersion" "${INFO_PRODUCTVERSION}"
45VIAddVersionKey "LegalCopyright" "${INFO_COPYRIGHT}"
46VIAddVersionKey "ProductName" "${INFO_PRODUCTNAME}"
47
48# Enable HiDPI support. https://nsis.sourceforge.io/Reference/ManifestDPIAware
49ManifestDPIAware true
50
51!include "MUI.nsh"
52
53!define MUI_ICON "..\icon.ico"
54!define MUI_UNICON "..\icon.ico"
55# !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\leftimage.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314
56!define MUI_FINISHPAGE_NOAUTOCLOSE # Wait on the INSTFILES page so the user can take a look into the details of the installation steps
57!define MUI_ABORTWARNING # This will warn the user if they exit from the installer.
58
59!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page.
60# !insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer
61!insertmacro MUI_PAGE_DIRECTORY # In which folder install page.
62!insertmacro MUI_PAGE_INSTFILES # Installing page.
63!insertmacro MUI_PAGE_FINISH # Finished installation page.
64
65!insertmacro MUI_UNPAGE_INSTFILES # Uinstalling page
66
67!insertmacro MUI_LANGUAGE "English" # Set the Language of the installer
68
69## The following two statements can be used to sign the installer and the uninstaller. The path to the binaries are provided in %1
70#!uninstfinalize 'signtool --file "%1"'
71#!finalize 'signtool --file "%1"'
72
73Name "${INFO_PRODUCTNAME}"
74OutFile "..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file.
75!ifdef WAILS_INSTALL_SCOPE
76 !if "${WAILS_INSTALL_SCOPE}" == "user"
77 InstallDir "$LOCALAPPDATA\Programs\${INFO_PRODUCTNAME}"
78 !else
79 InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}"
80 !endif
81!else
82 InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}"
83!endif # Default installing folder ($PROGRAMFILES is Program Files folder).
84ShowInstDetails show # This will always show the installation details.
85
86Function .onInit
87 !insertmacro wails.checkArchitecture
88FunctionEnd
89
90Section
91 !insertmacro wails.setShellContext
92
93 !insertmacro wails.webview2runtime
94
95 SetOutPath $INSTDIR
96
97 !insertmacro wails.files
98
99 CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
100 CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
101
102 !insertmacro wails.associateFiles
103 !insertmacro wails.associateCustomProtocols
104
105 !insertmacro wails.writeUninstaller
106SectionEnd
107
108Section "uninstall"
109 !insertmacro wails.setShellContext
110
111 RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
112
113 RMDir /r $INSTDIR
114
115 Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
116 Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
117
118 !insertmacro wails.unassociateFiles
119 !insertmacro wails.unassociateCustomProtocols
120
121 !insertmacro wails.deleteUninstaller
122SectionEnd