WiX インストーラーとカスタム アクション プロジェクトがあります。カスタムアクションのプロジェクトへの参照として C# ライブラリを追加しました。この C# dll は、1 つの C++ dll に対して DllImport を使用します。インストール時に次のエラーが表示されます: DLL をロードできませんmycpp.dll: 指定されたモジュールが見つかりません。CA プロジェクトに追加mycpp.dllし、プロパティを使用してみました: 埋め込みリソース、出力ディレクトリにコピー - しかし、結果はありません。インストーラーを見つけさせるにはどうすればよいmycpp.dllですか?
1 に答える
2
私は以前にこの問題を抱えていました。wix の MSBuild ファイルを読んだ後、最終的にカスタム アクション dll を含む自己解凍型パッケージに必要な dll のリストとして使用されるプロパティを見つけました。
wix.ca.targets (sdk フォルダー内) には、makesfxca の実行時に使用される CustomActionContents というプロパティがあります。
カスタム アクション dll をパッケージ化するこの一連の msbuild ターゲットのコメントは次のとおりです。
<!--
==================================================================================================
PackCustomAction
Creates an MSI managed custom action package that includes the custom action assembly,
local assembly dependencies, and project content files.
[IN]
@(IntermediateAssembly) - Managed custom action assembly.
@(Content) - Project items of type Content will be included in the package.
$(CustomActionContents) - Optional space-delimited list of additional files to include.
[OUT]
$(IntermediateOutputPath)$(TargetCAFileName) - Managed custom action package with unmanaged stub.
==================================================================================================
-->
と
<!--
Items to include in the CA package:
- Reference assemblies marked CopyLocal
- Project items of type Content
- Additional items in the CustomActionContents property
-->
したがって、mycpp.dll への参照をコピー ローカルとしてマークすると、自動的に取得されるか、パスを含むカスタム アクション プロジェクトに新しいプロパティを追加できます (おそらく csproj を編集してプロパティを追加します)。 dll に追加すると、取得されます。
于 2016-10-11T15:16:54.717 に答える