Add windows installer

This commit is contained in:
Nova 2025-07-07 02:40:38 +03:30
parent d01ffbe2c5
commit 9f33fe54d9
3 changed files with 69 additions and 0 deletions

View File

@ -153,6 +153,13 @@ jobs:
ninja -j2 ninja -j2
cd .. cd ..
./script/deploy_windows64.sh ./script/deploy_windows64.sh
- name: Build Installer with NSIS
shell: cmd
if: matrix.platform == 'windows-latest'
run: |
cp .\script\windows_installer.nsi .
makensis windows_installer.nsi
cp NekoraySetup.exe deployment/
- name: Linux - Generate MakeFile and Build - name: Linux - Generate MakeFile and Build
shell: bash shell: bash
if: matrix.platform == 'ubuntu-22.04' if: matrix.platform == 'ubuntu-22.04'
@ -216,6 +223,7 @@ jobs:
zip -9 -r $version_standalone-linux64.zip nekoray zip -9 -r $version_standalone-linux64.zip nekoray
rm -rf nekoray rm -rf nekoray
#### ####
mv NekoraySetup.exe $version_standalone-windows64-installer.exe
mv windows64 nekoray mv windows64 nekoray
zip -9 -r $version_standalone-windows64.zip nekoray zip -9 -r $version_standalone-windows64.zip nekoray
rm -rf nekoray rm -rf nekoray

BIN
res/nekorayDel.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,61 @@
Name "Nekoray"
OutFile "NekoraySetup.exe"
InstallDir "$PROGRAMFILES\Nekoray"
RequestExecutionLevel admin
!include MUI2.nsh
!define MUI_ICON "res\nekoray.ico"
!define MUI_ABORTWARNING
!define MUI_WELCOMEPAGE_TITLE "Welcome to Nekoray Installer"
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Nekoray."
!define MUI_FINISHPAGE_RUN "$INSTDIR\nekoray.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Launch Nekoray"
!define stopCommand 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -command "&{Stop-Process -Id (Get-CimInstance -ClassName Win32_Process -Filter $\'Name = $\'$\'nekoray.exe$\'$\'$\' | Where-Object { $$_.ExecutablePath -eq $\'$INSTDIR\nekoray.exe$\' }).ProcessId -Force}"'
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
UninstallText "This will uninstall Nekoray. Do you wish to continue?"
UninstallIcon "res\nekorayDel.ico"
Section "Install"
SetOutPath "$INSTDIR"
ExecWait '${stopCommand}'
File /r ".\deployment\windows64\*"
CreateShortcut "$desktop\Nekoray.lnk" "$instdir\nekoray.exe"
CreateDirectory "$SMPROGRAMS\Nekoray"
CreateShortcut "$SMPROGRAMS\Nekoray\Nekoray.lnk" "$INSTDIR\nekoray.exe" "" "$INSTDIR\nekoray.exe" 0
CreateShortcut "$SMPROGRAMS\Nekoray\Uninstall Nekoray.lnk" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" "DisplayName" "Nekoray"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" "InstallLocation" "$INSTDIR"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
Section "Uninstall"
ExecWait '${stopCommand}'
Delete "$SMPROGRAMS\Nekoray\Nekoray.lnk"
Delete "$SMPROGRAMS\Nekoray\Uninstall Nekoray.lnk"
Delete "$desktop\Nekoray.lnk"
RMDir "$SMPROGRAMS\Nekoray"
RMDir /r "$INSTDIR"
Delete "$INSTDIR\uninstall.exe"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Nekoray"
SectionEnd