Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: pack: fix nsis bmp-file not found and add installer script #141

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src-tauri/nsis/installer.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
!macro NSIS_HOOK_POSTINSTALL
nsExec::ExecToLog 'powershell -Command "$p=[Environment]::GetEnvironmentVariable(\"PATH\",\"User\"); if($p -notlike \"*$INSTDIR*\") { setx PATH \"$p;$INSTDIR\" }"'
!macroend

!macro NSIS_HOOK_POSTUNINSTALL
nsExec::ExecToLog 'powershell -Command "$p=[Environment]::GetEnvironmentVariable(\"PATH\",\"User\"); setx PATH ($p -replace [regex]::Escape(\"$INSTDIR\"),\"\")"'
!macroend
3 changes: 2 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"displayLanguageSelector": true,
"languages": ["SimpChinese", "TradChinese", "English"],
"sidebarImage": "nsis/left.bmp",
"headerImage": "nsis/install.bmp"
"headerImage": "nsis/project-graph-install.bmp",
"installerHooks": "nsis/installer.nsh"
}
}
}
Expand Down