Skip to content
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
11 changes: 11 additions & 0 deletions src-tauri/nsis/installer-hooks.nsi
Original file line number Diff line number Diff line change
@@ -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
16 changes: 14 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<BridgeProcess>() {
let mut guard = state.0.lock().unwrap();
if let Some(mut child) = guard.take() {
let _ = child.kill();
let _ = child.wait();
}
}
}
});
}
7 changes: 6 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
"externalBin": [
"resources/bridge"
],
"createUpdaterArtifacts": true
"createUpdaterArtifacts": true,
"windows": {
"nsis": {
"installerHooks": "nsis/installer-hooks.nsi"
}
}
},
"plugins": {
"updater": {
Expand Down
16 changes: 0 additions & 16 deletions src/components/common/DeveloperContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,6 @@ export function DeveloperContextMenu({ children }: DeveloperContextMenuProps) {
<ContextMenuShortcut>Ctrl+R</ContextMenuShortcut>
</ContextMenuItem>
<ContextMenuSeparator />
<ContextMenuItem onClick={handleCut} className="gap-2">
<Scissors className="h-4 w-4" />
Cut
<ContextMenuShortcut>Ctrl+X</ContextMenuShortcut>
</ContextMenuItem>
<ContextMenuItem onClick={handleCopy} className="gap-2">
<Copy className="h-4 w-4" />
Copy
<ContextMenuShortcut>Ctrl+C</ContextMenuShortcut>
</ContextMenuItem>
<ContextMenuItem onClick={handlePaste} className="gap-2">
<ClipboardPaste className="h-4 w-4" />
Paste
<ContextMenuShortcut>Ctrl+V</ContextMenuShortcut>
</ContextMenuItem>
<ContextMenuSeparator />
<ContextMenuItem onClick={handleInspect} className="gap-2">
<Bug className="h-4 w-4" />
Inspect Element
Expand Down