mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-10 12:20:12 -06:00
Build wordcraft.wxs a second time as a dual-purpose package (Scope=perUserOrMachine: ALLUSERS=2, MSIINSTALLPERUSER=1), shipped as wordcraft-<ver>-windows-user-<arch>.msi. Registry keys move from HKLM to HKMU so the same components land in HKLM per-machine and HKCU per-user. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
184 lines
14 KiB
XML
184 lines
14 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!--
|
||
WordCraft MSI (WiX Toolset v5: `dotnet tool install -g wix`, plus its UI and Util extensions:
|
||
`wix extension add -g WixToolset.UI.wixext/5.0.2` and the same for WixToolset.Util.wixext).
|
||
Built by package.ps1:
|
||
|
||
wix build wordcraft.wxs -arch x64 -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext
|
||
-d Version=1.2.3 -d BinDir=... -d IconPath=... -d LicenseRtf=... [-d Scope=perUserOrMachine] -o out.msi
|
||
|
||
Per-machine install into Program Files with a Start Menu shortcut. The installer shows the
|
||
standard WiX dialogs: welcome + license, progress, and a finish page.
|
||
|
||
Built a second time with -d Scope=perUserOrMachine for people without administrator rights
|
||
(#39): a dual-purpose package that WiX gives ALLUSERS=2 and MSIINSTALLPERUSER=1, so it installs
|
||
for the current user with no UAC prompt. Windows then redirects Program Files to
|
||
%LOCALAPPDATA%\Programs, the Start Menu to the user's own, and HKMU to HKCU, so the same
|
||
components work in both packages. Both share the UpgradeCode: each upgrades its own earlier
|
||
versions (Windows Installer only matches products installed in the same context).
|
||
|
||
UpgradeCode and the component GUIDs below belong to WordCraft alone. Never copy them from (or
|
||
into) a sibling Craft app: Windows Installer treats every package sharing an UpgradeCode as one
|
||
product, so a shared code makes one app's installer refuse to install ("a newer version is
|
||
already installed") or silently uninstall the other. packaging-lint.yml checks this.
|
||
-->
|
||
<?ifndef Scope?>
|
||
<?define Scope = perMachine?>
|
||
<?endif?>
|
||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
|
||
<?ifndef HasCraftFontLicences ?>
|
||
<?define HasCraftFontLicences=0 ?>
|
||
<?endif ?>
|
||
<Package
|
||
Name="WordCraft"
|
||
Manufacturer="Learning Machines LLC"
|
||
Version="$(var.Version)"
|
||
UpgradeCode="075497F9-E861-45D0-9C7F-A74F8C34E6BA"
|
||
Scope="$(var.Scope)"
|
||
Compressed="yes"
|
||
Language="1033">
|
||
<SummaryInformation Description="WordCraft word processor" Manufacturer="Learning Machines LLC" />
|
||
<!-- Same-version upgrades let successive pre-releases of one X.Y.Z replace each other
|
||
(MSI versions are numeric, so 1.2.3-rc.1 and 1.2.3-rc.2 are both 1.2.3). -->
|
||
<MajorUpgrade AllowSameVersionUpgrades="yes"
|
||
DowngradeErrorMessage="A newer version of WordCraft is already installed." />
|
||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||
|
||
<Icon Id="WordcraftIcon.ico" SourceFile="$(var.IconPath)" />
|
||
<Property Id="ARPPRODUCTICON" Value="WordcraftIcon.ico" />
|
||
<Property Id="ARPURLINFOABOUT" Value="https://getartcraft.com/apps/wordcraft" />
|
||
<Property Id="ARPURLUPDATEINFO" Value="https://getartcraft.com/apps/wordcraft" />
|
||
<Property Id="ARPHELPLINK" Value="https://discord.gg/artcraft" />
|
||
|
||
<!-- Installer UI (#198): WixUI_Minimal is welcome + license, progress, then a finish page so
|
||
people can see the install worked. Its dialogs and bitmaps are WiX's own
|
||
(WixToolset.UI.wixext); package.ps1 builds the license RTF from LICENSE-MIT and
|
||
LICENSE-APACHE. The finish page offers to launch WordCraft (ticked by default) through
|
||
WixShellExec (WixToolset.Util.wixext); silent installs (/qn) never show it. -->
|
||
<WixVariable Id="WixUILicenseRtf" Value="$(var.LicenseRtf)" />
|
||
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch WordCraft" />
|
||
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
|
||
<Property Id="WixShellExecTarget" Value="[#WordcraftExe]" />
|
||
<CustomAction Id="LaunchWordcraft" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixShellExec"
|
||
Impersonate="yes" Return="ignore" />
|
||
<UI>
|
||
<ui:WixUI Id="WixUI_Minimal" />
|
||
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchWordcraft"
|
||
Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 AND NOT Installed" />
|
||
</UI>
|
||
|
||
<StandardDirectory Id="ProgramFiles6432Folder">
|
||
<Directory Id="INSTALLFOLDER" Name="WordCraft" />
|
||
</StandardDirectory>
|
||
<StandardDirectory Id="ProgramMenuFolder" />
|
||
|
||
<Feature Id="Main" Title="WordCraft" Level="1">
|
||
<ComponentGroupRef Id="AppNotices" />
|
||
<?if $(var.HasCraftFontLicences) = 1 ?>
|
||
<ComponentGroupRef Id="CraftFontLicences" />
|
||
<?endif ?>
|
||
<ComponentGroupRef Id="WordcraftFiles" />
|
||
</Feature>
|
||
</Package>
|
||
|
||
<Fragment>
|
||
<ComponentGroup Id="AppNotices" Directory="INSTALLFOLDER">
|
||
<Files Include="$(var.AppNoticesDir)\**" />
|
||
</ComponentGroup>
|
||
<?if $(var.HasCraftFontLicences) = 1 ?>
|
||
<ComponentGroup Id="CraftFontLicences" Directory="INSTALLFOLDER">
|
||
<Files Include="$(var.DocsDir)\**" />
|
||
</ComponentGroup>
|
||
<?endif ?>
|
||
<ComponentGroup Id="WordcraftFiles" Directory="INSTALLFOLDER">
|
||
<Component Id="WordcraftApp" Guid="855DCEC6-9285-444F-9382-9654B83B34F6">
|
||
<File Id="WordcraftExe" Source="$(var.BinDir)\wordcraft.exe" KeyPath="yes">
|
||
<Shortcut Id="StartMenuShortcut" Directory="ProgramMenuFolder" Name="WordCraft"
|
||
Description="WordCraft word processor" WorkingDirectory="INSTALLFOLDER" Advertise="yes"
|
||
Icon="WordcraftIcon.ico" IconIndex="0" />
|
||
</File>
|
||
|
||
<RegistryValue Root="HKMU" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\wordcraft.exe" Value="[#WordcraftExe]" Type="string" />
|
||
</Component>
|
||
|
||
<!-- File associations (#295). Each document type gets a WordCraft ProgId (name, icon, open
|
||
command) and is listed under the extension's OpenWithProgids, so WordCraft shows in
|
||
Explorer's "Open with". The Word, RTF and ODT types are also WordCraft's Capabilities
|
||
(RegisteredApplications), so it appears in Settings › Default apps, where the user
|
||
makes it the default (File › Options › General opens that page). Nothing here sets an
|
||
extension's default: the installer never takes over .docx from another app. Markdown and
|
||
plain text are only "Open with" candidates. Removed again on uninstall. -->
|
||
<Component Id="WordcraftFileTypes" Guid="EFF89E6A-F9B8-49F9-B3AE-E243347484B4">
|
||
<RegistryValue Root="HKMU" Key="Software\RegisteredApplications" Name="WordCraft" Value="Software\WordCraft\Capabilities" Type="string" KeyPath="yes" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities" Name="ApplicationName" Value="WordCraft" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities" Name="ApplicationDescription" Value="Write and design documents; open and save Word files." Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities" Name="ApplicationIcon" Value=""[#WordcraftExe]",0" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe" Name="FriendlyAppName" Value="WordCraft" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.Document" Description="Word Document" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.Document\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.docx\OpenWithProgids" Name="WordCraft.Document" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".docx" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".docx" Value="WordCraft.Document" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.DocumentMacroEnabled" Description="Word Macro-Enabled Document" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.DocumentMacroEnabled\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.docm\OpenWithProgids" Name="WordCraft.DocumentMacroEnabled" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".docm" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".docm" Value="WordCraft.DocumentMacroEnabled" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.Template" Description="Word Template" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.Template\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.dotx\OpenWithProgids" Name="WordCraft.Template" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".dotx" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".dotx" Value="WordCraft.Template" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.TemplateMacroEnabled" Description="Word Macro-Enabled Template" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.TemplateMacroEnabled\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.dotm\OpenWithProgids" Name="WordCraft.TemplateMacroEnabled" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".dotm" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".dotm" Value="WordCraft.TemplateMacroEnabled" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.LegacyDocument" Description="Legacy Word Document" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.LegacyDocument\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.doc\OpenWithProgids" Name="WordCraft.LegacyDocument" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".doc" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".doc" Value="WordCraft.LegacyDocument" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.LegacyTemplate" Description="Legacy Word Template" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.LegacyTemplate\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.dot\OpenWithProgids" Name="WordCraft.LegacyTemplate" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".dot" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".dot" Value="WordCraft.LegacyTemplate" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.RichText" Description="Rich Text Document" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.RichText\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.rtf\OpenWithProgids" Name="WordCraft.RichText" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".rtf" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".rtf" Value="WordCraft.RichText" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.OpenDocumentText" Description="OpenDocument Text" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.OpenDocumentText\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.odt\OpenWithProgids" Name="WordCraft.OpenDocumentText" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".odt" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\WordCraft\Capabilities\FileAssociations" Name=".odt" Value="WordCraft.OpenDocumentText" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.Markdown" Description="Markdown Document" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.Markdown\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.md\OpenWithProgids" Name="WordCraft.Markdown" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".md" Value="" Type="string" />
|
||
|
||
<ProgId Id="WordCraft.PlainText" Description="Text Document" Icon="WordcraftExe" IconIndex="0" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\WordCraft.PlainText\shell\open\command" Value=""[#WordcraftExe]" "%1"" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\.txt\OpenWithProgids" Name="WordCraft.PlainText" Value="" Type="string" />
|
||
<RegistryValue Root="HKMU" Key="Software\Classes\Applications\wordcraft.exe\SupportedTypes" Name=".txt" Value="" Type="string" />
|
||
</Component>
|
||
|
||
<Component Id="WordcraftCli">
|
||
<File Id="WordcraftCliExe" Source="$(var.BinDir)\wordcraft-cli.exe" KeyPath="yes" />
|
||
</Component>
|
||
</ComponentGroup>
|
||
</Fragment>
|
||
</Wix>
|