我是專案檔案的新手,今天正在做一些調查,試圖了解使用 VS2019 WiX 專案模板自動生成的 .wixproj 檔案。我能夠理解其中的大部分內容,但我被困在一個小問題上。$(WixTargetsPath) 屬性在哪里設定?在這一點上,我可能已經無緣無故地浪費了很多時間試圖弄清楚這一點,但我現在很好奇!我閱讀了在 proj 檔案中設定屬性的所有不同方式,但我無法在任何地方找到變數定義。這是我的 .wixproj 檔案:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>TestGUID-1234</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>MySetup</OutputName>
<OutputType>Package</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="MainComponents.wxs" />
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyOtherProj\MyOtherProj.csproj">
<Name>MyOtherProj</Name>
<Project>TestGUID-1234/Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
<WixExtension Include="WixNetFxExtension">
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
<Name>WixNetFxExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="TestLicense.rtf" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
我檢查了環境變數,但沒有找到任何東西。我閱讀了 .props 檔案,但不知道 wix.props 檔案將包含在何處。它使用 msbuild 構建,所以我知道它已設定,但除了修改 msbuild.exe 以包含其他默認屬性的 wix 安裝程式之外,我不知道此屬性的設定位置。
uj5u.com熱心網友回復:
它沒有。這
Condition=" '$(WixTargetsPath)' != '' "
確保Import如果只是嘗試的設定。
如果您想指向不MSBuildExtensionsPath32在下一行使用的路徑中的wix.targets 檔案,則該行存在。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/364648.html
上一篇:如何顯示結果中的資料來自哪個表
