2

これを以下に示しますが、Web アプリケーションを既存の Web サイトにインストールするように変更したいと考えています。現在、Web サイトとすべてのファイルをインストールしますが、アンインストール時にすべてのファイルも削除します。ファイルを Web アプリケーションとして追加したいだけです。どうすればこれを行うことができますか?

<?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>
4

2 に答える 2

2

あなたの問題は、インストーラーが何をアンインストールするかわからないことに関係しているため、デフォルトまたは親の Web サイトが削除されていると思います。John Robbins によるこのサンプルを見てください。重要なのは、構成をレジストリに保存することです。これにより、アンインストールが何を削除するかを知ることができます。<Component> ... </Compoonent>要素内で次のことを行う必要があります。適切な名前/データを挿入することを忘れないでください。ガイド。

<!--The component for installer properties I need to save so they can be used on the uninstall.-->
<Component Id="SetupRegistryValues" Guid="{...}" KeyPath="yes" >
<RegistryValue Root="HKLM" Key="SOFTWARE\CompanyName\ProductName\Install" Name="WebAppName" Value="[WEB_APP_NAME]" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\CompanyName\ProductName\Install" Name="WebSiteName" Value="[WEBSITE_NAME]" Type="string" />
于 2012-11-16T15:48:53.467 に答える
1

Webアプリケーションと仮想ディレクトリを既存のWebサイトにインストールし、製品のアンインストール中にWebサイトを削除したくない場合。次に、別のフラグメント(コンポーネント内ではない)の下にWebサイトを定義します。以下のように:

  <Fragment>
    <iis:WebSite Id="XYZ_WebSite" Description="Default Web Site">
      <iis:WebAddress Id="AllUnassigned" Port="80" />
    </iis:WebSite>
  </Fragment>

次に、以下のように、Webアプリケーション\ Vdirをデプロイするコンポーネントを定義し、ノードからこのサイトIDを参照します。

<iis:WebVirtualDir Id="XYZ_VirtualDirectory_A" Alias="MyXYZ_V_ DIR" Directory="[MYDIR]" WebSite="XYZ_WebSite">
于 2012-12-19T07:55:47.970 に答える