From c92d2ae5f105bf426ea8679a1e0f7b761070eed7 Mon Sep 17 00:00:00 2001 From: Mulia Nasution Date: Wed, 17 Apr 2024 19:53:27 +0700 Subject: [PATCH] feat: init windows installer --- .github/workflows/release.yaml | 7 ++++++- scripts/windows.nsi | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 scripts/windows.nsi diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 43bc3c15..b67b40b9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - feat/* tags: - v* @@ -13,7 +14,7 @@ jobs: continue-on-error: true strategy: matrix: - goos: [linux, darwin] + goos: [linux, darwin, windows] goarch: [amd64, arm64] steps: - uses: actions/checkout@v4 @@ -33,6 +34,10 @@ jobs: cd build if [[ $GOOS == 'darwin' ]]; then cp raiden raiden-macos-"$GOARCH" + elif [[ $GOOS == 'windows' ]]; then + mv raiden raiden.exe + sudo apt-get install -y nsis + makensis -NOCD ${GITHUB_WORKSPACE}/scripts/windows.nsi else cp raiden raiden-"$GOOS"-"$GOARCH" fi diff --git a/scripts/windows.nsi b/scripts/windows.nsi new file mode 100644 index 00000000..f63f44c6 --- /dev/null +++ b/scripts/windows.nsi @@ -0,0 +1,29 @@ +!include "MUI2.nsh" + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_LANGUAGE "English" + +!define NAME "Raiden" +!define APPFILE "raiden.exe" + +Name "${NAME}" +Outfile "raiden-setup.exe" +InstallDir $WINDIR +ShowInstDetails show +RequestExecutionLevel admin + +Section + SetOutPath $INSTDIR + File raiden.exe + WriteUninstaller $INSTDIR\raiden-uninstall.exe +SectionEnd + +Section "Uninstall" + Delete $INSTDIR\raiden.exe + Delete $INSTDIR\raiden-uninstall.exe + RMDir $INSTDIR +SectionEnd +