1+ ; --------------------------------
2+ ; Include Modern UI
3+
4+ !include " MUI2.nsh"
5+
6+ !define lbm " LittleBigMouse"
7+ !define lbm_version " 5.0.0"
8+ !define lbm_file " LittleBigMouse.Ui.Avalonia.exe"
9+
10+
11+ !define main " ..\LittleBigMouse.Ui\LittleBigMouse.Ui.Avalonia"
12+ !define daemon " ..\LittleBigMouse.Daemon"
13+ !define main_out_dir " ${main}\bin\x64\Release\net8.0"
14+ !define daemon_out_dir " ${daemon}\bin\x64\Release"
15+
16+ ; --------------------------------
17+ ; General
18+
19+ ; Name and file
20+ Name " Little Big Mouse"
21+ OutFile " ${lbm}-${lbm_version}.exe"
22+ Unicode True
23+
24+ ; Default installation folder
25+ InstallDir " $PROGRAMFILES64\${lbm}"
26+
27+ ; Get installation folder from registry if available
28+ InstallDirRegKey HKCU " Software\Mgth\${lbm}" " "
29+
30+ ; Request application privileges for Windows Vista
31+ RequestExecutionLevel admin
32+
33+ ; ---------------------------------
34+ ; General
35+
36+ !define MUI_ICON " ${main}\MainIcon.ico"
37+ !define MUI_UNICON " ${main}\MainIcon.ico"
38+ ; !define MUI_SPECIALBITMAP "Bitmap.bmp"
39+
40+ ; --------------------------------
41+ ; Interface Settings
42+
43+ !define MUI_ABORTWARNING
44+
45+ ; --------------------------------
46+ ; Pages
47+
48+ ; !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
49+ ; !insertmacro MUI_PAGE_COMPONENTS
50+ !insertmacro MUI_PAGE_DIRECTORY
51+ !insertmacro MUI_PAGE_INSTFILES
52+
53+ !define MUI_FINISHPAGE_RUN " $INSTDIR\${lbm_file}"
54+ !insertmacro MUI_PAGE_FINISH
55+
56+ !insertmacro MUI_UNPAGE_CONFIRM
57+ !insertmacro MUI_UNPAGE_INSTFILES
58+
59+
60+ ; --------------------------------
61+ ; Language
62+
63+ !insertmacro MUI_LANGUAGE " English"
64+
65+
66+ ; --------------------------------
67+ ; Installer Sections
68+ Section " install"
69+
70+ ; Add files
71+ SetOutPath " $INSTDIR"
72+
73+ File " ${main_out_dir}\*.exe"
74+ File " ${daemon_out_dir}\*.exe"
75+ File /r " ${main_out_dir}\*.dll"
76+ File " ${main_out_dir}\*.json"
77+
78+ ; create desktop shortcut
79+ CreateShortCut " $DESKTOP\${lbm}.lnk" " $INSTDIR\${lbm_file}" " "
80+
81+ ; create start-menu items
82+ CreateDirectory " $SMPROGRAMS\${lbm}"
83+ CreateShortCut " $SMPROGRAMS\${lbm}\Uninstall.lnk" " $INSTDIR\Uninstall.exe" " " " $INSTDIR\Uninstall.exe" 0
84+ CreateShortCut " $SMPROGRAMS\${lbm}\${lbm}.lnk" " $INSTDIR\${lbm_file}" " " " $INSTDIR\${lbm_file}" 0
85+
86+ ; write uninstall information to the registry
87+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${lbm}" " DisplayName" " ${lbm} (remove only)"
88+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${lbm}" " UninstallString" " $INSTDIR\Uninstall.exe"
89+
90+ WriteUninstaller " $INSTDIR\Uninstall.exe"
91+
92+ SectionEnd
93+
94+
95+ ; --------------------------------
96+ ; Uninstaller Section
97+ Section " Uninstall"
98+
99+ ; Delete Files
100+ RMDir /r " $INSTDIR\*.*"
101+
102+ ; Remove the installation directory
103+ RMDir " $INSTDIR"
104+
105+ ; Delete Start Menu Shortcuts
106+ Delete " $DESKTOP\${lbm}.lnk"
107+ Delete " $SMPROGRAMS\${lbm}\*.*"
108+ RmDir " $SMPROGRAMS\${lbm}"
109+
110+ ; Delete Uninstaller And Unistall Registry Entries
111+ ; DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${lbm}"
112+ DeleteRegKey HKEY_LOCAL_MACHINE " SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${lbm}"
113+
114+ SectionEnd
115+
116+
117+
118+
119+ ; eof
0 commit comments