我已经得到了下面这个,但我想改变它的方式,它将Web应用程序安装到现有的网站。目前它安装的网站和所有的文件,但然后卸载也删除所有的文件,我只是希望它作为一个Web应用程序添加文件。我怎么这样做呢?Wix卸载整个网站不仅仅是应用程序
<?xml version="1.0" encoding="utf-8" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<DirectoryRef Id="INSTALLLOCATION">
<Component Id="C_IISWebsite" Guid="{138B3868-24E8-4D7B-8793-0D254AF349D4}" KeyPath="yes">
<!-- This does not create a user, it's just an object that's referenced by the WebAppPool component -->
<util:User Id="WebAppPoolUser" CreateUser="no" Name="[WEB_APP_POOL_IDENTITY_USERNAME]"
Password="[WEB_APP_POOL_IDENTITY_PWD]" Domain="[WEB_APP_POOL_IDENTITY_DOMAIN]"/>
<!-- The "Identity" attritbute below needs to be set to "other" to use the util:User defined above -->
<iis:WebAppPool Id="WebAppPool" Name="[WEB_APP_POOL_NAME]" Identity="other" User="WebAppPoolUser"/>
<iis:WebSite Id="DefaultWebSite" Description="[WEBSITE_NAME]" Directory="INSTALLLOCATION" >
<iis:WebAddress Id="AllUnassigned" Port="80"/>
</iis:WebSite>
<iis:WebVirtualDir Id="My.VirtualDir" Alias="mdxWebSite" Directory="INSTALLLOCATION" WebSite="DefaultWebSite">
<iis:WebApplication Id="Application" Name="mdxWebSite" WebAppPool="WebAppPool" />
</iis:WebVirtualDir>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
这仅仅是通过描述“记住产权”模式的一部分Rob在他的博客中发表:http://robmensching.com/blog/posts/2010/5/2/The-WiX-toolsets-Remember-Property-pattern。当您需要在安装会话之间存储值时(安装/卸载/升级),这是推荐的解决方法, –