Wix error code 2343 - wix

I am packaging a MSI using WIX. The binaries need to be installed on a UNC drive (\share\xxxz\east). The installation works fine, the binaries are installed on the UNC, but I get the following error during uninstallation.
"The installer has encountered an unexpected error installing the package. This may indicate a problem with this package. The error code is 2343."
What's driving me crazy is why the installation works and the uninstall fails!
Below is what my wix script looks like...
<?xml version="1.0" encoding="UTF-8"?>
<!-- Create the package per machine and not per user -->
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<!-- Package the binaries in the msi -->
<Media Id="1" Cabinet="CABIIS.cab" EmbedCab="yes" />
<!-- Default the asp.net framework to 4.0 -->
<Property Id="FRAMEWORKBASEPATH">
<RegistrySearch Id="FindFrameworkDir" Root="HKLM" Key="SOFTWARE\Microsoft\.NETFramework" Name="InstallRoot" Type="raw"/>
</Property>
<Property Id="ASPNETREGIIS" >
<DirectorySearch Path="[FRAMEWORKBASEPATH]" Depth="4" Id="FindAspNetRegIis">
<FileSearch Name="aspnet_regiis.exe" MinVersion="4.0.3"/>
</DirectorySearch>
</Property>
<CustomAction Id="WebAppIISVersionSetup" Directory="TARGETDIR" ExeCommand="[ASPNETREGIIS] -norestart -ir" Return="check"/>
<InstallExecuteSequence>
<Custom Action="WebAppIISVersionSetup" After="InstallFinalize">ASPNETREGIIS AND NOT Installed</Custom>
<Custom Action="**SetInstallLocationRootDirectory**" After="CostFinalize" />
</InstallExecuteSequence>
<!-- Set the install location from the trigger file -->
<CustomAction
Id="SetInstallLocationRootDirectory"
Directory="INSTALLLOCATION"
Value="[TARGET.INSTALLLOCATION]" />
<!-- Properties & Variables -->
<WixVariable Id="WixUIBannerBmp" Value="Resources/CeLogo.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Resources/MidstreamChangeTeam.bmp" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<Property Id="CALCULATION.SERVICE.USERNAME" Value="xx\"/>
<Property Id="CALCULATION.SERVICE.PASSWORD" Hidden="yes" />
<!-- The directory structure for installation -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION" Name="East">
<Directory Id="WEBSITESFOLDER" Name="Website" >
<Directory Id="EASTROOTFOLDER" Name="EastRoot" />
<Directory Id="WCFCALCULATIONFOLDER" Name="CalculationService" />
</Directory>
<Directory Id="LOGFOLDER" Name="Log"/>
</Directory>
</Directory>
<!-- The features in the product -->
<Feature Id="ProductFeature" Title="East Components" Level="1">
<ComponentGroupRef Id="CalculationServiceComponents" />
</Feature>
<!-- Create a UI for the installer -->
<UI Id="EAST_InstallUI">
<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="InstallDirDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="ServiceIdentityDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="ServiceIdentityDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" >1</Publish>
<Publish Dialog="ServiceIdentityDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ServiceIdentityDlg" 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>
<!--<Dialog Id="DatabaseDlg" Title="!(loc.DatabaseDlg_Title)" X="50" Y="50" Width="370" Height="270">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="369" Height="44" Text="WixUI_Bmp_Banner" Disabled="yes" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.DatabaseDlgTitle)" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.DatabaseDlgDescription)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="373" Height="0" Disabled="yes" />
<Control Id="BottomLine" Disabled="yes" Height="1" Type="Line" Width="370" X="0" Y="234" />
-->
<!--<Control Id="DatabaseServerLabel" Text="!(loc.DatabaseServerLabel)" Type="Text" Width="100" Height="18" X="20" Y="102" />
<Control Id="DatabaseServer" Type="Edit" X="130" Y="100" Width="120" Height="18" Property="DB.SERVER" />
<Control Id="DatabaseDlgText" Text="!(loc.DatabaseDlgText)" Type="Text" Width="330" Height="30" X="20" Y="60" />-->
<!--
<Control Id="LogFileLabel" Text="!(loc.LogFileNameLabel)" Type="Text" Width="100" Height="18" X="20" Y="137" />
<Control Id="LogFileName" Type="Edit" X="130" Y="135" Width="120" Height="18" Property="LOGFOLDER" />
-->
<!--<Control Id="UnprocessedFileLocationLabel" Text="!(loc.UnprocessedFileLocationNameLabel)" Type="Text" Width="100" Height="18" X="20" Y="172" />
<Control Id="UnprocessedFileLocationName" Type="Edit" X="130" Y="170" Width="120" Height="18" Property="UNPROCESSEDFILELOCATION" />-->
<!--
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="!(loc.WixUINext)" Disabled="no" Default="yes" >
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Text="!(loc.WixUICancel)" Cancel="yes">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>-->
<Dialog Id="InvalidUsernamePasswordDlg" Y="10" Width="260" Height="85" Title="!(loc.InvalidUsernamePasswordDlg_Title)">
<Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="30" Text="!(loc.InvalidUsernamePasswordDlgText)" />
<Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="!(loc.ErrorDlgErrorIconTooltip)" FixedSize="yes" IconSize="32" Text="!(loc.CancelDlgIcon)" />
<Control Id="Ok" Type="PushButton" X="105" Y="57" Width="50" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIOK)">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
</Dialog>
<Dialog Id="ServiceIdentityDlg" Title="!(loc.ServiceIdentityDlg_Title)" X="50" Y="50" Width="370" Height="270">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="369" Height="44" Text="!(loc.SetupTypeDlgBannerBitmap)" Disabled="yes" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.ServiceIdentityDlgTitle)" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.ServiceIdentityDlgDescription)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="373" Height="0" Disabled="yes" />
<Control Id="BottomLine" Disabled="yes" Height="1" Type="Line" Width="370" X="0" Y="234" />
<Control Id="UsernamePasswordText" Text="!(loc.UsernamePasswordText)" Type="Text" Width="330" Height="60" X="20" Y="60" />
<Control Id="UsernameLabel" Text="!(loc.UsernameLabel)" Type="Text" Width="100" Height="18" X="20" Y="127" />
<Control Id="ServiceIdentity" Type="Edit" X="130" Y="125" Width="120" Height="18" Property="CALCULATION.SERVICE.USERNAME" />
<Control Id="PasswordLabel" Text="!(loc.PasswordLabel)" Type="Text" Width="100" Height="18" X="20" Y="162" />
<Control Id="Password" Type="Edit" X="130" Y="160" Width="120" Height="18" Property="CALCULATION.SERVICE.PASSWORD" Password="yes" />
<Control Id="PasswordCheckLabel" Text="!(loc.ConfirmPasswordLabel)" Type="Text" Width="100" Height="18" X="20" Y="192" />
<Control Id="ConfirmPassword" Type="Edit" X="130" Y="190" Width="120" Height="18" Property="ConfirmPassword" Password="yes" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="!(loc.WixUINext)" Disabled="no" Default="yes" >
<Publish Property="IsValidUser" Value="1">CALCULATION.SERVICE.USERNAME AND CALCULATION.SERVICE.PASSWORD AND CALCULATION.SERVICE.PASSWORD = ConfirmPassword</Publish>
<Publish Property="IsValidUser">NOT CALCULATION.SERVICE.USERNAME OR NOT CALCULATION.SERVICE.PASSWORD OR CALCULATION.SERVICE.PASSWORD <> ConfirmPassword</Publish>
<Publish Event="SpawnDialog" Value="InvalidUsernamePasswordDlg">NOT IsValidUser</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Text="!(loc.WixUICancel)" Cancel="yes">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
I trigger the install via a cmd file, which looks like...
msiexec.exe /i Ct.IIS.msi ^
TARGET.INSTALLLOCATION="\\share\xxxz\east\" ^
CALCULATION.SERVICE.USERNAME=".\xxx" ^
CALCULATION.SERVICE.PASSWORD="xxx" ^
/l* Ct.IIS.Install.log /q
Any ideas?

The below Custom action is running in Uninstall too. But you won’t pass the TARGET.INSTALLLOCATION property value in uninstall. So this is the issue here.
<Custom Action="**SetInstallLocationRootDirectory**" After="CostFinalize" />
Modify this Custom action to run in Installation only.
<Custom Action="**SetInstallLocationRootDirectory**" After="CostFinalize">Not Installed</Custom>

Related

Display the warning dialog when a condition is satisfied in Wix

In my Wix Installer, I am searching for registry key for Adobe acrobat reader and displaying a warning dialog with "YES" and "NO" option. This dialog is supposed to display during the install sequence immediately after WelcomeDlg enabling user to "continue" or "exit" the installation if Adobe reader is not installed.
I am finding an issue in my code as the "AdobePrerequisiteDlg" does not honors the "ADOBEREADERINSTALLED" property, The dialog is getting displayed even when registry key exist.
The warning dialog "AdobePrerequisiteDlg" should only be displayed when Property "ADOBEREADERINSTALLED" is not satisfied (i.e. registry key does not exist),
But as of now that is not happening as I am able to see the dialog getting displayed everytime.
I tried many changes but not able to figure out where the problem exist. Here is my code :
Product.wxs
<Property Id="ADOBEREADERINSTALLED">
<RegistrySearch Id="ADOBEREADERINSTALLED_REGSEARCH" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\Acrobat.exe" Root="HKLM" Type="raw"/>
</Property>
<UIRef Id="PrerequisiteDialogUI" />
<UI Id="UserInterface">
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="AdobePrerequisiteDlg">1</Publish>
</UI>
Components.wxs
<Fragment>
<UI Id="PrerequisiteDialogUI">
<Dialog Id="AdobePrerequisiteDlg" Width="370" Height="270" Title="Software Requirements Incomplete">
<Control Id="YES" Type="PushButton" X="180" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="YES">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Id="NO" Type="PushButton" Text="NO" X="236" Y="243" Width="56" Height="17" Cancel="yes" >
<Publish Event="EndDialog" Value="Exit" />
</Control>
<Control Id="Text" Type="Text" X="1" Y="50" Width="340" Height="120" TabSkip="no">
<Text>
The following software requirements have not been met :
Adobe Acrobat Reader
Do you wish to continue ?
</Text>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Prerequisite for $(var.ProductName) is not installed." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Adobe Reader 9.0" />
<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" />
</Dialog>
</UI>
<InstallUISequence>
<Show Dialog="AdobePrerequisiteDlg" Before="ExecuteAction"> <![CDATA[NOT Installed AND ADOBEREADERINSTALLED]]></Show>
</InstallUISequence>
<Fragment>
First of all, you need brackets or double NOT for the condition: NOT (Installed AND ADOBEREADERINSTALLED) OR NOT Installed AND NOT ADOBEREADERINSTALLED
And then. Do you see WelcomeDialog when you start your installer? Or AdobePrerequisiteDlg goes first? If second variant, you need to make some changes in your code. Try this:
Add reference to your custom dialog in your custom UI.
UIRef should point at custom UI, not the UI where custom dialog is described.
In your custom UI describe all variants and steps for dialogs. (see example below)
Condition statement should go inside Publish element.
InstallUISequence is not necessary.
Product.wxs
<Fragment>
<Property Id="ADOBEREADERINSTALLED">
<RegistrySearch Id="ADOBEREADERINSTALLED_REGSEARCH" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\Acrobat.exe" Root="HKLM" Type="raw"/>
</Property>
</Fragment>
<Fragment>
<UIRef Id="UserInterface" />
</Fragment>
<Fragment>
<UI Id="UserInterface">
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />
<DialogRef Id="AdobePrerequisiteDlg"/>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="AdobePrerequisiteDlg">NOT ADOBEREADERINSTALLED</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="Put_Next_Dialog_Id_Here">ADOBEREADERINSTALLED</Publish>
<Publish Dialog="AdobePrerequisiteDlg" Control="YES" Event="NewDialog" Value="Put_Next_Dialog_Id_Here"/>
<Publish Dialog="AdobePrerequisiteDlg" Control="NO" Event="NewDialog" Value="UserExit"/>
</UI>
</Fragment>
Components.wxs
<Fragment>
<UI Id="PrerequisiteDialogUI">
<Dialog Id="AdobePrerequisiteDlg" Width="370" Height="270" Title="Software Requirements Incomplete">
<Control Id="YES" Type="PushButton" X="180" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="YES"/>
<Control Id="NO" Type="PushButton" Text="NO" X="236" Y="243" Width="56" Height="17" Cancel="yes" />
<Control Id="Text" Type="Text" X="1" Y="50" Width="340" Height="120" TabSkip="no">
<Text>
The following software requirements have not been met :
Adobe Acrobat Reader
Do you wish to continue ?
</Text>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Prerequisite for $(var.ProductName) is not installed." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Adobe Reader 9.0" />
<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" />
</Dialog>
</UI>
</Fragment>

Issue replacing the default WelcomeDlg dialog

I have managed to add a custom dialog in the middle of the sequence which collects several values from the user and saves them to the registry (in the dialog with ID ApiKeyDlg).
However, I'm having difficulty (5+ hours wasted) replacing the WelcomeDlg with a custom dialog during major upgrades only. I.E. I want to show a custom WelcomeDlg that goes straight to the VerifyReadyDlg for Major Upgrades (detected using Installed OR PREVFOUND).
I have also tried using WIX_UPGRADE_DETECTED, same results.
What am I doing incorrectly here? Is it my condition that is failing or am I misunderstanding the process of editing the sequence?
Light.exe shows no errors, but it fails to either:
Detect that an older version of the app is already installed
Show the UpgradeWelcomeDlg after detecting an old version installed
I'm not sure how I can narrow down which part is failing?
<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" />
<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" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed OR NOT PREVFOUND</Publish>
<Publish Dialog="UpgradeWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed OR PREVFOUND</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"></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="UpgradeWelcomeDlg" Order="2">Installed OR PREVFOUND</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>
<Dialog Id="ApiKeyDlg" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.ProgressDlgBannerBitmap)" />
<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="Only the Organisation ID is required unless you're using a web proxy" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Agent configuration" />
<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="55" Width="290" Height="10" NoPrefix="yes" Text="Organisation ID (required):" />
<Control Id="ApiKey" Type="Edit" X="20" Y="70" Width="300" Height="18" Property="UI_ORGANISATION" Indirect="yes" />
<Control Id="ProxyAddressLabel" Type="Text" X="20" Y="95" Width="290" Height="10" NoPrefix="yes" Text="Proxy server address (optional):" />
<Control Id="Proxy" Type="Edit" X="20" Y="110" Width="300" Height="18" Property="UI_PROXYADDRESS" Indirect="yes" />
<Control Id="ProxyUsernameLabel" Type="Text" X="20" Y="130" Width="290" Height="10" NoPrefix="yes" Text="Proxy username (leave blank for default):" />
<Control Id="ProxyUsername" Type="Edit" X="20" Y="145" Width="300" Height="18" Property="UI_PROXYUSERNAME" Indirect="yes" />
<Control Id="ProxyPasswordLabel" Type="Text" X="20" Y="165" Width="290" Height="10" NoPrefix="yes" Text="Proxy password (leave blank for default):" />
<Control Id="ProxyPassword" Type="Edit" Password="yes" X="20" Y="180" Width="300" Height="18" Property="UI_PROXYPASSWORD" Indirect="yes" />
<Control Id="ScoutCheckbox" Type="CheckBox" X="20" Y="205" Width="300" Height="17" Property='SCOUTSHORTCUT' CheckBoxValue='1'>
<Text> Create a Start Menu shortcut for SomeApplicationName Scout (optional)</Text>
</Control>
</Dialog>
<Dialog Id="UpgradeWelcomeDlg" Width="370" Height="270" Title="[ProductName] Update">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
<Publish Property="WixUI_InstallMode" Value="Update">Installed AND PATCH</Publish>
</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="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="135" Y="80" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)" >
</Control>
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgTitle)" />
</Dialog>
<InstallUISequence>
<Show Dialog="UpgradeWelcomeDlg" Before="ProgressDlg">Installed OR PREVFOUND</Show>
</InstallUISequence>
<UIRef Id="WixUI_Common" />
</UI>
Ultimately, I want to show completely different dialogs for Major Upgrades compared to an initial install.
Well then... I just managed to get it working using this:
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed OR NOT PREVFOUND OR NOT WIX_UPGRADE_DETECTED</Publish>
<Publish Dialog="UpgradeWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed OR PREVFOUND OR WIX_UPGRADE_DETECTED</Publish>
Perhaps writing this question cleared my mind! Who knows.

How to create/append the Application folder name at the end of the Target/installation path

I want to create/append the Application folder name at the end of the Target/installation path.
The default path is "C:\CompanyName\"
In this case also it should install in "C:\CompanyName\AppName"
And if the user changes the path to "C:\Test\" (by browse dialog or by typing in the text box), then installation should happen in the "C:\Test\AppName"
I've referred the Wix UI as "WixUI_InstallDir"
I've also Set the Property Id="WIXUI_INSTALLDIR" Value="APPPATH".
And my all shortcuts should point to the final installation path.
Sample snippet code:
Product.wxs
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<!--- some code here --->
<Property Id="APPPATH" Secure="yes"><![CDATA[C:\CompanyName]]></Property>
<Property Id="WIXUI_INSTALLDIR" Value="APPPATH" />
<Property Id="ALLUSERS">1</Property>
<!--- some code here --->
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='APPPATH' Name='Product_Title'>
<Directory Id='ConfigurationId' Name='Configuration'>
<!--- some code here --->
</Directory>
</Directory>
</Directory>
</Directory>
<!--- some code here --->
<UI Id="CustomWixUI_Mondo">
<UIRef Id= "AppWixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />
</UI>
</Product>
AppWixUI_InstallDir.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="AppWixUI_InstallDir">
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<DialogRef Id="BrowseDlg" />
<!-- some more code... .... -->
<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="AppInstallDirDlg" Control="InstallNoShield" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="AppInstallDirDlg" Control="InstallNoShield" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="AppInstallDirDlg" Control="InstallNoShield" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="AppInstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="AppInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<!-- some more code... .... -->
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
AppInstallDirDlg.wxs
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="AppInstallDirDlg" Width="370" NoMinimize = "yes" Height="270" Title="InstallDirDlg_Title">
<Control Id="InstallNoShield" Type="PushButton" ToolTip="Next" ElevationShield="no" X="4" Y="243" Width="80" Height="17" Default="yes" Hidden="yes" Disabled="yes" Text="Next">
<Condition Action="show">NOT Installed </Condition>
<Condition Action="enable">NOT Installed</Condition>
<Condition Action="default">NOT Installed</Condition>
<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>
</Control>
<!-- <Control Id="Next" Type="PushButton" X="4" Y="243" Width="56" Height="17" ToolTip="Next" Default="yes" Text="Next" /> -->
<Control Id="Back" Type="PushButton" X="246" Y="243" Width="56" Height="17" ToolTip="Back" Text="Back" >
<Publish Event="NewDialog" Value="AppLicenseAgreementDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" ToolTip="Cancel" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="FolderLabel" Type="Text" X="20" Y="58" Width="290" Height="15" NoPrefix="yes" Text="InstallDirDlgFolderLabel" />
<Control Id="Folder" Type="PathEdit" X="20" Y="75" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="96" Width="80" Height="17" ToolTip="Change Folder" Text="InstallDirDlgChange" />
<Control Id="DiskUsage" Type="Text" X="20" Y="128" Width="290" Height="15" NoPrefix="yes" Text="InstallDirDlgDiskUsage" />
<Control Id="VolumeList" Type="VolumeCostList" X="20" Y="145" Width="320" Height="75" Sunken="yes" Fixed="yes" Remote="yes" Text="DiskCostDlgVolumeList" />
</Dialog>
</UI>
</Fragment>
</Wix>
Any help please...
If you don't need to show the folder MyApp in the dialogs, you can do the following:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLFOLDER" Name="CompanyName">
<Directory Id="MyApp" Name="MyApp" />
</Directory>
</Directory>
And in your components replace INSTALLFOLDER with MyApp, this way:
<Component Id="Component_Core" Guid="*" Directory="MyApp">
As a side note, I don't recommend messing up with the dialogs just to show something like "C:\CompanyName\MyApp" or "C:\Temp\MyApp". It is easier if you just show "C:\CompanyName" or "C:\Temp" and install the files to the MyApp folder.
If you still want to show the full text, try something like this (not recommended):
<Property Id="INDIRECT_FOLDER" Value="MyApp" />
<Dialog Id="NewInstallDirDlg" 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="!(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="INDIRECT_FOLDER" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
</Dialog>

InstallScopeDlg in Custom Wix UI not working

Hi i have developed an setup with wix and now i need to ask users wether its AllUser or perUser.After a long research i found that InstallScopeDLg can make it possible.But I have added custom UI with my wix and i wasn't able to add InstallScopeDlg with this custom UI in WIX.
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="ReadmeDlg" Order="2">LicenseAccepted = "1"</Publish>
<Publish Dialog="MyInstallScopeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="MyInstallScopeDlg" Control="Next" Event="NewDialog" Value="ReadmeDlg" Order="2"></Publish>
<Publish Dialog="ReadmeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="ReadmeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="2"></Publish>
and this is my InstallScopeDlg code
<?xml version="1.0" encoding="UTF-8"?><!--
Copyright (c) Microsoft Corporation. All rights reserved.-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="MyInstallScopeDlg" Width="370" Height="270" Title="!(loc.InstallScopeDlg_Title)" KeepModeless="yes">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallScopeDlgBannerBitmap)" />
<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="Description" Type="Text" X="25" Y="23" Width="280" Height="20" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgTitle)" />
<Control Id="BothScopes" Type="RadioButtonGroup" X="20" Y="55" Width="330" Height="120" Property="WixAppFolder" Hidden="yes">
<RadioButtonGroup Property="WixAppFolder">
<RadioButton Value="WixPerUserFolder" X="0" Y="0" Width="295" Height="16" Text="!(loc.InstallScopeDlgPerUser)" />
<RadioButton Value="WixPerMachineFolder" X="0" Y="60" Width="295" Height="16" Text="!(loc.InstallScopeDlgPerMachine)" />
</RadioButtonGroup>
<Condition Action="show">Privileged AND (!(wix.WixUISupportPerUser) AND !(wix.WixUISupportPerMachine))</Condition>
</Control>
<Control Id="PerUserDescription" Type="Text" X="33" Y="70" Width="300" Height="36" Hidden="yes" Text="!(loc.InstallScopeDlgPerUserDescription)">
<Condition Action="show">!(wix.WixUISupportPerUser)</Condition>
</Control>
<Control Id="NoPerUserDescription" Type="Text" X="33" Y="70" Width="300" Height="36" Hidden="yes" Text="!(loc.InstallScopeDlgNoPerUserDescription)">
<Condition Action="show">NOT !(wix.WixUISupportPerUser)</Condition>
</Control>
<Control Id="PerMachineDescription" Type="Text" X="33" Y="131" Width="300" Height="36" Hidden="yes" Text="!(loc.InstallScopeDlgPerMachineDescription)">
<Condition Action="show">Privileged</Condition>
</Control>
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<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>
</Dialog>
</UI>
and for RadioButtonGroup Property="WixAppFolder" in InstallScopeDlg
i have added in product.wxs file
and am getting the error code as
Error 10 The Windows Installer XML variable
!(wix.WixUISupportPerUser) is unknown. Please ensure the variable is
declared on the command line for light.exe, via a WixVariable element,
or inline using the syntax !(wix.WixUISupportPerUser=some value which
doesn't contain parenthesis).
Hence it we need to initially declare its components under the fragment section in your myinstallscopedlg.wxs
<?xml version="1.0" encoding="UTF-8"?><!--
Copyright (c) Microsoft Corporation. All rights reserved.-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" />
<WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" />
<UI>
<Dialog Id="MyInstallScopeDlg" Width="370" Height="270" Title="!(loc.InstallScopeDlg_Title)" KeepModeless="yes">
by doing this this ERROR The Windows Installer XML variable !(wix.WixUISupportPerUser) is unknown. will be solved

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?