← Commit history

1.0.35: 1.0.35: three fixes from a from-scratch install on a clean Windows VM (KiCad 10.0.6, no GPU). kicad_upgrade's first-run seeding now MERGES into the kicad_common.json that kicad-cli writes during the install's own verify step (it used to skip an existing file, so the startup wizard showed on every blank box and the IPC API stayed off); a file whose first-run prompts are answered is still left alone, backup kept. kicad_taskbar_repair also looks under ProgramData, where an all-users install puts its Start Menu shortcuts (it reported all three missing). The 3D verbs answer canvasRendered:false with a _renderHint when KiCad has reported Could not use OpenGL, instead of ok over a black viewer (wiki #100), and point at kicad_enable_software_opengl. kicad_readiness no longer says window verbs are served by the Python bridge.

John Lauer ·2a70935ccf ·1mo ago ·parent dfc69bc
1 file changed +12−3
rust/crates/kicad-platform/src/win/shortcuts.rs+12−3
@@ -48,15 +48,24 @@ pub struct ShortcutRepair { /// running process actually presents (read from the taskbar buttons' AutomationIds). /// `version` is major.minor ("10.0"): KiCad names both the folder and the shortcuts by it. pub fn shortcuts_for(version: &str) -> Vec<(PathBuf, String)> {-    let Some(appdata) = std::env::var_os("APPDATA") else { return Vec::new() };-    let root = Path::new(&appdata).join("Microsoft").join("Windows").join("Start Menu").join("Programs").join(format!("KiCad {version}"));+    // A per-user install puts its Start Menu folder under %APPDATA%; an all-users install (what+    // kicad_upgrade does when the bridge runs elevated) puts it under %ProgramData%. Looking only+    // at the first reported all three shortcuts missing on a fresh all-users box (winvm, 10.0.6).+    let folder = |base: std::ffi::OsString| Path::new(&base).join("Microsoft").join("Windows").join("Start Menu").join("Programs").join(format!("KiCad {version}"));+    let roots: Vec<PathBuf> = ["APPDATA", "ProgramData"].iter().filter_map(|v| std::env::var_os(v)).map(folder).collect();+    if roots.is_empty() {+        return Vec::new();+    }     [         (format!("PCB Editor {version} (standalone).lnk"), format!("Kicad.Kicad.pcbnew.{version}")),         (format!("Schematic Editor {version} (standalone).lnk"), format!("Kicad.Kicad.eeschema.{version}")),         (format!("Gerber Viewer {version}.lnk"), format!("Kicad.Kicad.gerbview.{version}")),     ]     .into_iter()-    .map(|(name, aumid)| (root.join(name), aumid))+    .map(|(name, aumid)| {+        let found = roots.iter().map(|r| r.join(&name)).find(|p| p.is_file());+        (found.unwrap_or_else(|| roots[0].join(&name)), aumid)+    })     .collect() }