Wix“未定义的预处理程序变量” [英] Wix 'undefined preprocessor variable'

查看:94
本文介绍了Wix“未定义的预处理程序变量”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过这样的问题,但它们似乎对我没有帮助。

I have seen questions like this, but they seem to not help me.

我正在测试Web应用程序。

I am playing with a test web application.

我将此添加到了RStp.wixproj中,我很难过,但是它可以正常工作,它会生成Frags.wxs:

I added this into my RStp.wixproj, I had a hard time, but it works, it generates the Frags.wxs:

<Target Name="BeforeBuild">
    <Exec Command=" &quot;$(WiX)bin\heat.exe&quot; project &quot;..\WebR\WebR.csproj&quot; -cg Portals.Vendor -gg -pog Binaries -pog Content –configuration &quot;release&quot; -platform &quot;AnyCPU&quot; –out &quot;Frags.wxs&quot; " />
    <ItemGroup>
      <Compile Include="Frags.wxs" />
    </ItemGroup>
  </Target>

我的Frags.wxs看起来像这样:

My Frags.wxs looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="WebR.Binaries" />
    </Fragment>
    <Fragment>
        <ComponentGroup Id="WebR.Binaries">
            <ComponentRef Id="cmp7AE3B693619BAD570BB795DC740F74CA" />
        </ComponentGroup>
    </Fragment>
    <Fragment>
        <DirectoryRef Id="WebR.Content">
            <Directory Id="dirBB5AA78A6132241A7A39F7899E66D36C" Name="Fold" />
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="WebR.Content">
            <ComponentRef Id="cmp434BA57B5F42786DB41F7D30B9C8A2AA" />
            <ComponentRef Id="cmp827A8854133966F2160835E612413FA7" />
            <ComponentRef Id="cmpF279DD78D3B3BE5386C8535E2A85FC5F" />
        </ComponentGroup>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="Portals.Vendor">
            <Component Id="cmp7AE3B693619BAD570BB795DC740F74CA" Directory="WebR.Binaries" Guid="{9F6BEFC1-6226-4C1D-A1B0-1C7D6355DB60}">
                <File Id="filB23D27862A7D96131D5E2F7C7CCCAA8B" Source="$(var.WebR.TargetDir)\WebR.dll" />
            </Component>
            <Component Id="cmp434BA57B5F42786DB41F7D30B9C8A2AA" Directory="WebR.Content" Guid="{F0733DE8-9B04-4F65-ABA3-954B71E6CC00}">
                <File Id="fil85B5BB89317EA74AFB68409ADF6BA4C7" Source="$(var.WebR.ProjectDir)\Default.aspx" />
            </Component>
            <Component Id="cmp827A8854133966F2160835E612413FA7" Directory="WebR.Content" Guid="{ADF5B995-9002-469F-BA2F-9A88621DAF13}">
                <File Id="filFD9C307A451419BA8B1308C1786045D2" Source="$(var.WebR.ProjectDir)\Web.config" />
            </Component>
            <Component Id="cmpF279DD78D3B3BE5386C8535E2A85FC5F" Directory="dirBB5AA78A6132241A7A39F7899E66D36C" Guid="{8BFCFDD6-E995-482D-9AA3-4EE8926E9CB0}">
                <File Id="filB2AF43969CEF48A8A2E362F2D8E5DD20" Source="$(var.WebR.ProjectDir)\Fold\F2.aspx" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

我尚未对Product.wxs进行任何更改:

I have not yet made any changes to the Product.wxs:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="RStp" Language="1033" Version="1.0.0.0" Manufacturer="Prive" UpgradeCode="cfbe56e5-e27a-42c3-af88-262956974943">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate />

        <Feature Id="ProductFeature" Title="RStp" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="RStp" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
            <!-- <Component Id="ProductComponent"> -->
                <!-- TODO: Insert files, registry keys, and other resources here. -->
            <!-- </Component> -->
        </ComponentGroup>
    </Fragment>
</Wix>




  1. 要使ARFacade位于碎片内部,我该怎么办.wxs?

  2. 如何将Frags.wxs链接到Product.wxs?

  3. 如何修复错误未定义的预处理变量 $(var.WebR.TargetDir)'更新右键单击RStp,添加引用,选择Web prj-固定

  4. 我必须在哪里添加Candle代码(RStp.wixproj喜欢加热吗?)那应该是什么样子?

  5. 如果这是出于对源安全的考虑,我是否应该将Frags.wxs包括在源中?

  6. 我需要有一个特定的安装路径,如下所示:'E:\Inetpub\wwwroot',我该如何设置?

  1. What do I have to do to have the A.R.Facade inside the Frags.wxs ?
  2. How do I link the Frags.wxs into the Product.wxs?
  3. How do I fix the Error 'Undefined preprocessor variable '$(var.WebR.TargetDir)' UPDATE Right Click on RStp, add reference, select Web prj - fixed
  4. Where do I have to add the Candle code (RStp.wixproj like for heat?) and what should that look like?
  5. If this would be on sourcesafe, should I include the Frags.wxs into the sources?
  6. I need to have a specific install path that looks like this: 'E:\Inetpub\wwwroot', how can I set this up?

谢谢

推荐答案

1。)您需要引用其中的Components / ComponentGroups您的功能

1.) You'll need to reference the Components/ComponentGroups inside your feature

    <Feature Id="ProductFeature" Title="RStp" Level="1">
        <ComponentGroupRef Id="Portals.Vendor" />
        <ComponentGroupRef Id="WebR.Content" />
        <ComponentGroupRef Id="WebR.Binaries" />
    </Feature>

2。)在WiX中没有传统意义上的链接。您的所有组件都可以从该项目中的其他WiX文件中引用。

2.) There's no linking in the traditional sense in WiX. All of your components can be referenced from other WiX files in that project.

3。)在构建选项卡下的RStp的项目属性中,您可以将WebR.TargetDir定义为是在上启动热量的目录路径

3.) In your Project Properties of RStp under the Build tab you can define WebR.TargetDir to be the directory path that heat is being launched on

4。)由于您已经在使用Visual Studio,为什么不让它处理编译?

4.) Since you are already using Visual Studio why not just let it handle compiling?

5。)由于Frags.xml每次都会生成,因此我不会将其添加到Source Safe,因为它需要锁定文件才能对其进行编辑。我们使用SVN并添加了autogen文件,因为我们发现在进行安装时查看已添加或删除的文件很有用。

5.) Since Frags.xml will be generated every time I would not add it to Source Safe where it would need to lock the file to edit it. We use SVN and have added the autogen files as we've found it useful when working on the installs to see files that have been added or removed.

6。)看看

这篇关于Wix“未定义的预处理程序变量”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆