From b9af77b3e161798c82dfdf76d9bc03b554ea926b Mon Sep 17 00:00:00 2001 From: Yash Date: Tue, 17 Feb 2026 17:01:27 +0530 Subject: [PATCH 1/2] fix: enhance application exit handling and add NSIS installer hooks --- src-tauri/nsis/installer-hooks.nsi | 11 +++++++++++ src-tauri/src/main.rs | 16 ++++++++++++++-- src-tauri/tauri.conf.json | 7 ++++++- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 src-tauri/nsis/installer-hooks.nsi 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": { From 9389d7978a5956280ed0cb9eb2d45614f5518df8 Mon Sep 17 00:00:00 2001 From: Yash Date: Tue, 17 Feb 2026 17:13:44 +0530 Subject: [PATCH 2/2] fix: remove cut, copy, and paste options from developer context menu --- src/components/common/DeveloperContextMenu.tsx | 16 ---------------- 1 file changed, 16 deletions(-) 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