diff --git a/crates/strand-tauri/tauri.conf.json b/crates/strand-tauri/tauri.conf.json index d2f45e2..29178d1 100644 --- a/crates/strand-tauri/tauri.conf.json +++ b/crates/strand-tauri/tauri.conf.json @@ -57,7 +57,12 @@ ], "category": "DeveloperTool", "shortDescription": "Fast, friendly Git client", - "longDescription": "Strand is a desktop Git client for macOS, Windows, and Linux." + "longDescription": "Strand is a desktop Git client for macOS, Windows, and Linux.", + "windows": { + "wix": { + "template": "wix/main.wxs" + } + } }, "plugins": { "updater": { diff --git a/crates/strand-tauri/wix/main.wxs b/crates/strand-tauri/wix/main.wxs new file mode 100644 index 0000000..59257ad --- /dev/null +++ b/crates/strand-tauri/wix/main.wxs @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{#if allow_downgrades}} + + {{else}} + + {{/if}} + + + Installed AND NOT UPGRADINGPRODUCTCODE + + + + + {{#if banner_path}} + + {{/if}} + {{#if dialog_image_path}} + + {{/if}} + {{#if license}} + + {{/if}} + + + + + + + {{#if homepage}} + + + + {{/if}} + + + + + + + + + + + + + + + + + + WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed + + + + {{#unless license}} + + 1 + 1 + {{/unless}} + + + + + + + + + + + + + + + + + + + + + + + + + + + {{#each deep_link_protocols as |protocol| ~}} + + + + + + + + + + + {{/each~}} + + + + {{#each file_associations as |association| ~}} + {{#each association.ext as |ext| ~}} + + + + + + {{/each~}} + {{/each~}} + + {{#each binaries as |bin| ~}} + + + + {{/each~}} + {{#if enable_elevated_update_task}} + + + + + + + + + + {{/if}} + {{resources}} + + + + + + + + + + + + + + + + + + + + + + {{#each merge_modules as |msm| ~}} + + + + + + + + {{/each~}} + + + + + + {{#each resource_file_ids as |resource_file_id| ~}} + + {{/each~}} + + {{#if enable_elevated_update_task}} + + + + {{/if}} + + + + + + + + + + + {{#each binaries as |bin| ~}} + + {{/each~}} + + + + + {{#each component_group_refs as |id| ~}} + + {{/each~}} + {{#each component_refs as |id| ~}} + + {{/each~}} + {{#each feature_group_refs as |id| ~}} + + {{/each~}} + {{#each feature_refs as |id| ~}} + + {{/each~}} + {{#each merge_refs as |id| ~}} + + {{/each~}} + + + {{#if install_webview}} + + + + + + + + {{#if download_bootstrapper}} + + + + + + + + {{/if}} + + {{#if webview2_bootstrapper_path}} + + + + + + + + + {{/if}} + + {{#if webview2_installer_path}} + + + + + + + + + {{/if}} + + {{#if minimum_webview2_version}} + + + + + + + + + + + + + + + + {{/if}} + + {{/if}} + + {{#if enable_elevated_update_task}} + + + + + NOT(REMOVE) + + + + + + + (REMOVE = "ALL") AND NOT UPGRADINGPRODUCTCODE + + + {{/if}} + + + AUTOLAUNCHAPP AND NOT Installed + + + + + diff --git a/scripts/check-release-security.mjs b/scripts/check-release-security.mjs index afd0042..fd98d66 100644 --- a/scripts/check-release-security.mjs +++ b/scripts/check-release-security.mjs @@ -6,6 +6,7 @@ const capability = JSON.parse( ); const releaseWorkflow = readFileSync('.github/workflows/release.yml', 'utf8'); const tauriMain = readFileSync('crates/strand-tauri/src/main.rs', 'utf8'); +const wixTemplate = readFileSync('crates/strand-tauri/wix/main.wxs', 'utf8'); function fail(message) { throw new Error(`release security check failed: ${message}`); @@ -93,6 +94,35 @@ for (const fragment of [ } } +if (config.bundle?.windows?.wix?.template !== 'wix/main.wxs') { + fail('Windows MSI custom template is missing'); +} +const startMenuShortcutStart = wixTemplate.indexOf( + '', startMenuShortcutStart); +if (startMenuShortcutStart < 0 || startMenuShortcutEnd < 0) { + fail('Windows MSI Start Menu shortcut is missing'); +} +const startMenuShortcut = wixTemplate.slice( + startMenuShortcutStart, + startMenuShortcutEnd, +); +if (startMenuShortcut.includes('Icon="ProductIcon"')) { + fail('Windows MSI Start Menu shortcut uses the upgrade-specific ProductIcon cache'); +} +if ( + !wixTemplate.includes(''), +) { + fail('Windows MSI Add/Remove Programs icon is missing'); +} +if (!startMenuShortcut.includes('System.AppUserModel.ID')) { + fail('Windows MSI Start Menu shortcut AppUserModelID is missing'); +} +if (!wixTemplate.includes('