Skip to content

Commit

Permalink
windows: pack: fix nsis bmp-file not found and add installer script
Browse files Browse the repository at this point in the history
- #140

1. modify install.bmp to project-graph-install.bmp in tauri.config.json
2. add nsis installer script for config env-path
3. add installerHooks to ref installer.nsh

Signed-off-by: Sunrisepeak <[email protected]>
  • Loading branch information
Sunrisepeak committed Nov 11, 2024
1 parent 1451e7c commit 27ee4d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 27ee4d6

Please sign in to comment.