Skip to content

Commit a8f25ce

Browse files
authored
fix(installer): Fix Windows MSI installer for WiX v6
2 parents 2781a7f + 903ccc1 commit a8f25ce

3 files changed

Lines changed: 84 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ jobs:
2222
uses: actions/checkout@v6
2323
- name: Get the version
2424
id: get_version
25-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
25+
run: |
26+
# Extract version from tag, strip 'v' prefix and everything after first dash
27+
VERSION=${GITHUB_REF/refs\/tags\/v/}
28+
VERSION=${VERSION%%-*}
29+
echo ::set-output name=VERSION::$VERSION
2630
shell: bash
2731
- name: Setup MSBuild.exe
2832
uses: microsoft/setup-msbuild@v2.0.0
@@ -84,7 +88,7 @@ jobs:
8488
run: Compress-Archive -Path ./installer/* -DestinationPath ./CCExtractor_win_portable.zip
8589
working-directory: ./windows
8690
- name: Build installer
87-
run: wix build -ext WixToolset.UI.wixext -d "AppVersion=${{ steps.get_version.outputs.VERSION }}.0.0" -o CCExtractor.msi installer.wxs
91+
run: wix build -ext WixToolset.UI.wixext -d "AppVersion=${{ steps.get_version.outputs.VERSION }}.0.0" -o CCExtractor.msi installer.wxs CustomUI.wxs
8892
working-directory: ./windows
8993
- name: Upload as asset
9094
uses: AButler/upload-release-assets@v3.0

windows/CustomUI.wxs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!-- Custom WixUI_InstallDir without License Dialog -->
2+
<!-- Based on WiX 6 WixUI_InstallDir.wxs -->
3+
4+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5+
<?foreach WIXUIARCH in X86;X64;A64 ?>
6+
<Fragment>
7+
<UI Id="CustomInstallDirUI_$(WIXUIARCH)">
8+
<!-- Platform-specific actions for path validation (no license print action) -->
9+
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" />
10+
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" />
11+
</UI>
12+
13+
<UIRef Id="CustomInstallDirUI" />
14+
</Fragment>
15+
<?endforeach?>
16+
17+
<Fragment>
18+
<UI Id="CustomInstallDirUI">
19+
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
20+
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
21+
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
22+
23+
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
24+
25+
<DialogRef Id="BrowseDlg" />
26+
<DialogRef Id="DiskCostDlg" />
27+
<DialogRef Id="ErrorDlg" />
28+
<DialogRef Id="FatalError" />
29+
<DialogRef Id="FilesInUse" />
30+
<DialogRef Id="MsiRMFilesInUse" />
31+
<DialogRef Id="PrepareDlg" />
32+
<DialogRef Id="ProgressDlg" />
33+
<DialogRef Id="ResumeDlg" />
34+
<DialogRef Id="UserExit" />
35+
36+
<!-- BrowseDlg validation -->
37+
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID&lt;&gt;&quot;1&quot;" />
38+
39+
<!-- ExitDialog -->
40+
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999" />
41+
42+
<!-- WelcomeDlg: Next goes directly to InstallDirDlg (NO LICENSE) -->
43+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Condition="NOT Installed" />
44+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Condition="Installed AND PATCH" />
45+
46+
<!-- InstallDirDlg: Back goes to WelcomeDlg (NO LICENSE) -->
47+
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" />
48+
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" />
49+
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID&lt;&gt;&quot;1&quot;" />
50+
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4" Condition="WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID=&quot;1&quot;" />
51+
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" />
52+
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2" />
53+
54+
<!-- VerifyReadyDlg -->
55+
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1" Condition="NOT Installed" />
56+
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2" Condition="Installed AND NOT PATCH" />
57+
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" Condition="Installed AND PATCH" />
58+
59+
<!-- Maintenance dialogs -->
60+
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg" />
61+
62+
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg" />
63+
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" />
64+
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" />
65+
66+
<Property Id="ARPNOMODIFY" Value="1" />
67+
</UI>
68+
69+
<UIRef Id="WixUI_Common" />
70+
</Fragment>
71+
</Wix>

windows/installer.wxs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2-
<Package Name="CCExtractor" Language="1033" Version="$(AppVersion)" Manufacturer="CCExtractor development" UpgradeCode="e70dbe37-bb04-4c39-bedc-966a6b073bcf" InstallerVersion="200">
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2+
<Package Name="CCExtractor" Language="1033" Version="$(AppVersion)" Manufacturer="CCExtractor development" UpgradeCode="e70dbe37-bb04-4c39-bedc-966a6b073bcf" InstallerVersion="500" Scope="perMachine">
33
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
44
<MediaTemplate EmbedCab="yes"/>
55
<Feature Id="CCX" Title="CCExtractor Setup" Level="1">
@@ -12,15 +12,11 @@
1212
<ComponentRef Id="ApplicationShortcutDesktop"/>
1313
</Feature>
1414
<Icon Id="ccxgui.exe" SourceFile="./installer/ccxgui.exe"/>
15-
<!-- Use standard WixUI_InstallDir dialog set -->
16-
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" />
17-
<!-- Override dialog sequence to skip license dialog -->
18-
<UI>
19-
<!-- WelcomeDlg Next -> InstallDirDlg (skip LicenseAgreementDlg) -->
20-
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Condition="NOT Installed" />
21-
<!-- InstallDirDlg Back -> WelcomeDlg (skip LicenseAgreementDlg) -->
22-
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" />
23-
</UI>
15+
<!-- Use custom UI without license dialog -->
16+
<UIRef Id="CustomInstallDirUI" />
17+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
18+
<!-- Skip path validation (avoids "must be on local hard drive" errors) -->
19+
<Property Id="WIXUI_DONTVALIDATEPATH" Value="1" />
2420
</Package>
2521
<Fragment>
2622
<StandardDirectory Id="DesktopFolder">

0 commit comments

Comments
 (0)