refractor: add missing MacOS depencies for tauri application
This commit is contained in:
6
desktop-client/src-tauri/bundled/macos-x64/README.txt
Normal file
6
desktop-client/src-tauri/bundled/macos-x64/README.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Bundle the macOS x64 NexaVPN tunnel helper here.
|
||||
|
||||
Expected filename:
|
||||
- nexavpn-tunnel-helper
|
||||
|
||||
This helper encapsulates the WireGuard runtime so the end user only interacts with NexaVPN.
|
||||
10
desktop-client/src-tauri/entitlements.plist
Normal file
10
desktop-client/src-tauri/entitlements.plist
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -996,8 +996,17 @@ pub fn run() {
|
||||
Ok(())
|
||||
})
|
||||
.on_window_event(|window, event| match event {
|
||||
WindowEvent::CloseRequested { .. } => {
|
||||
window.app_handle().exit(0);
|
||||
WindowEvent::CloseRequested { api, .. } => {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
hide_main_window(window);
|
||||
api.prevent_close();
|
||||
}
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
{
|
||||
let _ = api;
|
||||
window.app_handle().exit(0);
|
||||
}
|
||||
}
|
||||
WindowEvent::Resized(_) => {
|
||||
if window.is_minimized().unwrap_or(false) {
|
||||
|
||||
@@ -15,8 +15,10 @@ const CREATE_NO_WINDOW: u32 = 0x08000000;
|
||||
pub fn current_tunnel_strategy() -> &'static str {
|
||||
if cfg!(target_os = "windows") {
|
||||
"embedded-wireguard-windows-x64"
|
||||
} else if cfg!(target_os = "macos") {
|
||||
"embedded-wireguard-macos-arm"
|
||||
} else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
|
||||
"embedded-wireguard-macos-arm64"
|
||||
} else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
|
||||
"embedded-wireguard-macos-x64"
|
||||
} else {
|
||||
"unsupported"
|
||||
}
|
||||
@@ -108,10 +110,12 @@ fn bundled_backend(app: &AppHandle) -> Result<PathBuf, String> {
|
||||
|
||||
let relative = if cfg!(target_os = "windows") {
|
||||
PathBuf::from("bundled/windows-x64/nexavpn-tunnel-helper.exe")
|
||||
} else if cfg!(target_os = "macos") {
|
||||
} else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
|
||||
PathBuf::from("bundled/macos-arm64/nexavpn-tunnel-helper")
|
||||
} else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
|
||||
PathBuf::from("bundled/macos-x64/nexavpn-tunnel-helper")
|
||||
} else {
|
||||
return Err("This NexaVPN client build supports embedded tunnel backends only for Windows x64 and macOS ARM".into());
|
||||
return Err("This NexaVPN client build supports embedded tunnel backends only for Windows x64, macOS ARM64, and macOS x64".into());
|
||||
};
|
||||
|
||||
let path = resource_dir.join(relative);
|
||||
|
||||
15
desktop-client/src-tauri/tauri.macos.conf.json
Normal file
15
desktop-client/src-tauri/tauri.macos.conf.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"bundle": {
|
||||
"targets": ["dmg", "app"],
|
||||
"icon": [
|
||||
"icons/icon.png",
|
||||
"icons/icon.icns"
|
||||
],
|
||||
"category": "Utility",
|
||||
"macOS": {
|
||||
"entitlements": "entitlements.plist",
|
||||
"minimumSystemVersion": "11.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user