.NET Installer custom action exception ignored??? - 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!

waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

.NET Installer custom action exception ignored???

Hello guys,
I've noticed that running .NET installer class custom action in synchronous mode with checking return code doesn't stop installation with following rollback if an InstallerException has been thrown during custom action execution.
It's quite a serious issue... If this is intended then what is the other mechanism of causing installation to fail from .NET Installer class?

Regards,
Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: .NET Installer custom action exception ignored???

Hi Alex,

I'm not sure why you are encountering this behavior (the installation should stop when an exception is thrown). Can you please send us the AIP (project) file you are using to support at advancedinstaller dot com so we can investigate it? Also, please attach a verbose log of the installation which shows this problem.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Re: .NET Installer custom action exception ignored???

Hello Cosmin,
I sent you the project...

Kind regards,
Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: .NET Installer custom action exception ignored???

Hi Alex,

Please note that your custom action is missing some code. Perhaps this article will help you:
http://www.devcity.net/Articles/339/1/article.aspx

Your code should look like this:

Code: Select all

namespace InstallerTest
{
  [RunInstaller(true)]
  public class InstallerTest : Installer
  {
    public override void Install(System.Collections.IDictionary stateSaver)
    {
      base.Install(stateSaver);
      throw new Exception("Something went wrong!");
    }

    public override void Uninstall(System.Collections.IDictionary savedState)
    {
     throw new Exception("Something went wrong!");
    }
  }
}
If you have other questions about Advanced Installer, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Re: .NET Installer custom action exception ignored???

Thank you very much Cosmin,
My bad, indeed, the attribute was missing... Is there anyway to force the Installer to display the actual error message reported by InstallException or the only way to check is looking in the log file?

Cheers,
Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: .NET Installer custom action exception ignored???

Hi Alex,

I'm afraid that the actual message of the exception cannot be shown by Windows Installer. However, inside your custom action you can try showing the message through a custom message box. In this case the custom action runs, the custom message box is shown, the custom action fails and the package shows an error message.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”