Chaning order of execution of custom action during uninstall - 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!

Vicente
Posts: 20
Joined: Sat Oct 08, 2011 12:21 am

Chaning order of execution of custom action during uninstall

Hi,

I have the following installation procedure:

- copy a .dll with a custom action to the installation folder
- copy a few files to another folder (to the Visual Studio templates folder)
- run the custom action (this action will call Visual Studio to register the templates)

When uninstalling, I need to:

- remove the files copied
- run the custom action (to unregister the templates now that they are deleted)
- delete the .dll with the custom action

But what is happening in my installation is that the .dll with the custom action is removed before it is called, so it fails. And it has to run after the other files are deleted or it won't do anything. Any tips on this?

Regards,

Vicente
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Chaning order of execution of custom action during unins

Hello Vicente,

In order to achieve what you want you should schedule your "unregister the templates" custom action, on uninstall, after "Install Execution Stage -> Remove Resources" action group. Also, you should have a custom action which will delete the related .dll, on uninstall, scheduled after the above custom action.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Vicente
Posts: 20
Joined: Sat Oct 08, 2011 12:21 am

Re: Chaning order of execution of custom action during unins

Hi Daniel,

the problem is that my .dll with my custom action is deleted before it's executed during uninstall. I'll try to explain things better.

My installation has a feature called VSTemplates that contains:

- two .zip files (Visual Studio Templates)
. a .dll (with the custom action to register and unregister the templates in Visual Studio)

I have added two .NET Installer Class Actions to my project that use that .dll. One only executes during install, and it's executed after Add Resources. This works fine. The second .NET Installer Class Action executes after the Remove Files. This does not work, the installer complains it can not find the .dll file.

I need the uninstall sequence to be like this:

- both .zip files are deleted
- the custom action is called
- the .dll file is deleted

But I can't find a way to execute the custom action in just that precise moment. Hope it is clearer now. Regards!

Vicente
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Chaning order of execution of custom action during unins

Hello Vicente,

This happens because your uninstall custom action is scheduled after your .dll file is removed. In order to achieve what you want you can use our persistence option for the related .dll file. In this way the .dll will not be removed on uninstall, so you should have another custom action (on uninstall) which will remove the related .dll, scheduled after your "unregister the templates" custom action.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Vicente
Posts: 20
Joined: Sat Oct 08, 2011 12:21 am

Re: Chaning order of execution of custom action during unins

Hi Daniel,

thanks a lot for the persistence option, that was exactly what I was searching for. Regards!

Vicente

Return to “Common Problems”