当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - 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?

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: