cad-editor/packaging/windows/main.wxs
Claude 556989dbdb
feat(installer): add finish screen with launch-app checkbox to Windows MSI
Adds WixUI_Minimal UI to the WiX installer so users see a proper
Welcome → Progress → Finish wizard. The finish screen includes a
pre-ticked "Launch Open CAD Studio" checkbox; clicking Finish with
it checked starts the application immediately after the installer closes.

Also updates the light.exe invocation in release.yml to include
-ext WixUIExtension, which is required to link the WixUI dialogs.

https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
2026-06-12 07:24:36 +00:00

156 lines
5.5 KiB
XML

<?xml version='1.0' encoding='windows-1252'?>
<!--
WiX source for the Windows MSI installer.
Build (CI / locally with WiX Toolset 3.x in PATH):
candle.exe -arch x64 -dVersion=<x.y.z> -dSource=target\release\OpenCADStudio.exe \
-dIcon=packaging\windows\AppIcon.ico packaging\windows\main.wxs \
-out packaging\windows\main.wixobj
light.exe packaging\windows\main.wixobj -ext WixUIExtension -out OpenCADStudio.msi
Provides:
* Per-machine install under Program Files\Open CAD Studio.
* Start Menu shortcut under Programs\Open CAD Studio.
* File associations for .dwg and .dxf via a single ProgID; both
route through `OpenCADStudio.exe "%1"` so the OS hands the file
path to the app as argv[1] (consumed in OpenCADStudio::boot).
* Standard Add/Remove Programs entry with icon.
* MajorUpgrade — installing a newer MSI replaces the old version.
-->
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Id='*'
Name='Open CAD Studio'
UpgradeCode='bd6bceab-6c7a-4ce2-a62d-6ef06a92f8b1'
Manufacturer='Hakan Seven'
Language='1033'
Codepage='1252'
Version='$(var.Version)'>
<Package
Id='*'
Keywords='Installer'
Description='Open CAD Studio Installer'
Manufacturer='Hakan Seven'
InstallerVersion='450'
Languages='1033'
Compressed='yes'
InstallScope='perMachine'
SummaryCodepage='1252' />
<MajorUpgrade
Schedule='afterInstallInitialize'
DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.' />
<Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
<Icon Id='AppIcon.ico' SourceFile='$(var.Icon)' />
<Property Id='ARPPRODUCTICON' Value='AppIcon.ico' />
<Property Id='ARPHELPLINK' Value='https://github.com/HakanSeven12/OpenCADStudio' />
<Property Id='ARPURLINFOABOUT' Value='https://github.com/HakanSeven12/OpenCADStudio' />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFiles64Folder'>
<Directory Id='APPLICATIONROOTDIRECTORY' Name='Open CAD Studio'>
<Component Id='MainExecutable' Guid='2900c116-e9a5-4650-8a4c-48c0987d1a33' Win64='yes'>
<File
Id='OpenCADStudioEXE'
Name='OpenCADStudio.exe'
DiskId='1'
Source='$(var.Source)'
KeyPath='yes'>
<Shortcut
Id='StartMenuShortcut'
Directory='ProgramMenuDir'
Name='Open CAD Studio'
Description='Launch Open CAD Studio'
WorkingDirectory='APPLICATIONROOTDIRECTORY'
Icon='AppIcon.ico'
IconIndex='0'
Advertise='yes' />
</File>
<!--
File associations. Two ProgIDs (one per extension) so the
`<Verb Id='open'>` rows don't collide on the same registry
primary key — both ProgIDs invoke the same exe with the
file path as `argv[1]`.
-->
<ProgId
Id='OpenCADStudio.DWG'
Description='DWG Drawing'
Icon='OpenCADStudioEXE'
IconIndex='0'>
<Extension Id='dwg' ContentType='image/vnd.dwg'>
<Verb Id='open' Command='Open' TargetFile='OpenCADStudioEXE' Argument='"%1"' />
</Extension>
</ProgId>
<ProgId
Id='OpenCADStudio.DXF'
Description='DXF Drawing'
Icon='OpenCADStudioEXE'
IconIndex='0'>
<Extension Id='dxf' ContentType='image/vnd.dxf'>
<Verb Id='open' Command='Open' TargetFile='OpenCADStudioEXE' Argument='"%1"' />
</Extension>
</ProgId>
</Component>
</Directory>
</Directory>
<Directory Id='ProgramMenuFolder'>
<Directory Id='ProgramMenuDir' Name='Open CAD Studio'>
<Component Id='ProgramMenuDirComp' Guid='34a788ba-f9d4-4e73-b1ff-9eb8749b369e'>
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue
Root='HKCU'
Key='Software\Open CAD Studio'
Name='installed'
Type='integer'
Value='1'
KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='Complete' Title='Open CAD Studio' Level='1'>
<ComponentRef Id='MainExecutable' />
<ComponentRef Id='ProgramMenuDirComp' />
</Feature>
<!--
Finish-screen "Launch Open CAD Studio" checkbox.
WIXUI_EXITDIALOGOPTIONALCHECKBOX=1 pre-ticks the checkbox; the Publish
below fires the launch action when the user clicks Finish with it checked.
WixUI_Minimal shows a minimal wizard (Welcome → Progress → Finish).
-->
<Property Id='WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT' Value='Launch Open CAD Studio' />
<Property Id='WIXUI_EXITDIALOGOPTIONALCHECKBOX' Value='1' />
<!--
Start the installed exe after the wizard closes.
asyncNoWait lets the installer exit cleanly while the app starts.
-->
<CustomAction
Id='LaunchApplication'
FileKey='OpenCADStudioEXE'
ExeCommand=''
Execute='immediate'
Return='asyncNoWait'
Impersonate='yes' />
<UI>
<UIRef Id='WixUI_Minimal' />
<Publish
Dialog='ExitDialog'
Control='Finish'
Event='DoAction'
Value='LaunchApplication'>WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 AND NOT Installed</Publish>
</UI>
</Product>
</Wix>