Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

How to retrieve properties during a deferred .NET custom action

Hello,

Today we'll be discussing how to retrieve the value of a property during the deferred stage by using a .NET Custom Action.

This is done through our good ol' friend, CustomActionData. This property is special because its' value is available during the deferred stage.

Now, the code to retrieve CustomActionData in .NET is quite simple:

Code: Select all

string myPropertyValue = session.CustomActionData;
After building the DLL and adding it into an Advanced Installer project, it's time to configure the custom action now:
Screenshot_225.png
Screenshot_225.png (60.97 KiB) Viewed 15225 times

where the "Method" field is populated like this:
Screenshot_226.png
Screenshot_226.png (17.95 KiB) Viewed 15225 times

This way, you should be able to retrieve the value of a property during the deferred stage using a .NET custom action. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Sample Projects”