mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-18 12:40:06 +08:00
Add windows installer
This commit is contained in:
parent
d01ffbe2c5
commit
9f33fe54d9
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -153,6 +153,13 @@ jobs:
|
||||
ninja -j2
|
||||
cd ..
|
||||
./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
|
||||
shell: bash
|
||||
if: matrix.platform == 'ubuntu-22.04'
|
||||
@ -216,6 +223,7 @@ jobs:
|
||||
zip -9 -r $version_standalone-linux64.zip nekoray
|
||||
rm -rf nekoray
|
||||
####
|
||||
mv NekoraySetup.exe $version_standalone-windows64-installer.exe
|
||||
mv windows64 nekoray
|
||||
zip -9 -r $version_standalone-windows64.zip nekoray
|
||||
rm -rf nekoray
|
||||
|
||||
BIN
res/nekorayDel.ico
Normal file
BIN
res/nekorayDel.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
61
script/windows_installer.nsi
Normal file
61
script/windows_installer.nsi
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user