dbeukers
Posts: 14
Joined: Tue Oct 27, 2015 12:32 am

Using config file with attached DLL?

I built a dll using the WiX toolset that I would like to use the Call function from attached native DLL option on. However, the Wix toolset includes files built on the 2.0.50727 runtime. I need to build on the 4.0 runtime, but when the dll loads, it loads the 2.0 runtime, then fails to finish loading because it is built on 4.0. A config file would overcome this, but it doesn't appear to come through the attached file process. Is there a solution? I also tried to use temporary files to then Call from installed native DLL, but they don't show up in the list to select from. Am I missing a step? I also moved the temp files to the Application Folder with the other files, but still don't see it.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Using config file with attached DLL?

Hi,

Please read the "Launch attached file (.exe) with dependencies" thread which debates a similar problem.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dbeukers
Posts: 14
Joined: Tue Oct 27, 2015 12:32 am

Re: Using config file with attached DLL?

I have tried including the DLL and config files as temporary files, but when I try to add a Call function from installed native DLL action, the files are not in the list to be selected. I have tried moving them to the Application Folder, but they are still not available. Are the files available for selection only ones that appear within a feature? The temporary files show up in Files and Folders view, but not in Organization view. How can I get these to where I can select the file to run in the custom action?
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Using config file with attached DLL?

Hi,

Indeed, a temporary file cannot be used by the "Call function from installed native DLL" custom action. However, as mentioned in the other thread, you can add only the DLL's dependencies as temporary files, then launch the DLL through the "Call function from attached native DLL" custom action.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dbeukers
Posts: 14
Joined: Tue Oct 27, 2015 12:32 am

Re: Using config file with attached DLL?

As mentioned in the other thread [Launch attached file (.exe) with dependencies], adding the config file as a temporary file and calling an attached file does not work. In order for .NET CLR to recognize the config file it must have the same name as the base file, adding a .config extension: myFile.dll (or .exe) and myFile.dll.config (or .exe.config). When adding the config as a temporary file, this apparently does not happen, as the config file is not recognized. In your response in the other thread, you mentioned adding both files as temporary files and using Launch file, which did work for that instance. I had mistaken that for Launch installed file and tried for something similar with my DLL. Apparently, there is no comparable action available. Is there some other way to call a DLL that will not remain with the installation? Maybe add a feature and somehow delete its files at the end?
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Using config file with attached DLL?

Hi,

Indeed, the "Launch file" custom action does not work for DLL files. So, as a workaround, you can add your files as regular files, launch the DLL using the "Call function from installed native DLL" custom action, then add a new custom action (i.e. BAT file) that will remove the DLL and its dependencies from the machine.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
angusmf
Posts: 9
Joined: Wed Dec 16, 2015 5:54 pm

Re: Using config file with attached DLL?

Eusebiu wrote:Hi,

Indeed, the "Launch file" custom action does not work for DLL files.
So in order to get the "convenience" of the wix custom actions in a dll, we're forced to write cleanup custom actions? Some of the limitations in AI are just baffling. It's a great product right up until you cripple vital functionality like this.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Using config file with attached DLL?

Hi,

I added this improvement on our TODO list and it will be available in a future version of Advanced Installer. Thank you for your suggestion.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”