How to hide the command window of a custom action?
The following article uses options that are available starting with the Professional edition and project type.
Most installations use custom actions for features that are not supported by Windows Installer or by Advanced Installer. Some of these actions show a command window with their status when launched. In order to hide this window, you can use several solution.
I. You can use a Launch file custom action by simply checking its "Hide program's window" flag.
II. As another solution special function from an Advanced Installer DLL. To launch an EXE with its command window hidden, you can try following these steps:
- add the EXE file in the Files and Folders page as a regular or temporary file
- in the Custom Actions page, create a Launch attached file custom action
- when prompted about a file, use aicustact.dll from the "custact\x86" sub-folder of the Advanced Installer installation folder (usually "C:\Program Files\Caphyon\Advanced Installer")
- in the Custom Action Properties page set the Function Name combo to CreateExeProcess
- set the Action Data field to the full path of the EXE you want to launch (you can use the in the field to select it)
For example, the Action Data field can be set to something like this for regular files:
or to something like this for temporary files:
If the custom action needs a custom working directory, it can be specified before the EXE path followed by the > character. For example:
To hide the command window of a .BAT file (e.g. MyBAT.bat), you can use the following line of code in a .VBS custom action which launches the .BAT file:
createobject("WScript.Shell").run "MyBAT.bat", false