简体   繁体   English

DTF正在复制自定义操作dll文件

[英]DTF is copying custom action dll files

I have msi setup that was created in installshield and I am executing the DTF custom action dll as a commit custom action. 我有在installshield中创建的msi安装程序,并且正在执行DTF自定义操作dll作为提交自定义操作。 If I insert MessageBox.Show into the custom action, I can see that there is a temporary folder inside [PROGRAMFILESDIR] called "CustomActionProject.CA.dll-" and there is copied CustomActionProject.CA.dll with all its references. 如果将MessageBox.Show插入到自定义动作中,则可以看到[PROGRAMFILESDIR]中有一个名为“ CustomActionProject.CA.dll-”的临时文件夹,并且复制了CustomActionProject.CA.dll及其所有引用。

Is there any way to tell the technology not to create this temp folder and extract+execute the CustomActionProject.CA.dll in the same folder where is .CA.dll located? 是否有任何方法告诉技术不要创建此临时文件夹并在.CA.dll所在的同一文件夹中提取并执行CustomActionProject.CA.dll?

Edit: 编辑:

I found out that I can not include the references in .CA.dll by configuring wix.ca.targets. 我发现我无法通过配置wix.ca.targets将引用包含在.CA.dll中。 Which prevents .CA.dll to contain 20MB of dlls in my case. 在我的情况下,这可以防止.CA.dll包含20MB的dll。

Now I would like to make sure that CustomActionProject.dll will be able to see the references that are installed with the product. 现在,我想确保CustomActionProject.dll将能够看到与产品一起安装的引用。

The files are: 这些文件是:

<ProgramFilesFolder>
  <MyApplicationFolder>
    CustomActionProject.CA.dll
    ... About 30 dlls installed with the application that CustomActionProject.dll needs to call
    <Place I Would Like to See CustomActionProject.dll extracted> 

Your custom action was programmed in a managed .Net language (probably C# or VB.Net). 您的自定义操作是使用托管的.Net语言(可能是C#或VB.Net)进行编程的。 As msi files may only contain dll custom actions comprised of native code the DTF tools, specifically the tool makesfxca.exe , packs / wraps the managed dll together with helper code resulting in a self extracting, native code dll. 由于msi文件可能仅包含由本机代码组成的dll自定义操作,因此DTF工具(特别是工具makesfxca.exe将托管的dll与帮助程序代码一起打包/包装在一起,从而导致自我提取的本机代码dll。 Following WIX´s naming convention the native custom action dll contains an .CA infix. 按照WIX的命名约定,本机自定义操作dll包含一个.CA前缀。

In order for this (ie having custom actions written in languages producing managed code) to work, self extraction has to take place. 为了使其正常工作(即,用生成托管代码的语言编写自定义操作),必须进行自我提取。 So the short answer to your question is " No ". 因此,对您的问题的简短回答是“ ”。

DTF automatically extracts it's files to a temp folder for execution and then cleans up on disposal. DTF会自动将其文件提取到temp文件夹中以供执行,然后进行清理。 This is very good in that it eliminates certain race conditions. 这非常好,因为它消除了某些比赛条件。 You can still author those files into your installer if you like. 如果愿意,您仍然可以将这些文件创作到安装程序中。 For example, at a previous company, our installer used several DLL's for license checking during the install and installed them for use by the application at runtime. 例如,在以前的公司中,我们的安装程序在安装过程中使用了多个DLL进行许可证检查,并安装了它们以供应用程序在运行时使用。

BTW, make sure you've seen this: 顺便说一句,请确保您已经看到以下内容:

WiX DTF Behavior Alert WiX DTF行为警报

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM