0

I have msi setup that was created in installshield and I am executing the DTF custom action dll as a commit custom action. 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.

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?

Edit:

I found out that I can not include the references in .CA.dll by configuring wix.ca.targets. Which prevents .CA.dll to contain 20MB of dlls in my case.

Now I would like to make sure that CustomActionProject.dll will be able to see the references that are installed with the product.

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> 
Marek
  • 486
  • 7
  • 19

2 Answers2

1

Your custom action was programmed in a managed .Net language (probably C# or 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. Following WIX´s naming convention the native custom action dll contains an .CA infix.

In order for this (i.e. 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".

Hille
  • 4,096
  • 2
  • 22
  • 32
  • Thank you for your answer. I can see why the .CA.dll needs to be extracted, but I am worried about all the references that are also copied to the directory. I was wondering if there is a way to extract this dll directly to the [INSTALLDIR] without creating additional folders and copying references. – Marek Sep 03 '14 at 07:21
  • 1
    Assuming with "references" you mean files like "SfxCA.dll", "Microsoft.Deployment.WindowsInstaller.dll" and other dependencies of the managed custom action's dll not provided by .Net; these are temporary files needed during installation. Why put them alongside your application files (living longer)? Or are you talking about "C:\windows\installer" when writing "[INSTALLDIR]? When you write "copying references", do you mean the self extracted files? Did you accidentally pass many (superfluous) files to "makesfxca"? Having trouble to see what you're uncomfortable with. Maybe you can extend Q? – Hille Sep 03 '14 at 10:53
  • I found out that wix.ca.targets is including all the unwanted references(there is about 20 dlls in the project). I can change that. But the .CA.dll file will be extracted to the "C:\Program Files\MyProduct\CustomActionProject.CA.dll-\CustomActionProject.dll". I would like it to be extracted to "C:\Program Files\MyProduct\CustomActionProject.dll". The creation of "CustomActionProject.CA.dll-" directory is unwanted. Many thanks. – Marek Sep 03 '14 at 13:52
1

DTF automatically extracts it's files to a temp folder for execution and then cleans up on disposal. 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.

BTW, make sure you've seen this:

WiX DTF Behavior Alert

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Thank you! I am trying to replace the .NET Custom Actions with this DTF in my InstallShield projects. Our custom actions are calling a lot of application code and the extracting to the subdirectory is making me trouble. The directory is even left there after the uninstall. I've edited the question to target this issue. – Marek Sep 05 '14 at 08:39