From ed2a200636f90d7da8c902217c50a456568a4776 Mon Sep 17 00:00:00 2001 From: dzp Date: Sat, 2 Dec 2023 12:11:47 +0800 Subject: [PATCH] chore: add NSIS installer --- .github/workflows/windows-publish.yml | 6 ++++++ windows/install.nsi | 30 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 windows/install.nsi diff --git a/.github/workflows/windows-publish.yml b/.github/workflows/windows-publish.yml index 87e4b063..59f367af 100644 --- a/.github/workflows/windows-publish.yml +++ b/.github/workflows/windows-publish.yml @@ -77,6 +77,12 @@ jobs: rm -rf tintin rm -rf pcre-8.45 + - name: Create installer + uses: joncloud/makensis-action@v4 + with: + script-file: windows/install.nsi + arguments: "/V3" + - name: Create artifact -- WinTin++ uses: actions/upload-artifact@v3 with: diff --git a/windows/install.nsi b/windows/install.nsi new file mode 100644 index 00000000..816be67d --- /dev/null +++ b/windows/install.nsi @@ -0,0 +1,30 @@ +Name "PaoTin++ for Windows" +OutFile PaoTin++.exe +ShowInstDetails show +AllowRootDirInstall true + +!include "FileFunc.nsh" + +Page custom selectDriver +Page instfiles + +Var Dialog +Var Drive + +Function selectDriver + nsDialogs::Create 1018 + Pop $Dialog + + ${NSD_CreateDropList} 0 0 100% 20u "选择你要安装到哪个盘" + ${GetDrives} "HDD" "Example1" + + nsDialogs::Show + + CreateDirectory "%LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\PaoTin++" + CreateDirectory "%LOCALAPPDATA%\Microsoft\Windows Terminal Preview\Fragments\PaoTin++" +FunctionEnd + +Function Example1 + MessageBox MB_OK "$9 ($8 Drive)" + Push $0 +FunctionEnd