我正在使用wix创建我的msi安装程序。安装程序将在IIS中创建一个新的应用程序池和虚拟目录来运行我的web应用程序。
现在,我正试图在同一台机器上同时拥有多个web应用实例(或者相同版本,或者更高版本)。
-Is在Wix中支持这样的东西?
-Can i在每次安装时动态创建多个应用程序池和虚拟目录?因为目前appPool、虚拟目录和目标文件夹的名称在Product.WXS文件中都是硬编码的。
发布于 2016-04-07 13:44:17
我认为您甚至不能多次执行安装程序,它只会尝试卸载、修改或修复以前的安装或执行升级。但是关于应用程序池或网站名称,您可以在安装过程中在功能选择对话框中指定它,以便在文本框中写下网站或应用程序池的名称。
<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> ,而不是需要在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>而不是在创建应用程序池和网站名称的设置中指定它。
<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>如果您想要创建桌面的快捷方式
<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>您只需要在您的Product.wxs中注册所有组件引用ID
https://stackoverflow.com/questions/36420021
复制相似问题