B2: setup finish without hang, Open with for PHP files, 0.1.0-alpha
- Finish page starts Lutra through Explorer (Exec, returns at once) instead of RunAsUser/ShellExecute on the setup's UI thread. The 0.0.0 setup hung there while the new, unsigned exe was checked (Norton 360 active); Windows ended it and left lutra-desktop.exe suspended. The NSIS template is an adapted copy of tauri-bundler 2.10.2's. - installer/hooks.nsh registers Lutra only under OpenWithProgids and Applications\lutra-desktop.exe for .php/.phtml/.phpt/.inc; the default app stays. The uninstaller removes exactly those entries. macOS gets an Alternate-rank CFBundleDocumentTypes entry and handles RunEvent::Opened. - A file path argument opens the file inside its Git/Composer root (or folder); a running instance takes it over, switching projects only when the file lies outside (never over unsaved changes). - Version 0.1.0-alpha in the workspace, tauri.conf.json and ui; a test keeps tauri.conf.json in step with the crate version. - xtask bundle passes CARGO_TARGET_DIR to the Tauri CLI as an absolute path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
84ff80a89f
commit
b17d26b400
17 changed files with 1430 additions and 58 deletions
|
|
@ -54,10 +54,18 @@ pub fn bundle() -> TaskResult {
|
|||
args.push("--config".into());
|
||||
args.push(dmg_background_override(&tiff));
|
||||
}
|
||||
let args: Vec<&str> = args.iter().map(String::as_str).collect();
|
||||
run(&root.join("apps").join("lutra-desktop"), &cargo, &args).map_err(|e| {
|
||||
format!("{e}\n(install the Tauri CLI with `cargo install tauri-cli --locked`)")
|
||||
})?;
|
||||
let status = std::process::Command::new(&cargo)
|
||||
.args(&args)
|
||||
.current_dir(root.join("apps").join("lutra-desktop"))
|
||||
.env("CARGO_TARGET_DIR", &target_dir)
|
||||
.status()
|
||||
.map_err(|e| format!("cannot start `{cargo}`: {e}"))?;
|
||||
if !status.success() {
|
||||
return Err(format!(
|
||||
"`{cargo} {}` failed ({status})\n(install the Tauri CLI with `cargo install tauri-cli --locked`)",
|
||||
args.join(" ")
|
||||
));
|
||||
}
|
||||
let out = target_dir.join("release").join("bundle").join(folder);
|
||||
let listing = std::fs::read_dir(&out)
|
||||
.map_err(|e| format!("no installer folder {}: {e}", out.display()))?;
|
||||
|
|
@ -74,7 +82,9 @@ pub fn bundle() -> TaskResult {
|
|||
}
|
||||
|
||||
/// The Cargo target directory: `CARGO_TARGET_DIR` (relative to the
|
||||
/// repository root) or `<root>/target`.
|
||||
/// repository root) or `<root>/target`. [`bundle`] hands it to the Tauri
|
||||
/// CLI as an absolute path: Cargo would read a relative one against
|
||||
/// `apps/lutra-desktop`, where the CLI runs.
|
||||
fn target_dir(root: &Path) -> PathBuf {
|
||||
match std::env::var_os("CARGO_TARGET_DIR").filter(|v| !v.is_empty()) {
|
||||
Some(dir) => root.join(dir),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue