Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core):
restart
cannot handle binary name change on macOS
Tauri v2 changed the default binary name of the bundled apps (no longer follows the productName, just uses the default name from Cargo instead). This breaks the `restart` function, which expects the current binary path to match the new one. Due to this change, the restart() function for macOS is broken - the .app is correctly replaced even if the productName changed, but the restart() function cannot handle the new binary path. This change adds a simple check on macOS to read the `Contents/MacOS` folder and if it only contains a single binary, we use it to restart instead. This inference cannot be used if there's sidecars, so in this case we just let the existing implementation run and if it fails to restart, we do not panic but only warn and exit instead. AppImage updates are not affected by this, and the Windows installer is responsible for restarting, so this change is only applied to macOS binaries.
- Loading branch information