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!

aweber
Posts: 63
Joined: Mon Jun 18, 2018 7:45 pm

.NET Installer custom action question

I have the need to call a custom action in my .NET dll in two places during Install. (Basically prior to "Preparing", and then again late in the install sequence...maybe right-before "Finish Execution".)

So two ideas here:
1) I realize there is an "intended purpose" for the passed "Action" mandatory parameter, but can I re-purpose these to suit my design? That is, can I pass "Uninstall" to my .NET Installer class even if I'm in the middle of an Install or Upgrade...just to differentiate the methods in the class that will be run?

2) I assume it is possible to call the same .NET Installer class multiple times from my Install-package with multiple Custom Actions?

Thanks,
AJ
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: .NET Installer custom action question

Hello AJ,

From what I can see in the custom action's UI, yes, it is possible to have the action to be "Uninstall" even during an install/upgrade. The value for the "Action" parameter is editable. You can edit it by pressing the "Edit..." button and then changing its value.

The use-case for the ".NET Install Class" is pretty limited and rigid. If the action that you are trying to achieve does not require this custom action, then you can use the DTF approach (see "How to integrate and debug custom actions" article for more information about this).
2) I assume it is possible to call the same .NET Installer class multiple times from my Install-package with multiple Custom Actions?
A common use-case for the ".NET Installer Class" custom action would be to install a service on "Install" and delete it during the "Rollback". With that being said, you can try to call your ".NET Installer Class" multiple times from within your setup.

Also, could you please give me some more details about what you are trying to achieve through your ".NET Installer Class" custom action?

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aweber
Posts: 63
Joined: Mon Jun 18, 2018 7:45 pm

Re: .NET Installer custom action question

I need to perform some "pre-install" (in layman's terms)...I think I need some pre-work to happen BEFORE "Preparing" stage in Custom Scripts.

I ALSO need to perform some "post-install", finishing code -- basically AFTER "Add Resources" and before "Finish Execution" stages.

It would be extremely convenient if I could just include my custom code in one .NET Installer class, and then call the class's methods from multiple points in my install project.

So can I call the same Action twice during installation (but pass different "Installer Class Parameters" to indicate my custom scenario)? Or can I simply call one of the default Actions that I am not using anyway at a different part of my install, assuming those Actions and associated Methods are just conveniently named, and the names do not actually perform any other function)?

(No need for these at all during Uninstall, actually.)

Thank you.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: .NET Installer custom action question

Hello,

From what we know this should work just fine. All you should do is to just define multiple ".Net Installer Class" custom actions in our "Custom Actions" page. And you can configure them to even call the same method (e.g. "Install").

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”