Introduction
This article will discuss one possible method of Launching a batch file using a custom action.
Instructions
To Launch a batch file using Custom Action we should follow below steps
Method 1
Launching from INSTALLDIR
- Create a Project and Add your batch file in Files and Folder[INSTALLDIR]
- Create a New EXE Custom Action [ Type: New EXE , Path referencing a directory]
- Set the Working Directory: SystemFolder
- File Name and Command Line: cmd.exe /c "[INSTALLDIR]test.bat"
- Return Processing: Synchronous (Check Exit code)
- In-Script Execution: Immediate Execution
- Set the Install Exec Sequence "After InstallFinalize"
- Add a condition if you want to run this action only on installation EX: Not Installed
Method 2
Launching from SUPPORTDIR
- Create a Project and Add your batch file to Behavior And Logic Supportfiles --> Language Independent
- Create a New EXE Custom Action [ Type: New EXE , Path referencing a directory]
- Set the Working Directory: SystemFolder
- File Name and Command Line: "[SystemFolder]cmd.exe" /c "[SUPPORTDIR]\test.bat"
- Return Processing: Synchronous (Check Exit code)
- In-Script Execution: Deferred Execution in System Context
- Set the Install Exec Sequence "After InstallFinalize" or "After InstallFiles"
- Add a condition if you want to run this action only on installation EX: Not Installed
More Information
Clickhere for details on how to launch batch file using installscript .
Additional Information
"[SystemFolder]cmd.exe /c "[INSTALLDIR]test.bat"
This command calls cmd.exe (the executable for the Windows command prompt) from the location stored in the SystemFolder MSI property and passes cmd.exe the path to the batch file. Cmd.exe accepts various parameters. For example, to have the command prompt window close after launching the batch file, use the /c parameter, as in the example above. To have the command prompt window remain open after launching the batch file, use the /k parameter instead.
For more information regarding the parameters accepted by cmd.exe, click herecmd exe
Related Articles
HOW TO: Stop a Windows Service using a Custom Action 8Number of Views Launch InstallAnywhere Without a UAC prompt 3Number of Views Problem: Lost Connection to Custom Action Server Process. Attempting to Regenerate. 5Number of Views "Unknown Publisher" on UAC Prompt when Uninstalling from Add/Remove Programs with a Signed Installation Package 5Number of Views Passing Argument To Powershell Custom Action 6Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago