collective

Browse / github.com/storytold/vectorcraft / patch

Register Windows file associations

Bug: Cannot automatically open files in vectorcraft with non-default install location Seems to be only Vectorcraft doing this. I can't set vectorcraft as default, or even double click a .ai/.vectorcraft file and do open with and manually point to the vectorcraft exe. Both fail in windows 11. Reinstalling vectorcraft to default location fixed it.

Status
open
Score
0.00
Adopters
0 other operators
Author
AJMakesStuff (imported from pull request #3495, open)
Base
79dca4c8f958e0625342bfa4e85fc11588c3d4cd
Size
+25 −0 in 2 files
Review
pending
Shared
2026-10-28
Id
d91c473d96ba0d59161cb2d3

How it went

No other operator has reported using it yet.

Diff

raw · packaging/windows/vectorcraft.wxs xtask/src/bundle.rs

diff --git a/packaging/windows/vectorcraft.wxs b/packaging/windows/vectorcraft.wxs--- a/packaging/windows/vectorcraft.wxs+++ b/packaging/windows/vectorcraft.wxs@@ -118,6 +118,11 @@           <Shortcut Id="StartMenuShortcut" Directory="ProgramMenuFolder" Name="VectorCraft"               Description="VectorCraft vector illustration app" WorkingDirectory="INSTALLFOLDER" Advertise="yes"               Icon="VectorcraftIcon.ico" IconIndex="0" />+          <ProgId Id="VectorCraft.vectorcraft" Description="VectorCraft document">+            <Extension Id="vectorcraft" ContentType="application/x-vectorcraft">+              <Verb Id="open" Command="Open" TargetFile="[#VectorcraftExe]" Argument="&quot;%1&quot;" />+            </Extension>+          </ProgId>         </File>          <RegistryValue Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\vectorcraft.exe" Value="[#VectorcraftExe]" Type="string" />diff --git a/xtask/src/bundle.rs b/xtask/src/bundle.rs--- a/xtask/src/bundle.rs+++ b/xtask/src/bundle.rs@@ -72,6 +72,26 @@ mod tests {         assert!(read("packaging/linux/ai.storyteller.vectorcraft.metainfo.xml.in").contains("<category>VectorGraphics</category>"));     } +    #[test]+    fn packaging_file_associations_reference_installed_executable() {+        let wxs = std::fs::read_to_string(crate::root().join("packaging/windows/vectorcraft.wxs")).unwrap();+        for (extension, prog_id) in [("vectorcraft", "VectorCraft.vectorcraft")] {+            let prog_id_start = wxs.find(&format!(r#"<ProgId Id="{prog_id}""#)).unwrap();+            let prog_id_end = wxs[prog_id_start..].find("</ProgId>").unwrap() + prog_id_start;+            let prog_id = &wxs[prog_id_start..prog_id_end];++            let extension_start = prog_id.find(&format!(r#"<Extension Id="{extension}""#)).unwrap();+            let extension_end = prog_id[extension_start..].find("</Extension>").unwrap() + extension_start;+            let extension = &prog_id[extension_start..extension_end];++            assert!(+                extension.contains(r#"<Verb Id="open" Command="Open" TargetFile="[#VectorcraftExe]" Argument="&quot;%1&quot;" />"#),+                ".{extension} does not open with the installed executable",+            );+        }+        assert!(wxs.contains(r#"Directory="INSTALLFOLDER""#), "associations are not installed with the app");+    }+     #[test]     fn dev_bundle_plist_is_the_release_one() {         let p = info_plist("1.2.3-rc.1", "abc123");