Get value from exe/dll/... - Advanced Installer Community

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!

EDVGradl
Posts: 6
Joined: Mon Jun 21, 2010 2:45 pm

Get value from exe/dll/...

Hi!
We have a little problem.... We are designing a new Update-package for our customers. This package needs a validation (serial validation) and we use your online-validation method and all works perfectly. To get it easier for our customers (and better protection against illegal use) we want to insert a serial generated from a little program which is attached to the Update-Project. How can we read a value from an exe/dll/... into a property? this little program is a c#.net-app, but we can re-design it to a library, console-app or whatever. The Property [PIDKEY] should be assigned in the Init Event of the UserRegistrationDlg.

Thanks,
Jens (EDVGradl)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Get value from exe/dll/...

Hi Jens,

Installer properties can be set only from Win32 DLL or VBScript custom actions. Our user guide contains a sample C++ DLL custom action which may help you. After creating the custom action you can run it through a DoAction Init control event on UserRegistrationDlg.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
EDVGradl
Posts: 6
Joined: Mon Jun 21, 2010 2:45 pm

Re: Get value from exe/dll/...

Hi! OK, that's quite good. I can't write C++ or VB... but i will handle it :-) But there's one additional Question coming up: How can I add a Predefined Custom Action "Call Function from standard DLL", because this entry is disabled. The Project type is: Installer - Enterprise.
Or: are there any other ways to get a Property set with a function from a DLL? The best would be a .net assembly, because i have to use another .net assembly.

Thanks
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Get value from exe/dll/...

Hello,

The "Call Function from standard DLL" custom action is not available as a UI Custom Action. You can only use it during InstallExecuteSequence or InstallUISequence.
You can also use a .Net installer class custom action which, again, is only available under the above sequences. You can consult our guide on how to use the custom actions.
There are APIs for each language to handle property manipulation. For example in C++ you would use MsiGetProperty/MsiSetProperty while in VBScript you would use Session.Property("<prop_name>")

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”