WIX 3.6インストーラ - Visual Studio 2010(HeatDirectory)
-
11-12-2019 - |
質問
WebサービスのWIX 3.6インストーラに取り組んでいます。しかし、私は必要な出力をすべて収穫するためにヒートディレクトリを使用しようと試みるときに問題に遭遇し、私が試していても私が収集されたすべてのファイルに対して次のエラーを得ています:
システムはファイル 'sourcedir \ manes.dll ...' を見つけることができません。
wcfservice.wxsでエラーが発生します。奇妙な部分は、wcfservice.wxsが私のプロジェクトファイルのHeatDirectoryセクションによって自動的に作成されることです(下記)。 最初の場所でwcfservice.wxsを作成する場所を知る必要がある場合は、これらの.dllが見つからない場合はどうやって吹き飛ばされますか?ダウンロードしてビルドすると、これらのエラーも発生します。 WIXの例プロジェクト(AS-IS)は、私が読んだチュートリアルのいずれかから。
目標:できるだけ多くの.dll包含を自動化する(すなわち、依存プロジェクトなどを扱うために収穫を利用する)
私は勝つ7 64bitとプロジェクトは.NET 4です。
product.wxs:
.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="CompleteInstall" Language="1033" Version="1.0.0.0" Manufacturer="Technologies" UpgradeCode="b2ae6aa5-263f-4f9a-a250-8599a7f2cb03">
<Package InstallerVersion="200" Compressed="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="CommonDir1" Name="Common Directory 1">
<Directory Id="CommonDir2" Name="Common Directory 2">
<Directory Id="INSTALLFOLDER" Name="Install Directory"/>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="CompleteInstall" Level="1">
<ComponentGroupRef Id="WcfService_Project" />
</Feature>
<Property Id="WIXUI_INSTALLDIR">INSTALLFOLDER</Property>
<UIRef Id="WixUI_InstallDir" />
</Product>
</Wix>
プロジェクトファイル:
.
<Target Name="BeforeBuild">
<MSBuild Projects="%(ProjectReference.FullPath)" Targets="Build" Properties="Configuration=$(Configuration);Platform=x86" Condition="'%(ProjectReference.ContentProject)'=='True'" />
<PropertyGroup>
<LinkerBaseInputPaths>%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Platform)\$(Configuration)\</LinkerBaseInputPaths>
</PropertyGroup>
<HeatDirectory OutputFile="%(ProjectReference.Filename)-temp.xml"
Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Platform)\$(Configuration)\"
DirectoryRefId="INSTALLFOLDER"
ComponentGroupName="%(ProjectReference.Filename)_Project"
SuppressCom="true"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true"
AutoGenerateGuids="false"
GenerateGuidsNow="true"
ToolPath="$(WixToolPath)"
Condition="'%(ProjectReference.ContentProject)'=='True'" />
<XslTransformation XmlInputPaths="%(ProjectReference.Filename)-temp.xml"
XslInputPath="XslTransform.xslt"
OutputPaths="%(ProjectReference.Filename).wxs"
Condition="'%(ProjectReference.ContentProject)'=='True'" />
</Target>
wcfservice.wxs:
.<?xml version="1.0" encoding="utf-8"?><Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="cmpE6EBA3D8D6D4DB0C93E73200C78DCC51" Guid="{C88B5CF9-8807-45DF-AA6F-732437B74BB6}">
<File Id="fil0118BBA61671E80581CA9C9AA6DD3E8D" KeyPath="yes" Source="SourceDir\Some.dll" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WcfService_Project">
<ComponentRef Id="cmpE6EBA3D8D6D4DB0C93E73200C78DCC51" />
</ComponentGroup>
</Fragment>
</Wix>
解決
問題は、ヒートディレクトリ前処理前の特性がないことであった。私のwixprojファイルへの以下の追加に関する問題を修正しました:
<PropertyGroup>
<DefineConstants>BasePath=%(ProjectReference.RootDir)%(ProjectReference.Directory);</DefineConstants>
</PropertyGroup>
<HeatDirectory OutputFile="%(ProjectReference.Filename).wxs"
DirectoryRefId="INSTALLFOLDER"
Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)"
ComponentGroupName="%(ProjectReference.Filename)_Project"
SuppressCom="true"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true"
AutoGenerateGuids="false"
GenerateGuidsNow="true"
ToolPath="$(WixToolPath)"
Condition="'%(ProjectReference.ContentProject)'=='True'"
PreprocessorVariable="var.BasePath"/>
.
あなたが見ることができるように、私は最初にローカル使用のために定数変数を定義する必要がありました。私のWCFプロジェクトのルートパスに等しい変数を設定します。第二に、私は私のプリプロセッサの変数として変数を使用しました。最後に、MSBuildから生成されたファイルを動的に/再帰的に収集することができます。次のステップ:不要なファイルを除外します。この>リンク
私の完全なWixProjの下の見直し:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.5</ProductVersion>
<ProjectGuid>{4005592f-cc0e-41a3-8e64-33b2824e7fd9}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>MyWCF.WCF.Webservice</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="MyWCF.WcfService.wxs" />
<Compile Include="IISConfig.wxs" />
<Compile Include="InstallUi.wxs" />
<Compile Include="Product.wxs" />
<Compile Include="UIDialogs.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyWCF.WcfService\MyWCF.WcfService.csproj">
<Name>MyWCF.WcfService</Name>
<Project>{8e528b38-2826-4793-a66d-f6ff181e1139}</Project>
<Private>True</Private>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
<ContentProject>True</ContentProject>
<DoNotHarvest>True</DoNotHarvest>
<PackageThisProject>True</PackageThisProject>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixIIsExtension">
<HintPath>$(WixExtDir)\WixIIsExtension.dll</HintPath>
<Name>WixIIsExtension</Name>
</WixExtension>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<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="ConfigurationInitialize.wxi" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<PropertyGroup>
<PreBuildEvent />
</PropertyGroup>
<Target Name="BeforeBuild">
<MSBuild Projects="%(ProjectReference.FullPath)" Targets="Package" Properties="Configuration=$(Configuration);Platform=$(Platform)" Condition="'%(ProjectReference.PackageThisProject)'=='True'" />
<PropertyGroup>
<DefineConstants>BasePath=%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Platform)\$(Configuration)\Package\PackageTmp\</DefineConstants>
</PropertyGroup>
<HeatDirectory OutputFile="%(ProjectReference.Filename).wxs"
Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Platform)\$(Configuration)\Package\PackageTmp"
DirectoryRefId="INSTALLFOLDER"
ComponentGroupName="%(ProjectReference.Filename)_Project"
SuppressCom="true"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true"
AutoGenerateGuids="false"
GenerateGuidsNow="true"
ToolPath="$(WixToolPath)" Condition="'%(ProjectReference.PackageThisProject)'=='True'"
PreprocessorVariable="var.BasePath" />
</Target>
</Project>
. 他のヒント
私がwixを使って基本的なウェブサイトの設定から私たちのプロダクションの1つに引っ越したときに私はあなたに似ていました。
次のように述べています例例
次のページのコメントを検討したら - http://blogs.planetsoftware.com.au/paul/archive/2011/02/20/creating-a-web-application-installer -with-wix-3.5-and-Visual.aspx
更新:を置く場合
<PropertyGroup>
<DefineConstants Condition="'%(ProjectReference.WebProject)'=='True'">
%(ProjectReference.Name).PackageDir=%(ProjectReference.RootDir)
%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\
</DefineConstants>
.
と追加:
PreprocessorVariable="var.%(ProjectReference.Name).PackageDir"
.
これは私の評判を低下させるつもりですが、私が興味深いものは http://www.paraesthesia.com サイト、私は1つのプロジェクトのために働いていましたが、別のプロジェクトを試してみると
出力を見た後、それは熱とろうそくのために適切なプロジェクトを取りますが、光はランダムに1つを取るように見えました。 2つのプロジェクトを比較した後、私はワーキングプロジェクトに最後のプロジェクトがリストされたプロジェクトを収穫することに気づいた。 .wixprojファイルのプロジェクトを最後の参照に移動したとき、それは機能しました。
現時点で3.5.2519をご利用いただきます。私はそれが古いものであることを知っていますが、私たちは、私たちには実際にはvisual studioで収穫を必要とし、実際に収穫するプロジェクトがあります。
だからあなたのwcfservice.wxsには:
<File Id="fil0118BBA61671E80581CA9C9AA6DD3E8D" KeyPath="yes" Source="SourceDir\Some.dll" />
.
これはSourceDir\Some.dll
です。このファイルは、プロジェクトをコンパイルするPCに存在する必要があります。あなたはおそらく道を変更する必要があるでしょう。