Reputation: 3826
I am using wix to create my msi installer. the installer will create a new app pool and virtual directory in the IIS to run my web app.
Right now, I am trying to have multiple instance of the web app on the same machine at the same time(either same version, or higher version).
-Is such thing supported in Wix?
-Can I dynamically create multiple app pool and virtual directory on each installation? Because at the moment the name of the appPool, and Virtual directory and destination folder are hard coded inside the Product.WXS file.
Upvotes: 0
Views: 755
Reputation: 1216
I think that you can't even perform setup multiple times, it will just try to uninstall, modify or repair your previous installation or to perform upgrade. But regarding app pool or website name you can specify it in installation process in your feature selection dialog, to have textbox where you can write down name of website or app pool
<Control Id="WebsiteName" Type="Text" X="..." Y="..." Width="..." Height="..." Text="Website name :" Indirect="no" >
<Condition Action="hide">Installed</Condition>
</Control>
<Control Id="WebsiteName" Type="Edit" X="..." Y="..." Width="..." Height="..." Property="WEBSITENAME" Text="{50}" Indirect="no" >
<Condition Action="hide">Installed</Condition>
</Control>
Than you need to specify your property at Product.wxs
<Property Id="WEBSITENAME" Value="YourDefaultWebSiteName" Secure="yes">
<RegistrySearch Id="FindWebSiteName" Root="HKCU"
Key="SOFTWARE\YourCompany\YourProduct"
Name="WebsiteName" Type="raw"/>
</Property>
<Property Id="APPPOOL" Value="0" Secure="yes">
<RegistrySearch Id="FindWixSetupInstallation" Root="HKCU"
Key="SOFTWARE\YourCompany\YourProduct"
Name="webAppPool" Type="raw"/>
</Property>
Than you need to specify it at your settings where you create app pool and website name
<iis:WebSite Id="DefaultWebSite" Description="Default Web Site">
<iis:WebAddress Id="AllUnassigned" Port="80" />
</iis:WebSite>
<DirectoryRef Id="YourDirectory" >
<Component Id="CMP_CONFIG" Guid="{YOURGUID}" KeyPath="yes">
<iis:WebVirtualDir Id="WebsiteName" Alias="[WEBSITENAME]" Directory="YourDirectory" WebSite="DefaultWebSite">
<iis:WebApplication Id="YourApplicationApp" Name="[WEBSITENAME]" WebAppPool="[WEBSITENAME]" />
<iis:WebDirProperties Id="YourApplicationDirProp" Script="yes" Execute="yes" Read ="yes" DefaultDocuments="Default.aspx"/>
</iis:WebVirtualDir>
</Component>
</DirectoryRef>
And if you want to create shortcut to desktop
<DirectoryRef Id="DesktopFolder">
<Component Id="YourWebsiteAppDesktopShortcut" Guid="{YOURGUID}">
<RegistryValue Root="HKCU"
Key="SOFTWARE\YourCompany\YourProduct"
Name="YourWebsiteApp"
Type="integer"
Value="1"
KeyPath="yes"/>
<util:InternetShortcut Id="WebSiteDesktopShortcut"
Directory="DesktopFolder"
Name="YourWebsiteAppName"
Target="http://localhost/[WEBSITENAME]/"
Type="url" />
</Component>
</DirectoryRef>
And you just need to register all those component reference ID's in your Product.wxs
Upvotes: 1