We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

make own "TestODBCConnection"

I want to make an own CustomAction, that is to be included like the "TestODBCConnection". This CustomAction should test the connection to a required service and the working of the entered credentials.

So I made a sample CustomAction, and added the dll as "Call Function From Attached Native DLL" call.

Now I have these two hurdles to take:

-> The CustomAction is referencing another DLL, which is not available on all target systems (which is why I have it in my install package). How can I get the CustomAction to use the DLL from the installer package? Or can I embed the DLL in my CustomAction DLL in any way?

-> I can't add the CustomAction to the "Published Events" list of a Dialog's "Next" button, because it is not in the dropdown list. How can I get the CustomAction to show in the dropdown menu?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: make own "TestODBCConnection"

Hello,
-> The CustomAction is referencing another DLL, which is not available on all target systems (which is why I have it in my install package). How can I get the CustomAction to use the DLL from the installer package? Or can I embed the DLL in my CustomAction DLL in any way?
In order to achieve that you can try to set the Runtime Library option with the /MT switch. If you use /MT, your executable won't depend on a DLL being present on the target system. You can also take a look on the Should I compile with /MD or /MT? thread which may be useful to you.
-> I can't add the CustomAction to the "Published Events" list of a Dialog's "Next" button, because it is not in the dropdown list. How can I get the CustomAction to show in the dropdown menu?
Please make sure that you added the Call Function From Attached Native DLL predefined custom action without sequence. Here's the How do I execute a custom action when a button is pushed? article with related information for hints and guidance.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Re: make own "TestODBCConnection"

Without sequence works like a charm.

The other one does not, because I forgot to specify that am using C#, where /MT compiler flag is not available. How would I solve this in C#?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: make own "TestODBCConnection"

Hello,

In this case, you can add the .DLL as a Temporary File in the Files and Folders page from Advanced Installer.
The "Temporary Files" are copied on the target machine at the beginning of the installation and are deleted at the end of it, ensuring you have access to them throughout the entire install process.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”