diff --git a/src-tauri/nsis/installer-hooks.nsi b/src-tauri/nsis/installer-hooks.nsi new file mode 100644 index 0000000..43ae715 --- /dev/null +++ b/src-tauri/nsis/installer-hooks.nsi @@ -0,0 +1,11 @@ +; RelWave NSIS Installer Hooks +; Kill bridge.exe before install/update to prevent "Error opening file for writing" errors + +!macro NSIS_HOOK_PREINSTALL + ; Kill any running bridge.exe process before installing + nsExec::ExecToLog 'taskkill /F /IM "bridge.exe"' + ; Also kill the main app if it's still running + nsExec::ExecToLog 'taskkill /F /IM "RelWave.exe"' + ; Small delay to ensure file handles are released + Sleep 1000 +!macroend diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 4e9ee03..25b03cc 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -30,6 +30,18 @@ fn main() { navigate_back, navigate_forward ]) - .run(tauri::generate_context!()) - .expect("error while running tauri application"); + .build(tauri::generate_context!()) + .expect("error while building tauri application") + .run(|app_handle, event| { + if let tauri::RunEvent::Exit = event { + // Kill bridge process on app exit to prevent orphaned processes + if let Some(state) = app_handle.try_state::() { + let mut guard = state.0.lock().unwrap(); + if let Some(mut child) = guard.take() { + let _ = child.kill(); + let _ = child.wait(); + } + } + } + }); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 724ea76..8d45d0e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -42,7 +42,12 @@ "externalBin": [ "resources/bridge" ], - "createUpdaterArtifacts": true + "createUpdaterArtifacts": true, + "windows": { + "nsis": { + "installerHooks": "nsis/installer-hooks.nsi" + } + } }, "plugins": { "updater": { diff --git a/src/components/common/DeveloperContextMenu.tsx b/src/components/common/DeveloperContextMenu.tsx index 5d50de8..89f41b5 100644 --- a/src/components/common/DeveloperContextMenu.tsx +++ b/src/components/common/DeveloperContextMenu.tsx @@ -145,22 +145,6 @@ export function DeveloperContextMenu({ children }: DeveloperContextMenuProps) { Ctrl+R - - - Cut - Ctrl+X - - - - Copy - Ctrl+C - - - - Paste - Ctrl+V - - Inspect Element