Skip to content

Commit d4adc03

Browse files
committed
Support 64-bit install directory in WixUI_Advanced
Fixes wixtoolset/issues#2165
1 parent d2ef95f commit d4adc03

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed
Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
22
<Package Name="WixUI_Advanced" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
3-
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
4-
5-
<Feature Id="ProductFeature" Title="MsiPackage">
6-
<ComponentGroupRef Id="ProductComponents" />
7-
</Feature>
8-
9-
<ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
10-
<Component>
11-
<File Source="example.txt" />
12-
</Component>
13-
</ComponentGroup>
3+
<File Source="example.txt" Directory="APPLICATIONFOLDER" />
144

155
<ui:WixUI Id="WixUI_Advanced" />
166
<Property Id="ApplicationFolderName" Value="MyProgram" />
177
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
188
</Package>
199

2010
<Fragment>
21-
<StandardDirectory Id="ProgramFilesFolder">
22-
<Directory Id="INSTALLFOLDER" Name="MsiPackage">
23-
<Directory Id="APPLICATIONFOLDER" />
24-
</Directory>
25-
</StandardDirectory>
11+
<DirectoryRef Id="INSTALLFOLDER">
12+
<Directory Id="APPLICATIONFOLDER" />
13+
</DirectoryRef>
2614
</Fragment>
2715
</Wix>

src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public void CanBuildUsingWixUIAdvanced()
3737
}, results.Where(r => r.StartsWith("Binary:")).ToArray());
3838
WixAssert.CompareLineByLine(new[]
3939
{
40+
"CustomAction:WixSetDefaultPerMachine64Folder\t51\tWixPerMachineFolder\t[ProgramFiles64Folder][ApplicationFolderName]\t",
4041
"CustomAction:WixSetDefaultPerMachineFolder\t51\tWixPerMachineFolder\t[ProgramFilesFolder][ApplicationFolderName]\t",
4142
"CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
4243
"CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
@@ -70,6 +71,7 @@ public void CanBuildUsingWixUIAdvancedX64()
7071
}, results.Where(r => r.StartsWith("Binary:")).ToArray());
7172
WixAssert.CompareLineByLine(new[]
7273
{
74+
"CustomAction:WixSetDefaultPerMachine64Folder\t51\tWixPerMachineFolder\t[ProgramFiles64Folder][ApplicationFolderName]\t",
7375
"CustomAction:WixSetDefaultPerMachineFolder\t51\tWixPerMachineFolder\t[ProgramFilesFolder][ApplicationFolderName]\t",
7476
"CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
7577
"CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
@@ -98,6 +100,7 @@ public void CanBuildUsingWixUIAdvancedARM64()
98100
}, results.Where(r => r.StartsWith("Binary:")).ToArray());
99101
WixAssert.CompareLineByLine(new[]
100102
{
103+
"CustomAction:WixSetDefaultPerMachine64Folder\t51\tWixPerMachineFolder\t[ProgramFiles64Folder][ApplicationFolderName]\t",
101104
"CustomAction:WixSetDefaultPerMachineFolder\t51\tWixPerMachineFolder\t[ProgramFilesFolder][ApplicationFolderName]\t",
102105
"CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
103106
"CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",

src/ext/UI/wixlib/WixUI_Advanced.wxs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Todo:
2222
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2323
<?foreach WIXUIARCH in X86;X64;A64 ?>
2424
<Fragment>
25+
<WixVariable Id="WixUIAdvancedArch" Value="$(WIXUIARCH)" />
26+
2527
<UI Id="WixUI_Advanced_$(WIXUIARCH)">
2628
<Publish Dialog="BrowseDlg" Control="OK" Event="CheckTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" />
2729

@@ -56,19 +58,22 @@ Todo:
5658

5759
<CustomAction Id="WixSetDefaultPerUserFolder" Property="WixPerUserFolder" Value="[LocalAppDataFolder]Apps\[ApplicationFolderName]" Execute="immediate" />
5860
<CustomAction Id="WixSetDefaultPerMachineFolder" Property="WixPerMachineFolder" Value="[ProgramFilesFolder][ApplicationFolderName]" Execute="immediate" />
61+
<CustomAction Id="WixSetDefaultPerMachine64Folder" Property="WixPerMachineFolder" Value="[ProgramFiles64Folder][ApplicationFolderName]" Execute="immediate" />
5962
<CustomAction Id="WixSetPerUserFolder" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Execute="immediate" />
6063
<CustomAction Id="WixSetPerMachineFolder" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Execute="immediate" />
6164

6265
<InstallExecuteSequence>
6366
<Custom Action="WixSetDefaultPerUserFolder" Before="CostFinalize" />
64-
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" />
65-
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachineFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
67+
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X86&quot;" />
68+
<Custom Action="WixSetDefaultPerMachine64Folder" After="WixSetDefaultPerMachineFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X64&quot; OR &quot;!(wix.WixUIAdvancedArch)&quot;=&quot;A64&quot;" />
69+
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachine64Folder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
6670
<Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" />
6771
</InstallExecuteSequence>
6872
<InstallUISequence>
6973
<Custom Action="WixSetDefaultPerUserFolder" Before="CostFinalize" />
70-
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" />
71-
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachineFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
74+
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X86&quot;" />
75+
<Custom Action="WixSetDefaultPerMachine64Folder" After="WixSetDefaultPerMachineFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X64&quot; OR &quot;!(wix.WixUIAdvancedArch)&quot;=&quot;A64&quot;" />
76+
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachine64Folder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
7277
<Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" />
7378
</InstallUISequence>
7479

0 commit comments

Comments
 (0)