1+ Name " Nekoray"
2+ OutFile " NekoraySetup.exe"
3+ InstallDir " $PROGRAMFILES\Nekoray"
4+ RequestExecutionLevel admin
5+
6+ !include MUI2.nsh
7+ !define MUI_ICON " res\nekoray.ico"
8+ !define MUI_ABORTWARNING
9+ !define MUI_WELCOMEPAGE_TITLE " Welcome to Nekoray Installer"
10+ !define MUI_WELCOMEPAGE_TEXT " This wizard will guide you through the installation of Nekoray."
11+ !define MUI_FINISHPAGE_RUN " $INSTDIR\nekoray.exe"
12+ !define MUI_FINISHPAGE_RUN_TEXT " Launch Nekoray"
13+
14+ !insertmacro MUI_PAGE_WELCOME
15+ !insertmacro MUI_PAGE_DIRECTORY
16+ !insertmacro MUI_PAGE_INSTFILES
17+ !insertmacro MUI_PAGE_FINISH
18+
19+ !insertmacro MUI_LANGUAGE " English"
20+
21+ UninstallText " This will uninstall Nekoray. Do you wish to continue?"
22+ UninstallIcon " res\nekorayDel.ico"
23+
24+ Section " Install"
25+ SetOutPath " $INSTDIR"
26+
27+ File /r " .\deployment\windows64\*"
28+
29+ CreateShortcut " $desktop\Nekoray.lnk" " $instdir\nekoray.exe"
30+
31+ CreateDirectory " $SMPROGRAMS\Nekoray"
32+ CreateShortcut " $SMPROGRAMS\Nekoray\Nekoray.lnk" " $INSTDIR\nekoray.exe" " " " $INSTDIR\nekoray.exe" 0
33+ CreateShortcut " $SMPROGRAMS\Nekoray\Uninstall Nekoray.lnk" " $INSTDIR\uninstall.exe"
34+
35+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" " DisplayName" " Nekoray"
36+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" " UninstallString" " $INSTDIR\uninstall.exe"
37+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" " InstallLocation" " $INSTDIR"
38+ WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" " NoModify" 1
39+ WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" " NoRepair" 1
40+ WriteUninstaller " uninstall.exe"
41+ SectionEnd
42+
43+ Section " Uninstall"
44+
45+ !define stopCommand ' powershell -ExecutionPolicy Bypass -NoExit -command "&{Stop-Process -Id (Get-CimInstance -ClassName Win32_Process -Filter $\' Name = $\'$\' nekoray.exe$\'$\'$\' | Where-Object { `$_`.ExecutablePath -eq $\' $INSTDIR\nekoray.exe$\' }).ProcessId -Force}"'
46+ ExecWait ' ${stopCommand}'
47+
48+ Delete " $SMPROGRAMS\Nekoray\Nekoray.lnk"
49+ Delete " $SMPROGRAMS\Nekoray\Uninstall Nekoray.lnk"
50+ Delete " $desktop\Nekoray.lnk"
51+ RMDir " $SMPROGRAMS\Nekoray"
52+
53+ RMDir /r " $INSTDIR"
54+
55+ Delete " $INSTDIR\uninstall.exe"
56+
57+ DeleteRegKey HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray"
58+ SectionEnd
0 commit comments