Wix custom dialog error 2856 - wix

I've a wix installation with a custom dialog added into the installation: ProgramDataInstallDlg
This is what my UI-tag look like for the whole project:
<UI Id="my_UI">
<UIRef Id="WixUI_FeatureTree" />
<DialogRef Id="ProgramDataInstallDlg" />
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ProgramDataInstallDlg">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ProgramDataInstallDlg">1</Publish>
</UI>
Everything works fine if only next is pressed. But if back button is pressed in VerifyReadyDlg or next button in CustomizeDlg is pressed. I get error 2856.
This is what the installation log says:
DEBUG: Error 2856: Creating a second copy of the dialog ProgramDataInstallDlg
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2856. The arguments are: ProgramDataInstallDlg, ,
MSI (c) (E0:6C) [14:06:34:526]: Product: MOPS 4.0 -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2856. The arguments are: ProgramDataInstallDlg, ,
Whats wrong?
EDIT ProgramDataInstallDlg:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="ProgramDataInstallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<!--Banner UI-components-->
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Custom Setup" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="text" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<!--Content Components-->
<Control Id="NameLabel" Type="Text" X="45" Y="73" Width="220" Height="15" TabSkip="no" Text="text" />
<!--Bottom UI-components-->
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Back" Type="PushButton" X="173" Y="243" Width="56" Height="17" Text="Back">
<Publish Event="SpawnDialog" Value="CustomizeDlg">1</Publish>
</Control>
<Control Id="Next" Type="PushButton" X="230" Y="243" Width="56" Height="17" Default="yes" Text="Next">
<Publish Event="SpawnDialog" Value="VerifyReadyDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>

If you are customizing the UI I suggest to create a custom WixUI_FeatureTree.
Take a look at the code below. I took the default template and used your dialog name in the appropriate places.
From your custom dialog remove the following lines:
<Publish Event="SpawnDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Event="SpawnDialog" Value="CustomizeDlg">1</Publish>
The main dialog:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="WixUI_FeatureTreeCustom">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="FeatureTree" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<DialogRef Id="ProgramDataInstallDlg" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="2">NOT Installed</Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ProgramDataInstallDlg">1</Publish>
<Publish Dialog="ProgramDataInstallDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="ProgramDataInstallDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ProgramDataInstallDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>

Related

Wix issue inserting a custom dialog into a built-in dialog set

I have created a dialog called ApiKeyDlg which I have nested in the UI. The UI is a direct copy of the built-in WixUI_InstallDir with some minor tweaks.
I have added the dialogref and the publish elements, but for some reason the ApiKeyDlgdialog does not show. Neither candle.exe or light.exe display any errors, and the MSI file installs perfectly, just without showing my custom dialog.
There are many questions similar to this one on Stackoverflow, I have read 8 or 10 of them and haven't got any closer to answering my own. I have also read this guide (https://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html), specifically the last paragraph about "Inserting a custom dialog into a built-in dialog set" but something isn't clicking and I'm not getting any further.
The order (for an installation) should be:
Welcome
License
ApiKey
Verify
Exit (complete)
<UI Id="MyWixUI_InstallDir">
<TextStyle Id="WixUI_Font_Normal" FaceName="Calibri" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Calibri" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Calibri" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<Dialog Id="ApiKeyDlg" Width="370" Height="270" Title="Organisation ID required" Modeless="yes">
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="20" Transparent="yes" NoPrefix="yes" Text="Please enter the ID of the organisation to which this device belongs" />
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="Organisation ID" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" TabSkip="yes" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Disabled="yes" TabSkip="yes" Text="!(loc.WixUINext)" />
<Control Id="ActionData" Type="Text" X="135" Y="125" Width="220" Height="30" Transparent="yes" NoPrefix="yes">
<Subscribe Event="ActionData" Attribute="Text" />
</Control>
<Control Id="ActionText" Type="Text" X="135" Y="100" Width="220" Height="20" Transparent="yes" NoPrefix="yes">
<Subscribe Event="ActionText" Attribute="Text" />
</Control>
</Dialog>
<DialogRef Id="ApiKeyDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="ApiKeyDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="ApiKeyDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="ApiKeyDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1<!--Some text field conditon here maybe?--></Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ApiKeyDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
<!--
<InstallUISequence>
<Show Dialog="ApiKeyDlg" Before="VerifyReadyDlg" Overridable="no" />
</InstallUISequence>
-->
</UI>
<UIRef Id="MyWixUI_InstallDir" />
<UIRef Id="WixUI_Common" />
I've just got this working. Solution was to put the custom dialog in a fragment outside of the product tag and clean up my UI references as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
...
Lots of other stuff, removed to shrink post
...
<UI>
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="LicenseAgreementDlg" />
<DialogRef Id="VerifyReadyDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<DialogRef Id="ApiKeyDlg" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="ApiKeyDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="ApiKeyDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="ApiKeyDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">NOT ApiKey</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ApiKeyDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
<UIRef Id="WixUI_Common" />
</UI>
<Property Id="WIXUI_APIKEY" Value="APIKEY" />
</Product>
<Fragment>
<UI>
<Dialog Id="ApiKeyDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="You can find the organisation ID for this device in the dashboard." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Organisation ID required" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="ApiKeyLabel" Type="Text" X="20" Y="60" Width="290" Height="10" NoPrefix="yes" Text="Organisation ID:" />
<Control Id="ApiKey" Type="Edit" X="20" Y="75" Width="100" Height="18" Property="WIXUI_APIKEY" Indirect="yes" />
</Dialog>
</UI>
</Fragment>
</Wix>

Change dialog sequence for WixUI_Minimal in Wix

I am creating Wix installer which will create app pool,virtual directory and doing some other settings for virtual directory. Now before it create virtual directory, I want to display a dialog to get the username and password from user and set it in App Pool. The installer already uses WixUI_Minimal to show license agreement and progress screen. I want to show my custom dialog after License screen.
How can I change the built-in sequence of WixUI_Minimal and place my dialog box?
Below is the code for the changes that I have made for the execution sequence of Wix_Minical dialog set. PoolSettingsDlg is my dialog.
NOTE: I am using Wix 3.9.1006.0 version
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:ui="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<!--<Fragment>
<Property Id="Custom_UIMinimalCommon" Value="1" />
<UI Id="WixUI_Minimal">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="Minimal" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="PoolSettingsDlg"/>
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<DialogRef Id="WelcomeDlg" />
<DialogRef Id="WelcomeEulaDlg" />
<Publish Dialog="PoolSettingsDlg" Control="Next" Event="NewDialog" Value="Return" >1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="PoolSettingsDlg">Installed AND PATCH</Publish>
<Publish Dialog="PoolSettingsDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<InstallUISequence>
<Show Dialog="WelcomeDlg" Before="WelcomeEulaDlg">Installed AND PATCH</Show>
<Show Dialog="WelcomeEulaDlg" Before="ProgressDlg">NOT Installed</Show>
</InstallUISequence>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
-->
WixUI_Minimal isn't a good choice for what you are trying to do because it displays 1 dialog and then exits the wizard loop.
A better approach would be to build upon the WixUI_FeatureTree experience. You can insert a dialog after the license dialog with this XML:
<!-- Insert into dialog sequencing by inserting control events on previous and next dialogs-->
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="YourCustomDlg">1</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="YourCustomDlg" Order="3">NOT Installed</Publish>
FWIW, I maintain an open source project called IsWiX that does this you. It projects project visual studio project templates (scaffolding) that has a fragment that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="UI">
<!-- See http://wix.sourceforge.net/manual-wix3/WixUI_index.htm for more information-->
<UIRef Id="WixUI_FeatureTree"/>
<!--Uncomment to inject a custom dialog into the install wizard loop -->
<!--<UIRef Id="CustomDlg"/>-->
</UI>
</Fragment>
</Wix>
You simply uncomment the UIRef line to pull in an additional fragment that looks like this.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="CustomDlg">
<Dialog Id="CustomDlg" Height="270" Width="370" Title="[ProductName] Setup">
<!-- Header -->
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" Text="WixUI_Bmp_Banner"/>
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Text="{\WixUI_Font_Title}Custom Dialog" Transparent="yes"/>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Text="Place your custom description here" Transparent="yes"/>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0"/>
<!-- Body -->
<Control Id="CustomLabel" Type="Text" X="20" Y="60" Width="290" Height="15" Text="Customer:" TabSkip="yes"/>
<Control Id="Custom" Type="Edit" X="20" Y="80" Width="320" Height="18" Property="CUSTOM"/>
<!-- Footer -->
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/>
<Control Id="Next" Type="PushButton" Text="&Next" TabSkip="no" Default="yes" Height="17" Width="56" X="236" Y="243">
<Publish Event="NewDialog" Value="CustomizeDlg"/>
</Control>
<Control Id="Cancel" Type="PushButton" Text="Cancel" TabSkip="no" Height="17" Width="56" X="304" Y="243" Cancel="yes">
<Publish Event="SpawnDialog" Value="CancelDlg"/>
</Control>
<Control Id="Back" Type="PushButton" Text="&Back" TabSkip="no" Height="17" Width="56" X="180" Y="243">
<Publish Event="NewDialog" Value="LicenseAgreementDlg"/>
</Control>
</Dialog>
<!-- Insert into dialog sequencing by inserting control events on previous and next dialogs-->
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomDlg">1</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="CustomDlg" Order="3">NOT Installed</Publish>
</UI>
</Fragment>
</Wix>
Using IsWiX it's possible to create a basic installer for a desktop app, windows service and IIS web application without typing a lick of XML. This really helps with the learning curve. As your skills improve you can customize by authoring additional XML.

WiX INSTALLDIR not set after editing it per hand (not per BrowseDialog)

i try to let the user set the INSTALLDIR per hand, but the value from the textfield is not transfered into the INSTALLDIR Variable.
When the user click on the browsebutton and select the target directory it works.
<Product>
...
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
...
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="HereIAm">
....
</Directory>
</Directory>
</Fragment>
<UI>
...
<Publish Dialog="CustInstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="CustInstallDirDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg">1</Publish>
<Publish Dialog="CustInstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="CustInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
....
</UI>
<UI>
<Dialog Id="CustInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
...
<Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
</Dialog>
</UI>
But i have another field, where i can edit my text per hand.
<product>
<Property Id="WIXUI_XMLDATASTORE" Value="DATASTOREDIR" />
<CustomAction Id="SetDataStorePath"
Property="WIXUI_XMLDATASTORE"
Value="[DATASTOREDIR]"
Execute="immediate"
/>
<InstallExecuteSequence>
<Custom Action="SetDataStorePath"
Before="InstallInitialize"
/>
</product>
<UI Id="ServiceAccount">
<Dialog Id="ServiceAccountDlg" ...>
...
<Control Id="DataStoreLabel" Type="Text" X="20" Y="150" Width="290" Height="15" NoPrefix="yes"
Text="Please enter Datastore Location" />
<Control Id="CDataStore" Type="PathEdit" X="20" Y="165" Width="220" Height="18" Property="WIXUI_XMLDATASTORE" Indirect="yes"/>
<Control Id="ChangeFolderDS" Type="PushButton" X="250" Y="165" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
</Dialog>
</UI>
<UI>
<Publish Dialog="ServiceAccountDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg">1</Publish>
<Publish Dialog="ServiceAccountDlg" Control="Next" Event="NewDialog" Value="ISISIPSettingsDlg">1</Publish>
<Publish Dialog="ServiceAccountDlg" Control="ChangeFolderDS" Property="_BrowseProperty" Value="[WIXUI_XMLDATASTORE]" Order="1">1</Publish>
<Publish Dialog="ServiceAccountDlg" Control="ChangeFolderDS" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
</UI>
Thank you,
Kevin
Okay, found the error.
The following line was missing in the CustInstallDirDlg:
<Publish Dialog="CustInstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
now it looks like this:
<Publish Dialog="CustInstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="CustInstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="CustInstallDirDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg">1</Publish>
<Publish Dialog="CustInstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="CustInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

WIX - Adding a custom Dialog having trouble with back/next buttons

I am working on creating a custom WixUi configuration, here is what I've done so far:
Copied the WixUI_Minimal.wxs file into my project and changed the Id to: WixUI_CustomMinimal
Copied the WelcomeEulaDlg.wxs file into my project and changed the Id to: CustomWelcomeEulaDlg
Copied the WelcomeDlg.wxs file into my project and changed the Id to: CustomWelcomeDlg
Added InstallTypeDlg.wxs to my project
Modified the CustomWelcomeEulaDlg to change the Install button to a next button.
Modified WixUI_CustomMinimal to make the Next/NextNoShield buttons on WelcomeEulaDlg open the InstallTypeDlg dialog
Added the InstallTypeDlg Dialog to the InstallUiSequence.
So now the problem: I am trying to setup a back button on InstallTypeDlg, this is working but after pressing the back button and then pressing the next button on CustomWelcomeEulaDlg InstallTypeDlg is skipped and it goes straight to installing.
Here are my files:
WixUI_CustomMinimal
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WixUI_Minimal.wxs" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<!--
First-time install dialog sequence:
- WixUI_WelcomeEulaDlg
Maintenance dialog sequence:
WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="WixUI_CustomMinimal">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="Minimal" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<DialogRef Id="CustomWelcomeDlg" />
<DialogRef Id="CustomWelcomeEulaDlg" />
<DialogRef Id="InstallTypeDlg" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Publish Dialog="CustomWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="CustomWelcomeEulaDlg" Control="Next" Event="NewDialog" Value="InstallTypeDlg">Installed AND PATCH</Publish>
<Publish Dialog="CustomWelcomeEulaDlg" Control="NextNoShield" Event="NewDialog" Value="InstallTypeDlg">Installed AND PATCH</Publish>
<Publish Dialog="InstallTypeDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeEulaDlg" Order="2">Installed AND PATCH</Publish>
<InstallUISequence>
<Show Dialog="CustomWelcomeDlg" Before="CustomWelcomeEulaDlg">Installed AND PATCH</Show>
<Show Dialog="CustomWelcomeEulaDlg" Before="InstallTypeDlg">NOT Installed</Show>
<Show Dialog="InstallTypeDlg" Before="ProgressDlg">NOT Installed</Show>
</InstallUISequence>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>
CustomWelcomeEulaDlg
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WelcomeEulaDlg.wxs" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="CustomWelcomeEulaDlg" Width="370" Height="270" Title="!(loc.WelcomeEulaDlg_Title)">
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeEulaDlgBitmap)" />
<Control Id="Title" Type="Text" X="130" Y="6" Width="225" Height="30" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeEulaDlgTitle)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="130" Y="207" Width="226" Height="18" CheckBoxValue="1" Property="LicenseAccepted" Text="!(loc.WelcomeEulaDlgLicenseAcceptedCheckBox)" />
<Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
<Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
</Control>
<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Next" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
<Condition Action="enable">LicenseAccepted = "1"</Condition>
<Condition Action="show">ALLUSERS</Condition>
</Control>
<Control Id="NextNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Next" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
<Condition Action="enable">LicenseAccepted = "1"</Condition>
<Condition Action="show">NOT ALLUSERS</Condition>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="LicenseText" Type="ScrollableText" X="130" Y="36" Width="226" Height="162" Sunken="yes" TabSkip="no">
<Text SourceFile="!(wix.WixUILicenseRtf)" />
</Control>
</Dialog>
</UI>
<InstallUISequence>
<Show Dialog="CustomWelcomeEulaDlg" Before="ProgressDlg" Overridable="yes">NOT Installed</Show>
</InstallUISequence>
</Fragment>
</Wix>
InstallTypeDlg
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WelcomeEulaDlg.wxs" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Property Id="INSTALLTYPE" Value="Null"/>
<Dialog Id="InstallTypeDlg" Width="370" Height="270" Title="!(loc.WelcomeEulaDlg_Title)">
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeEulaDlgBitmap)" />
<Control Id="Title" Type="Text" X="130" Y="6" Width="225" Height="30" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeEulaDlgTitle)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
<Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
</Control>
<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Publish Event="AddLocal" Value="ServiceFeature"><![CDATA[INSTALLTYPE = "SERVICE"]]></Publish>
<Publish Event="Remove" Value="ServiceFeature"><![CDATA[INSTALLTYPE <> "SERVICE"]]></Publish>
<Condition Action="disable">INSTALLTYPE = "Null"</Condition>
<Condition Action="enable"><![CDATA[INSTALLTYPE <> "Null"]]></Condition>
<Condition Action="show">ALLUSERS</Condition>
</Control>
<Control Id="InstallNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Publish Event="AddLocal" Value="ServiceFeature"><![CDATA[INSTALLTYPE = "SERVICE"]]></Publish>
<Publish Event="Remove" Value="ServiceFeature"><![CDATA[INSTALLTYPE <> "SERVICE"]]></Publish>
<Condition Action="disable">INSTALLTYPE = "Null"</Condition>
<Condition Action="enable"><![CDATA[INSTALLTYPE <> "Null"]]></Condition>
<Condition Action="show">NOT ALLUSERS</Condition>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="FeatureGroup" Property="INSTALLTYPE" Type="RadioButtonGroup" Default="no" X="130" Y="36" Width="226" Height="162">
<RadioButtonGroup Property="INSTALLTYPE">
<RadioButton Text="Console" Height="17" Value="CONSOLE" Width="150" X="20" Y="0" />
<RadioButton Text="Windows Service" Height="17" Value="SERVICE" Width="150" X="20" Y="25" />
<RadioButton Value="Null" X="0" Y="0" Width="0" Height="0" Text="Null" />
</RadioButtonGroup>
</Control>
</Dialog>
</UI>
<InstallUISequence>
<Show Dialog="InstallTypeDlg" Before="ProgressDlg" Overridable="yes">NOT Installed</Show>
</InstallUISequence>
</Fragment>
</Wix>
The first problem is in the InstallUISequence. You should use:
<Show Dialog="CustomWelcomeDlg" Before="CustomWelcomeEulaDlg">
Installed AND PATCH
</Show>
<Show Dialog="CustomWelcomeEulaDlg" Before="ProgressDlg">
NOT Installed
</Show>
In the CustomWelcomeEulaDlg, the Back and Next buttons should be like this:
<Control Id="Back" Type="PushButton" X="156" Y="243"
Width="56" Height="17" Disabled="yes" Text="Back" />
<Control Id="Next" Type="PushButton" ElevationShield="yes"
X="212" Y="243" Width="80" Height="17" Default="yes"
Text="Next" Hidden="yes">
<Publish Event="NewDialog" Value="InstallTypeDlg">1</Publish>
</Control>
And in the InstallTypeDlg, the Back and Install buttons should be similar to this:
<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56"
Height="17" Disabled="yes" Text="Back">
<Publish Event="NewDialog" Value="CustomWelcomeEulaDlg">1</Publish>
</Control>
<Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243"
Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
<Publish Event="EndDialog" Value="Return" />
</Control>

How to set a Property in Wix

I'm confused about the correct procedure for setting a Property in Wix. Is it necessary to use an Event? Are there existing, built-in, events and can they be tailored to custom Wix Properties? What I'm trying to do (with Wix 3.0) is install a IIS Virtual Directory using a custom UI. The problem here is that the property I'm attempting to set the virtual directory name with is not being over-written from the value provided in the interface. The other property here used for the installation path is being over-written and it looks like the Event="SetTargetPath" is what is taking care of that, am I wrong or missing something with this installation UI? Thanks much for your help.
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="MyCo" Name="MyCo">
<Directory Id="FILEINSTALLDIR" Name="MyCo Admin">
<Component Id="MyCo_AdminComponent" Guid="########-####-####-####-############">
<File Source="Default.aspx" Vital="yes" KeyPath="yes" DiskId="1"/>
</Component>
</Directory>
</Directory>
</Directory>
<Component Id='ADMINVIRTUALDIRCOMP' Guid='########-####-####-####-############' Permanent='no'>
<iis:WebVirtualDir Id='VIRTUALDIRECTORY' Alias='[WIXUI_VIRTUALDIR]' Directory='FILEINSTALLDIR' WebSite='DefaultWebSite'>
<iis:WebApplication Id='ADMINWEBAPPLICATION' Name='[WIXUI_VIRTUALDIR]' />
</iis:WebVirtualDir>
</Component>
</Directory>
<iis:WebSite Id='DefaultWebSite' Description='Default Web Site'>
<iis:WebAddress Id='AllUnassigned' Port='80' />
</iis:WebSite>
<Feature Id="ProductFeature" Title="MyCo WebApp" Level="1">
<ComponentRef Id="MyCo_AdminComponent" />
<ComponentRef Id="ADMINVIRTUALDIRCOMP" />
</Feature>
<UIRef Id="WixUI_Common" />
<UIRef Id="WixUI_InstallWeb" />
<Property Id="WIXUI_INSTALLDIR" Value="FILEINSTALLDIR" />
<Property Id="WIXUI_VIRTUALDIR" Value ="VIRTUALDIR" ></Property>
<Property Id="VIRTUALDIR" ><![CDATA[AdminCompName]]></Property>
<UI Id="WixUI_InstallWeb">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4">
<![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]>
</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallWebDlg">1</Publish>
<Publish Dialog="InstallWebDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallWebDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallWebDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">
NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallWebDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3">
<![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallWebDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">
WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallWebDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallWebDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallWebDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
<Dialog Id="InstallWebDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
</Control>
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
<Control Id="VirtualDirLabel" Type="Text" X="20" Y="160" Width="290" Height="10" NoPrefix="yes" Text="Virtual Directory:" />
<Control Id="VirtualDir" Type="Edit" X="20" Y="172" Width="320" Height="18" Property="WIXUI_VIRTUALDIR" Indirect="yes" />
</Dialog>
</UI>
Is it necessary to use an Event? Are there existing, built-in, events and can they be tailored to custom Wix Properties?
No, it is not necessary to use an Event to set property values; they can be set explicitly, via custom actions, or from conditions. To answer the second question, no, there isn't an event model which you can tailor to custom properties within Wix.
I can't help but wonder if your problem of the virtual directory name not being set has to do with your VIRTUALDIR property not having the Secure attribute. Take a look at this model. I'm not certain, but I think only secure properties can move from the client (pink) area to the server (green) area.
Perhaps try adding Secure="yes" to the property and see if that does the trick?