Wix How to insert a custom dialog - wix

I have Wix configured to use WixUI_Minimal and have a number of dialogs restricted.
I also created a custom Dialog to gather some user input.
Now i am unsure how to insert the custom Dialog and at the correct sequence.
I would like to insert custom Dialog after the WelcomeDlg
How do i do this?
here is my UI.
<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="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<!--This is the welcome dialog you specified-->
<DialogRef Id="WelcomeDlg" />
<!--Hook the new welcome dialog to the next one in the stack-->
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="PrepareDlg">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>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
<UIRef Id="WixUI_ErrorProgressText" />

need this in my customdlg
Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomDlg">1
and removed the declaration from the above

Related

Wix Change Installation Path using UI Dialogs

I am creating an .msi for a console application using Wix 3.5. In that i am trying to give user an option to change the installation directory using UI dialogs. below is my code of Product.wxs :
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="{5E4364D8-DEBA-4615-990C-1C886E569F33}" Name="MeridianAutomationSetUp" Language="1033" Version="1.2.0.0"
Manufacturer="Meridian Automation" UpgradeCode="d479e1dc-eeff-4c66-a977-04f67f5348ae">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x86"
Description="Meridian" Comments="Meridian" InstallPrivileges="elevated"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of Meridian Automation SetUp is already installed." Schedule="afterInstallInitialize" />
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="Meridian Automation Setup" Level="1">
<ComponentGroupRef Id="MeridianAutomationSetUp" />
</Feature>
<!--<Property Id="TARGETDIR" Value="C:"/>-->
<PropertyRef Id="NETFRAMEWORK45"/>
<Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework 4.5 then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>
<UIRef Id="MyUi"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
<Property Id="WixShellExecTarget" Value="[#MeridianAutomation.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INETPUB">
<Directory Id="INSTALLDIR" Name="MeridianAutomation1" />
</Directory>
</Directory>
</Fragment>
</Wix>
Below is my UI Code :
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WixUI_InstallDir.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_WelcomeDlg
- WixUI_LicenseAgreementDlg
- WixUI_InstallDirDlg
- WixUI_VerifyReadyDlg
- WixUI_DiskCostDlg
Maintenance dialog sequence:
- WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_InstallDirDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="MyUi">
<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="DoAction" Value="LaunchApplication" Order="999">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">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="InstallDirDlg">LicenseAccepted = "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="VerifyReadyDlg" 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="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" 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" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch Meridian Automation" />
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>
However when i change the path , it still installs the application in default installation drive i.e C drive. I am searching this in net throughout but still facing the same issue.

How to remove license dialog from the Wix installer built in UI WixUI_Minimal

For customizing the dialog order I tried to follow the instructions provided in the WixToolSet site (Linkwix recommended steps) but failed to achieve result.
Steps done:
Copied the UI from the source code to a new wxs file.
Changed the id of th UI element
Build the project without any further modification.
The above steps results in following error.
Error 4 Duplicate symbol 'ControlEvent:WelcomeDlg/Next/NewDialog/VerifyReadyDlg/Installed AND PATCH' found. This typically means that an Id is duplicated.
Check to make sure all your identifiers of a given type (File, Component, Feature) are unique.
My intent is to make changed in installui sequence and build the solution but I couldn't proceed.
Try this code
<UI Id="WixUI_InstallDir">
<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">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed
AND PATCH</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="VerifyReadyDlg"
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="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg"
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" />
</UI>
<UIRef Id="WixUI_Common" />
Reference : http://comments.gmane.org/gmane.comp.windows.devel.wix.user/65550
Thanks LeoN.
I have done more experimentation and found a solution.
Steps :
Copied the UI from the source code (WixUI_Minimal.wxs) to product
cont.
Changed the id of the UI element Removed the uisequence element
Modified the UI conditions. Build the project it was working fine.
Modified Code pasted below
<?xml version="1.0" encoding="UTF-8"?>
<UI Id="WixUI_MinimalX">
<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="WelcomeDlg" />
<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="VerifyReadyDlg">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="WixInstallerStudy" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="WixInstallerStudy" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent">
<File Id='Test.Txt' Name='Test.Txt' DiskId='1' Source='.\2.0\Test.txt' KeyPath='yes' DefaultVersion='1.0' Checksum='yes'>
</File>
</Component>
<Component Id="ProductComponent2">
<File Id='TestCopy.txt' Name='Test - Copy.txt' DiskId='1' Source='.\2.0\Test - Copy.txt' KeyPath='yes' >
</File>
</Component>
</ComponentGroup>
</Fragment>
Found that if the ui sequence is there it will give you many unexpected errors.

WiX: Duplicate symbol 'ControlEvent:ExitDialog/Finish/EndDialog/Return/1' found

I have a WiX 3.8 installer Product.wxs that builds correctly in Visual Studio 2010 Professional.
I just wanted to experiment with modifying the steps workflow of the installer, so I added the UI block from this answer just after the Wix/Product/Package XML element:
<UI>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<Property Id="WixUI_Mode" Value="Custom" />
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />
<DialogRef Id="InstallDirDlg"/>
<DialogRef Id="FeaturesDlg" />
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="2"></Publish>
<Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="FeaturesDlg">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="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="ExitDialog" Order="2">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
</UI>
Problem: WiX now fails with this message:
Error 13 Duplicate symbol 'ControlEvent:ExitDialog/Finish/EndDialog/Return/1' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique. C:\MyApp\Installer\Product.wxs 42 1 Installer
Error 14 Location of symbol related to previous error. C:\src\wix38\src\ext\UIExtension\wixlib\WixUI_Minimal.wxs 46 1 Installer
What am I doing wrong?
The problem is that I had another <UI> element later in Product.wxs that I did not remember about.
Removing this second <UI> block solved the problem.

Have to delete installed application folder after uninstallation of application?

I'm new to Wix. using Wix3.0.
I've created one msi which is installed in "C:\Program Files\MyWix\" path and given permission as GenericWrite="yes" for the MyWix folder.
My problem is after uninstalled msi. MyWix folder and contained files are not deleted. Even i can't delete MyWix folder manually. It saying you don't have permission to delete this folder like that.
My code is given below.,
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="b3fd2c4b-7ea3-415f-975a-2f8245c5d862" Name="MyWix" Language="1033" Version="1.0.0.0" Manufacturer="MyWix" UpgradeCode="f0094887-e58c-48f7-bbf1-0e60ad7c66f9">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="MyWix">
<Component Id="test" Guid="">
<File Id="test1" Name="test.docx" Source="D:\RenewDCP.docx" KeyPath="yes"></File>
</Component>
</Directory>
</Directory>
</Directory>
<Component Id="MyWix" Directory="INSTALLLOCATION" Guid="{20D7541C-15A7-4c29-8FDE-14DAF191A959}">
<CreateFolder>
<Permission GenericWrite="yes" User="Everyone"/>
</CreateFolder>
</Component>
<CustomAction Id="InstallSetProp" Property="Install" Value="/installtype=transaction /action=install " />
<CustomAction Id="UnInstallSetProp" Property="Uninstall" Value="/installtype=transaction /action=uninstall" />
<Feature Id="ProductFeature" Title="MyWix" Level="1" ConfigurableDirectory="INSTALLLOCATION">
<!-- TODO: Remove the comments around this ComponentRef element and the Component above in order to add resources to this installer. -->
<!-- <ComponentRef Id="ProductComponent" /> -->
<ComponentRef Id="MyWix"/>
<ComponentRef Id="test"/>
</Feature>
<UIRef Id="WixUI_Common"/>
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="ARPNOMODIFY" Value="1" />
<Property Id="WixAppFolder" Value="WixPerUserFolder" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<WixVariable Id="WixUISupportPerMachine" Value="1" />
<WixVariable Id="WixUISupportPerUser" Value="1" />
<WixVariable Id="WixUIBannerBmp" Value="Images\Banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Images\Dialog.bmp" />
<InstallExecuteSequence>
<LaunchConditions After="AppSearch" />
<Custom Action="InstallSetProp" After="InstallFiles">$MyWix>2</Custom>
<Custom Action="UnInstallSetProp" After="MsiUnpublishAssemblies">$MyWix=2</Custom>
<RemoveExistingProducts After="InstallFinalize" />
<ScheduleReboot After="InstallFinalize" />
</InstallExecuteSequence>
<UI Id="WixUI_Advanced">
<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" />
<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="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallScopeDlg">1</Publish>
<Publish Dialog="InstallScopeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Order="1" Value="{}">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Order="2" Value="1">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="2">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="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" 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>
</UI>
</Product>
</Wix>
plz suggest me.
You'll probably want to ensure that SYSTEM and Administrators can still manipulate the folder. With your code above, the only permission remaining is write. You can try:
<Component Id="MyWix" Directory="INSTALLLOCATION" Guid="{20D7541C-15A7-4c29-8FDE-14DAF191A959}">
<CreateFolder>
<Permission GenericWrite="yes" User="Everyone"/>
<Permission GenericAll="yes" User="SYSTEM"/>
<Permission GenericAll="yes" User="Administrators"/>
</CreateFolder>
</Component>
Use GenericAll instead of GenericWrite, it has full rights on installation folder.
<Permission GenericAll="yes" User="Everyone"/>

Moving Wix <UI> to another file

I am trying to split out my wix file into two separate files. With everything that exists under my <UI> </UI> tag living in this secondary file.
I have googled this quite a bit but I don't seem to be getting any conclusive results.
Has anyone done this successfully?
You can move the <UI> element with its contents to a separate file easily. Just make sure to reference it from the main Product.wxs with <UIRef> element.
In your Wix project add the reference to the WixUIExtension
In your Product.wxs (Main Install file) add a line like this
<UIRef Id="UserInterface"/>
Add the UserInterface.wxs to your project solution and customize the UI of your MSI:
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />
<DialogRef Id="InstallDirDlg"/>
<DialogRef Id="FeaturesDlg" />
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="2"></Publish>
<Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="FeaturesDlg">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="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="ExitDialog" Order="2">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
</UI>
<UIRef Id="WixUI_Common" />
The complete sample of this code can be found at this answer
Look at this link, explains how to create Custom Dialogs
Good luck!