hadas
Posts: 43
Joined: Mon Jan 06, 2014 10:53 am

Custom fail message

Hi,

Can I change the error message triggered by custom action ("fail installation if custom action returns an error")?
I would like to have a different error message for each custom action.

Thanks,
Hadas
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Custom fail message

Hello Hadas,

That is the FatalError dialog from the Dialogs page, however I think it's easier to show the customized error message from your custom action instead. (e.g. by triggering a message box for example) This way, you'll get the message box specifying the exact problem and then the FatalError dialog.

Otherwise, you could try to have public properties formatted references in the FatalError dialog text which will be changed from each custom action.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hadas
Posts: 43
Joined: Mon Jan 06, 2014 10:53 am

Re: Custom fail message

Hi,

Thanks for your replay.
I have various custom actions, some launching bat files, others exe files, using cmd copy function. so what will be the best way to handle different fatal errors?
How can i get the return code from each custom action?

Hadas
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Custom fail message

Hello,

The solution in this case would be to set public properties like I mentioned before. However you cannot set public properties from EXE custom actions.

Why do you need the return codes? These are used by Windows Installer to control the main installation sequence. For example if the custom action fails (return code 3), the FatalError dialog will be shown automatically.

Also, what kind of information do you want to display in the FatalError dialog? Can you give me an example with one custom action?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hadas
Posts: 43
Joined: Mon Jan 06, 2014 10:53 am

Re: Custom fail message

Hi

I don't need the return code. In every custom action you can use "Fail if.." in case an action is failing I want to give an error message with information on the step the installer failed.
I can't customize error box from all the cmd files I'm using. the is something I need to do from the installer.
for example I have a create user in db preformed from a bat file. if this fails I want to give dome details in the fatal error message.

Thanks
Hadas
Daniel
Posts: 8279
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom fail message

Hello Hadas,

Unfortunately you cannot add customized details about the failing custom actions on "FatalError" dialog. As a workaround, in order to achieve what you want you can create a wrapper custom action (e.g. an EXE or DLL) over your BAT file, which will launch the BAT file, will get the return code and display an error message accordingly if the BAT fails.

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

Return to “Common Problems”