cynthia hong
cynthia hong

Reputation: 103

Wix: How to get the return status of a custom action and use it as a condition to run certain event/show dialog

May i know how to get the return status of a custom action (that is running a command line) and use it as a condition to run certain event/show dialog? For example, in a dialog, when i click on the next button, it runs a custom action. Then, if the custom action run suceessfully, go to the next dialog. Otherwise, show the dialog with error message. Does anyone have any idea or example codes that i can refer to?

Thanks a lot.

Upvotes: 3

Views: 1500

Answers (2)

Alexey Ivanov
Alexey Ivanov

Reputation: 11858

I guess MSI does not support what you want.
You can either instruct it to fail if .exe had non-zero exit code or to ignore it. If you want the exit code, write a DLL custom action which will start the .exe and get its exit code. Then you'll be able to set a property in MSI session and use it in condition.

Upvotes: 1

Jazon
Jazon

Reputation: 1150

Building on what vinay has said:

A great article: http://www.codeproject.com/Articles/43564/WiX-Tricks#_Toc245109720

The last part of the article gives you a good guidance on passing parameters around.

String propertyValue = session["PROPERTYNAME"]; //gets a property value from wix file
session["PROPERTYNAME"] = propertyValue; //sets a property value that can be used in wix file

Upvotes: 0

Related Questions