WIX安装程序:从Web删除文件会导致"The system cannot find the file '..'"



所以我正在尝试生成一个动态安装程序,它从发布的web项目中获取所有文件(到WebComponents.wxs中(。它已经运行良好,但一旦我从Web.csproj中删除一个文件,它就会与生成的WebComponents.wxs混淆。因此,我目前的设置是:在构建Installer.wixproj时,它还构建Web.csproj,后者为安装程序发布自己。添加新文件工作正常。

以下是Installer.wixproj:的一部分

<PropertyGroup>
  <WebSiteSource>..Web</WebSiteSource>
  <ReleaseWebConfig>Web_setup.config</ReleaseWebConfig>
  <PublishFolderName>app.publish</PublishFolderName>
  <PublishFolder>..Webbin$(PublishFolderName)</PublishFolder>
  <MsiOut>D:MA01.ATOURsrcInstallerbinReleaseVieTour.msi</MsiOut>
  <WebSiteContentCode>WebComponents.wxs</WebSiteContentCode>
  <WebSiteContentObject>WebComponents.wixobj</WebSiteContentObject>
  <WixPath>C:Program Files (x86)WiX Toolset v3.11bin</WixPath>
</PropertyGroup>
<ItemGroup>
  <WixCode Include="$(WebSiteContentCode)" />
</ItemGroup>
<Target Name="CreateInstaller" AfterTargets="Build">
  <Exec Command="&quot;$(WixPath)heat&quot; dir $(PublishFolderName) -dr dirVieTour -ke -srd -cg WebComponents -var var.publishDir -gg -out $(WebSiteContentCode)" ContinueOnError="false" WorkingDirectory="." />
  <Exec Command="&quot;$(WixPath)candle&quot; -ext WixIISExtension -ext WixUtilExtension -ext WiXNetFxExtension -dpublishDir=$(PublishFolderName) -dMyWebResourceDir=. @(WixCode, ' ')" ContinueOnError="false" WorkingDirectory="." />
</Target>

生成的WebComponents.wxs看起来像这样:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="directoryXY">
            <Directory Id="dirEA772C6FDF885BD02D519055C6A5F7D4" Name="bin" />
            <Directory Id="dir9C6C7F6C7D56234126D1F3268C213149" Name="JavaScript" />
            <Directory Id="dir1CD7F397F22159CC91531C851F168C0A" Name="Properties" />
            <Directory Id="dir08FBA1551757E5AA339492A08A61A382" Name="Views" />
            <Directory Id="dirCB77DB5DBF1C1B2953DA0699797F08FC" Name="wwwroot" />
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="WebComponents">
            <Component Id="cmp2DE1A50D21FA3CFD8D4260FD2285BA4D" Directory="dirVieTour" Guid="{50A1AAC7-F3FC-4A20-9784-B6F24214B4AA}">
                <File Id="fil989DA2FC3E666A81C52CD089644582AF" KeyPath="yes" Source="$(var.publishDir)favicon.ico" />
            </Component>
            <Component Id="cmp1F31A992017C2787A7EDBD35AF00D862" Directory="dirVieTour" Guid="{0AFAC57B-01A2-404D-966D-524FBD0557B2}">
                <File Id="filF20D2F7FF3255C45551F52F87F2E6D40" KeyPath="yes" Source="$(var.publishDir)Global.asax" />
            </Component>
...

Product.wxs中,我引用了WebComponents:

<Feature Id="ProductFeature" Title="$(var.ProductName)" Level="1">
  <ComponentGroupRef Id="WebComponents" />
</Feature>

当我从Web.csproj中删除一个文件并尝试构建安装程序我得到以下错误消息:

The system cannot find the file 'app.publishFileThatGotDdeleted'

有人知道如何在WIX中处理这个问题吗?提前感谢!

删除文件后,您不需要简单地重新发布web项目吗?也就是说,你似乎从发布的文件中输入wix。

相关内容

最新更新