I am building msi installer using wixsharp with silent installation using command line without any User Interface. I am having many custom action methods similar to the following for checking prerequisite conditions. I want to warn the users if prerequisite conditions are not met.
var project = new Project("ProductName",
new ManagedAction(new Id("OSVersion"), Check.CheckOSVersion, Return.check, When.Before, Step.InstallInitialize, Condition.NOT_Installed));
Custom action methods returns ActionResult.Failure if conditions are not met.
My batch script is below
start /wait msiexec /i Installer.msi /qn /l*v installerlog.log
if "%errorlevel%" == "1013" goto err
if "%errorlevel%" == "1603" goto err
:err
echo "Error: Msiexec failed with errorlevel = %errorlevel%"
pause
exit /b %errorlevel%
Is it possible to make the MSI installer return custom error code and custom error messages like "OS Version Invalid" and display the same in command line. ?