我已經得到了下面這個,但我想改變它的方式,它將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。當您需要在安裝會話之間存儲值時(安裝/卸載/升級),這是推薦的解決方法, –