Hello jidjan,
as I understand it Advanced Installer utilizes the Windows Installer technology, which in turn - as I understand it - does not offer a specific mechanism for your purpose.
If that is so, you may need to implement the logic to call and deal with the result of the batch file yourself, either in form of custom code in a DLL or in form of a script written in JScript or VBSript. You can call your code in a custom action in various stages of the installation.
So at the point where you want to call and deal with the result of the batch file you could add a custom action that calls your script code to perform the necessary steps.
The following code create a new WScript.Shell object. We need that to execute files/batch scripts via its Run() method/function. Also we use its Popup() method to show a popup with our message:
Code: Select all
var shell = new ActiveXObject("WScript.Shell");
var commandToExecute = "cmd.exe /c exit 1";
var result = shell.Run(commandToExecute, 1, true);
shell.Popup("Result/Exit code of command: " + result);
If you put this code into a file "something.js" you can execute it via doubleclick on Windows. You can keep writing and testing the code like this until it is ready for testing inside the installer, this may be more efficient than creating and running the installer after every change in the script file.
I have found that writing custom actions for Windows Installer is an error prone and frustrating task for several reasons, and because of this writing them should be done by an application developer at least.
With best regards
Clemens Anhuth
FOLLOW US
Get the latest news in Application Packaging