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
929 changes: 899 additions & 30 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ pest_meta = "=2.7.15"
serde_with = "=3.11.0"
serde_with_macros = "=3.11.0"
globset = "=0.4.15"
screenshots = "0.8"
png = "0.17"
rusqlite = { version = "0.31", features = ["bundled"] }
proc-macro-crate = "=3.1.0"
home = "=0.5.9"
avif-serialize = "=0.8.2"
Expand Down
5 changes: 5 additions & 0 deletions apps/omninova-tauri/src-tauri/src/cli_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use tauri::AppHandle;
use tauri::Manager;

const MARKER_LINE: &str = "# OmniNova CLI (PATH)";
#[cfg(windows)]
const CREATE_NO_WINDOW: u32 = 0x0800_0000;

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -94,6 +96,8 @@ fn same_executable_as_bundle(src: &Path, dst: &Path) -> bool {

#[cfg(windows)]
fn windows_add_user_path(dir: &Path) -> Result<(), String> {
use std::os::windows::process::CommandExt;

let d = dir.to_string_lossy().replace('\'', "''");
let ps = format!(
"$d = [System.IO.Path]::GetFullPath('{d}'); \
Expand All @@ -105,6 +109,7 @@ fn windows_add_user_path(dir: &Path) -> Result<(), String> {
d = d
);
let output = StdCommand::new("powershell")
.creation_flags(CREATE_NO_WINDOW)
.args(["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", &ps])
.output()
.map_err(|e| format!("无法执行 PowerShell:{e}"))?;
Expand Down
Loading
Loading