Praveen
Praveen

Reputation: 11

MSI Installer Setup Project :Error 1001.An exception occured in the OnBeforeInstall Event handler

I have a C# Windows Forms application and I have added a setup project to its solution to create MSI Installer.

I would like to provide some custom error messages to the end users when they're installing the software but it's showing

Error 1001. An exception occurred in the OnBeforeInstall Event Handler. 

on rollback.

Could you please help me: how to implement custom error messages to the end user in this case?

Upvotes: 0

Views: 2297

Answers (1)

rohitvk
rohitvk

Reputation: 277

Instead of checking conditions in OnBeforeInstall Event Handler, try putting that code inside

Install Event Handler

and for getting out of installation process on failure of your custom condition/check do:

throw new InstallException("Custom Message.");

This will result in : Error 1001.Custom Message.

Another approach would be using Orca with your msi to edit the built-in messages.

Upvotes: 1

Related Questions