ksmith93
Posts: 10
Joined: Wed Sep 13, 2006 5:14 pm

Execute a Custom Action (EXE or DLL) that Has Dependency?

Hi,

I would like to launch a custom action, MyFoo.exe. However, MyFoo.exe has a few dependencies, such as MyBar.dll and MyBaz.dll. MyBar.dll and MyBaz.dll must be present in the same working directory as MyFoo.exe in order for MyFoo.exe to execute. These dependencies cannot reside elsewhere in the PATH.

MyFoo.exe, MyBar.dll, and MyBaz.dll are not required for my software to run once it is installed, they are only required before/during an actual installation of my software. Because these files are not required by the actual end-software, I would like to execute MyFoo.exe as a custom action, without really deploying it as a normal file that is part of the actual installation.

An additional requirement that I have is to execute MyFoo.exe as early as possible in the install sequence. That is, before files are copied to the destination machine, etc.

Essentially, I think I need a "Add Attached Custom Action" -- but in this case the custom action in question, MyFoo.exe, has a few dependencies.

How can I execute a custom action, early in the install sequence, if it has some dependencies?

Thank you.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You can add those files (MyFoo.exe,MyBar.dll and MyBaz.dll) as temporary files in the "Files and Folders" page.

You can read more about temporary files here:
http://www.advancedinstaller.com/user-g ... files.html

To execute the MyFoo.exe you can use an "EXE With Working Dir" type of custom action. The requirement is to schedule it after "CostFinalize" standard action because temp files are not available before this stage.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
ndoran
Posts: 13
Joined: Thu May 03, 2018 11:48 pm

Re: Execute a Custom Action (EXE or DLL) that Has Dependency?

This looks a lot like what I'm trying to do. Can this be done with a DLL that has dependencies on other DLLs?

Also, the sample below looks very helpful, but when I open the attached aip, there are no custom actions. That's the part of the example I would like to see. I am using v14.1.1.

https://www.advancedinstaller.com/examp ... dation.zip
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Execute a Custom Action (EXE or DLL) that Has Dependency?

Hello,

Yes, I think this can be achievable. For instance, you can place all your .DLL files in the same directory (not added as temporary files) and then you can use a "Call function from installed native DLL" which must be schedule after the "Add resources" action group (because during the "Add resources" action group, the files are copied on the target machine).

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”