0
votes

I'm trying to get the "installation scope" screen working in WiX, using the WixUI_Advanced UI, and although I am not receiving any errors, it is simply not working.

Here is the Fire Giant (WiX dev) tutorial page that goes through, step-by-step, the process to get the installation screen working, and I'm following it. I'm also following a textbook that says the same stuff.

I'm using WiX 3.10, which very well may be the problem -- perhaps the tutorial is out of date? The textbook I'm using is for WiX 3.6.

The steps are as follows:

1: Make sure that you have a reference to WixUIExtension in your project. If I could show a screenshot of my Solution Explorer, you'd see that the reference is there. With that said, the textbook that I'm following says to use the reference, whereas the language in the Fire Giant tutorial says:

The dialog set is defined in the file WixUI_Advanced.wxs in the WixUIExtension in the WiX source code.

I think that means "add the reference", but...

2: Add a reference in the markup to WixUI_Advanced (the Fire Giant tutorial doesn't mention this at all -- they either overlooked this necessary step or didn't include it):

<UIRef Id="WixUI_Advanced"/>

3: Make sure that you have a directory with the name APPLICATIONFOLDER:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder">
       <Directory Id="APPLICATIONFOLDER" Name="MyFolder"/>
    </Directory>
</Directory>

4: Add a specific property whose Id is ApplicationFolderName. The value will set the name of the installation directory as it will appear in the UI. 5: Add another property whose Id is WixAppFolder with a value of either WixPerMachinePerFolder or ...PerUser. This will give the user the option to choose which one:

    <Property Id="ApplicationFolderName" Value="MyProgram"/>
    <Property Id="WixAppFolder" Value="WixPerMachineFolder"/>

And that's it! The program runs with no error message and no warnings, but it doesn't do anything except install the thing that I'm installing (a text file). The Log files do not show an error.

I know that the UI is actually happening because I can change the license rtf file.

The logs also show that some specific actions are being skipped. Here is an entry from the log files:

Action start 13:46:38: WixSetDefaultPerMachineFolder.

MSI (c) (04:A4) [13:46:38:195]: PROPERTY CHANGE: Adding WixPerMachineFolder property. Its value is 'C:\Program Files******* Return value 1.

MSI (c) (04:A4) [13:46:38:195]: Skipping action: WixSetPerUserFolder (condition is false)

MSI (c) (04:A4) [13:46:38:195]: Doing action: WixSetPerMachineFolder

MSI (c) (04:A4) [13:46:38:195]: Note: 1: 2205 2: 3: ActionText

Action 13:44:54: WixSetDefaultPerUserFolder.

Action start 13:44:54: WixSetDefaultPerUserFolder.

MSI (s) (88:C4) [13:44:54:159]: PROPERTY CHANGE: Adding WixPerUserFolder property. Its value is 'C:\Users***...'.

Action ended 13:44:54: WixSetDefaultPerUserFolder. Return value 1.

MSI (s) (88:C4) [13:44:54:159]: Doing action: WixSetDefaultPerMachineFolder

MSI (s) (88:C4) [13:44:54:159]: Note: 1: 2205 2: 3: ActionText

Action 13:44:54: WixSetDefaultPerMachineFolder.

Action start 13:44:54: WixSetDefaultPerMachineFolder.

MSI (s) (88:C4) [13:44:54:159]: PROPERTY CHANGE: Adding WixPerMachineFolder property. Its value is 'C:\Program Files\MyProgram'.

Action ended 13:44:54: WixSetDefaultPerMachineFolder. Return value 1.

MSI (s) (88:C4) [13:44:54:159]: Skipping action: WixSetPerUserFolder (condition is false)

MSI (s) (88:C4) [13:44:54:159]: Skipping action: WixSetPerMachineFolder (condition is false)

MSI (s) (88:C4) [13:44:54:159]: Doing action: CostFinalize

MSI (s) (88:C4) [13:44:54:159]: Note: 1: 2205 2: 3: ActionText

Here is the code in its entirety:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
         Name="WixUIAdvanced"
         Language="1033"
         Version="1.0.0.0"
         Manufacturer="Microsoft"
         UpgradeCode="f3410225-cde1-4067-a6e6-2e016d7cf38b">
    <Package InstallerVersion="200"
             Compressed="yes"
             InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes"/>

    <UIRef Id="WixUI_Advanced"/>
    <WixVariable Id="WixUILicenseRtf" Value="src\license.rtf"/>
    <Property Id="ApplicationFolderName" Value="MyProgram"/>
    <Property Id="WixAppFolder" Value="WixPerMachineFolder"/>


    <Feature Id="ProductFeature"
             Title="WixUIAdvanced"
             Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="APPLICATIONFOLDER"
                       Name="MyFolder"/>
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
        <Component Id="ProductComponent">
      <File Source="TextFile1.txt"/>
        </Component>
    </ComponentGroup>
</Fragment>

I'm using WiX 3.10, Visual Studio 2015.

1

1 Answers

1
votes

This is, how Advanced UI works. You must click advanced, instead of Install, to set other settings.

Advanced settings

If you want to change order, or type, of displayed dialogs, you can use different UI, here is list of premade ones, or you can create own by just copying of existing UI file to your solution, and editing it.