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!

h.augustin
Posts: 1
Joined: Thu Apr 10, 2014 11:48 am

Getting a custom information from an attached DLL

Hi, i am all new to this software.

Right now i am validating if it matches all my needs.

My situation might be a little bit special because most of the setups i am planing to build are not stand-alone-products. They are some kind of plugins to an other software. Sadly, the vendor of the main software does not have a standard tool to install these plugins.

I need to find all the client- and server side paths and locations to decide at which locations dlls, xmls, etc. have to be installed or copied.

Thats all easy, i have a fully devoloped .NET DLL which does all the registry reading, ini-reading and passes all the needed paths as propertys of a class.

Questions:

1. Can is use my .NET DLL and use the paths inside my project?

if not
2. Can i read a registry value which contains the full path to a .ini file and after that read different keys from the ini file and use these as my paths to install?

Thanks a lot!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Getting a custom information from an attached DLL

Hello Augustin and welcome to Advnaced Installer forums,

Thank you for your interest in Advanced Installer.

Since you need installer properties within your custom action, I highly recommend you to (re)write your custom action as a fully fledged C# custom actions as you can easily set and retrieve installer properties.
In your .DLL custom action you can retrieve the property search value using something like that:
YourVariable = session["RESULT_PROPERTY"];
In order to set a property you can use the following syntax:
session["YOUR_PROPERTY"] = "YOUR_VALUE";

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.
2. Can I read a registry value which contains the full path to a .ini file and after that read different keys from the ini file and use these as my paths to install?
In order to search through the registry you can go in the Search page and use the Wizard New Search toolbar button to quickly and easily set up a new search, following step-by-step directions. The result of your search will be stored in the property assigned to your search operation (by default it is RESULT_PROPERTY).

In order to install files in a custom folder you can go in the Files and Folders page and create a property based folder using the New Folder - > Property Based toolbar button. Property based folders will be resolved at install time to the values from the respective property.
You can take a look on the How do I install files in a custom folder? article which may be useful to you.

So, here is what you have to do:
1) Retrieve the path to the .ini file from the registry – this can be done through the search operation in the Search page.
2) Define the property-based folder in the Files and Folders page.
3) In your custom action you need to:
  • - retrieve the property's value assigned to the search operation which contains the path of your .ini file;
    - read your .ini file
    - set accordingly the public properties which will be further used as paths for your property-based folders
You can define or create a property in the Install Parameters page.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

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

Return to “Building Installers”