Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="WixUI_Advanced" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

<Feature Id="ProductFeature" Title="MsiPackage">
<ComponentGroupRef Id="ProductComponents" />
</Feature>

<ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
<Component>
<File Source="example.txt" />
</Component>
</ComponentGroup>
<File Source="example.txt" Directory="APPLICATIONFOLDER" />

<ui:WixUI Id="WixUI_Advanced" />
<Property Id="ApplicationFolderName" Value="MyProgram" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
</Package>

<Fragment>
<StandardDirectory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MsiPackage">
<Directory Id="APPLICATIONFOLDER" />
</Directory>
</StandardDirectory>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="APPLICATIONFOLDER" />
</DirectoryRef>
</Fragment>
</Wix>
3 changes: 3 additions & 0 deletions src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void CanBuildUsingWixUIAdvanced()
}, results.Where(r => r.StartsWith("Binary:")).ToArray());
WixAssert.CompareLineByLine(new[]
{
"CustomAction:WixSetDefaultPerMachine64Folder\t51\tWixPerMachineFolder\t[ProgramFiles64Folder][ApplicationFolderName]\t",
"CustomAction:WixSetDefaultPerMachineFolder\t51\tWixPerMachineFolder\t[ProgramFilesFolder][ApplicationFolderName]\t",
"CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
"CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
Expand Down Expand Up @@ -70,6 +71,7 @@ public void CanBuildUsingWixUIAdvancedX64()
}, results.Where(r => r.StartsWith("Binary:")).ToArray());
WixAssert.CompareLineByLine(new[]
{
"CustomAction:WixSetDefaultPerMachine64Folder\t51\tWixPerMachineFolder\t[ProgramFiles64Folder][ApplicationFolderName]\t",
"CustomAction:WixSetDefaultPerMachineFolder\t51\tWixPerMachineFolder\t[ProgramFilesFolder][ApplicationFolderName]\t",
"CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
"CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
Expand Down Expand Up @@ -98,6 +100,7 @@ public void CanBuildUsingWixUIAdvancedARM64()
}, results.Where(r => r.StartsWith("Binary:")).ToArray());
WixAssert.CompareLineByLine(new[]
{
"CustomAction:WixSetDefaultPerMachine64Folder\t51\tWixPerMachineFolder\t[ProgramFiles64Folder][ApplicationFolderName]\t",
"CustomAction:WixSetDefaultPerMachineFolder\t51\tWixPerMachineFolder\t[ProgramFilesFolder][ApplicationFolderName]\t",
"CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
"CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
Expand Down
13 changes: 9 additions & 4 deletions src/ext/UI/wixlib/WixUI_Advanced.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Todo:
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?foreach WIXUIARCH in X86;X64;A64 ?>
<Fragment>
<WixVariable Id="WixUIAdvancedArch" Value="$(WIXUIARCH)" />

<UI Id="WixUI_Advanced_$(WIXUIARCH)">
<Publish Dialog="BrowseDlg" Control="OK" Event="CheckTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" />

Expand Down Expand Up @@ -56,19 +58,22 @@ Todo:

<CustomAction Id="WixSetDefaultPerUserFolder" Property="WixPerUserFolder" Value="[LocalAppDataFolder]Apps\[ApplicationFolderName]" Execute="immediate" />
<CustomAction Id="WixSetDefaultPerMachineFolder" Property="WixPerMachineFolder" Value="[ProgramFilesFolder][ApplicationFolderName]" Execute="immediate" />
<CustomAction Id="WixSetDefaultPerMachine64Folder" Property="WixPerMachineFolder" Value="[ProgramFiles64Folder][ApplicationFolderName]" Execute="immediate" />
<CustomAction Id="WixSetPerUserFolder" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Execute="immediate" />
<CustomAction Id="WixSetPerMachineFolder" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Execute="immediate" />

<InstallExecuteSequence>
<Custom Action="WixSetDefaultPerUserFolder" Before="CostFinalize" />
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" />
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachineFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X86&quot;" />
<Custom Action="WixSetDefaultPerMachine64Folder" After="WixSetDefaultPerMachineFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X64&quot; OR &quot;!(wix.WixUIAdvancedArch)&quot;=&quot;A64&quot;" />
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachine64Folder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
<Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" />
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="WixSetDefaultPerUserFolder" Before="CostFinalize" />
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" />
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachineFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
<Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X86&quot;" />
<Custom Action="WixSetDefaultPerMachine64Folder" After="WixSetDefaultPerMachineFolder" Condition="&quot;!(wix.WixUIAdvancedArch)&quot;=&quot;X64&quot; OR &quot;!(wix.WixUIAdvancedArch)&quot;=&quot;A64&quot;" />
<Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachine64Folder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=&quot;&quot; OR (ALLUSERS=2 AND (NOT Privileged)))" />
<Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION=&quot;INSTALL&quot; AND APPLICATIONFOLDER=&quot;&quot; AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" />
</InstallUISequence>

Expand Down