I have created a web setup msi for installing a website to iis. In product.wxs I have set the directory to WWWROOT
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id="IISROOT" Name='WebDir'>
<Directory Id='INSTALLDIR' Name='MyWebSetup'></Directory>
</Directory>
</Directory>
During installation the user can provide desired name for virtual directory. If the user is entering any other name other than 'MyWebSetup' say 'MyWebSetup1', then in the IIS a virtual directory named 'MyWebSetup1' and a directory named 'MyWebSetup' gets listed. Now what I want is I need to get Name='MyWebSetup' with user entered name say 'MyWebSetup1'. I have tried using custom actions and many other to get this done, but was of no use. Please somebody can provide me with a very clear solution as I am new to Wix. Any helps appreciated. Thank you.
I could solve this issue by passing the name of installdir with '.' and then using setdirectory to dynamically set the name of the installdir. While compiling, if the name is passed as '.' then the compiler just ignores it for the mean time and then if we pass the installdir name later then that name will be set.
The installdir name should be passed as follows
The setdirectory is passed as follows. [VIRTUALDIR] is the name of virtual directory accepted from user while installation.
Hope it helps somebody.