Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

Fix packaging usage

Tw934ebf4b1cabb3
diff --git a/.github/workflows/single-app.yaml b/.github/workflows/single-app.yaml
index 2b35c7bf..b353b899 100644
--- a/.github/workflows/single-app.yaml
+++ b/.github/workflows/single-app.yaml
@@ -224,24 +224,33 @@ jobs:
New-Item -Path "output\windows" -ItemType Directory -Force
- # Check architecture-specific path first (x64 builds)
- $msiFiles = Get-ChildItem -Path "src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\*.msi" -ErrorAction SilentlyContinue
+ # The CLI copies the MSI to project root and removes it from bundle directory
+ # Check project root first, then fallback to bundle directories
+ $projectRootMsi = "${{ inputs.name }}.msi"
- # Fallback to generic path
- if (-not $msiFiles) {
- $msiFiles = Get-ChildItem -Path "src-tauri\target\release\bundle\msi\*.msi" -ErrorAction SilentlyContinue
- }
-
- if ($msiFiles) {
- Move-Item -Path $msiFiles[0].FullName -Destination "output\windows\${{inputs.title}}_x64.msi"
+ if (Test-Path $projectRootMsi) {
+ Move-Item -Path $projectRootMsi -Destination "output\windows\${{inputs.title}}_x64.msi"
} else {
- Write-Error "No MSI files found in expected locations"
- Write-Host "Searched paths:"
- Write-Host " - src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\"
- Write-Host " - src-tauri\target\release\bundle\msi\"
- Write-Host "`nAll MSI files in target directory:"
- Get-ChildItem -Path "src-tauri\target\" -Recurse -Name "*.msi" | Write-Host
- exit 1
+ # Check architecture-specific path (x64 builds)
+ $msiFiles = Get-ChildItem -Path "src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\*.msi" -ErrorAction SilentlyContinue
+
+ # Fallback to generic path
+ if (-not $msiFiles) {
+ $msiFiles = Get-ChildItem -Path "src-tauri\target\release\bundle\msi\*.msi" -ErrorAction SilentlyContinue
+ }
+
+ if ($msiFiles) {
+ Move-Item -Path $msiFiles[0].FullName -Destination "output\windows\${{inputs.title}}_x64.msi"
+ } else {
+ Write-Error "No MSI files found in expected locations"
+ Write-Host "Searched paths:"
+ Write-Host " - $projectRootMsi (project root)"
+ Write-Host " - src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\"
+ Write-Host " - src-tauri\target\release\bundle\msi\"
+ Write-Host "`nAll MSI files in target directory:"
+ Get-ChildItem -Path "src-tauri\target\" -Recurse -Name "*.msi" | Write-Host
+ exit 1
+ }
}
diff --git a/bin/helpers/merge.ts b/bin/helpers/merge.ts
index 832eb84f..97441b9d 100644
--- a/bin/helpers/merge.ts
+++ b/bin/helpers/merge.ts
@@ -331,6 +331,10 @@ Terminal=false
}
}
+ // Ensure trayIcon object exists before setting iconPath
+ if (!tauriConf.app.trayIcon) {
+ tauriConf.app.trayIcon = {};
+ }
tauriConf.app.trayIcon.iconPath = trayIconPath;
tauriConf.pake.system_tray_path = trayIconPath;
diff --git a/dist/cli.js b/dist/cli.js
index 796b6608..07f36edd 100644
--- a/dist/cli.js
+++ b/dist/cli.js
@@ -697,6 +697,10 @@ Terminal=false
logger.warn(`✼ Default system tray icon will remain unchanged.`);
}
}
+ // Ensure trayIcon object exists before setting iconPath
+ if (!tauriConf.app.trayIcon) {
+ tauriConf.app.trayIcon = {};
+ }
tauriConf.app.trayIcon.iconPath = trayIconPath;
tauriConf.pake.system_tray_path = trayIconPath;
delete tauriConf.app.trayIcon;
diff --git a/package.json b/package.json
index db71c306..8b1410b6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "pake-cli",
- "version": "3.7.1",
+ "version": "3.7.2",
"description": "🤱🏻 Turn any webpage into a desktop app with one command. 🤱🏻 一键打包网页生成轻量桌面应用。",
"engines": {
"node": ">=18.0.0"
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 7d37a5bc..934f01ec 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -2539,7 +2539,7 @@ dependencies = [
[[package]]
name = "pake"
-version = "3.7.1"
+version = "3.7.2"
dependencies = [
"serde",
"serde_json",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 6de7cc9d..b0c31c64 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pake"
-version = "3.7.1"
+version = "3.7.2"
description = "🤱🏻 Turn any webpage into a desktop app with Rust."
authors = ["Tw93"]
license = "MIT"
diff --git a/src-tauri/src/app/menu.rs b/src-tauri/src/app/menu.rs
index 67655e43..125d40fc 100644
--- a/src-tauri/src/app/menu.rs
+++ b/src-tauri/src/app/menu.rs
@@ -1,3 +1,6 @@
+// Menu functionality is only used on macOS
+#![cfg(target_os = "macos")]
+
use tauri::menu::{AboutMetadata, Menu, MenuItem, PredefinedMenuItem, Submenu};
use tauri::{AppHandle, Manager, Wry};
use tauri_plugin_opener::OpenerExt;
diff --git a/src-tauri/src/app/mod.rs b/src-tauri/src/app/mod.rs
index 61796cb6..6e63f5a4 100644
--- a/src-tauri/src/app/mod.rs
+++ b/src-tauri/src/app/mod.rs
@@ -1,5 +1,6 @@
pub mod config;
pub mod invoke;
+#[cfg(target_os = "macos")]
pub mod menu;
pub mod setup;
pub mod window;