cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Chaitanya05444
Level 2

How to execute a script/batch file from install anywhere

Hi,

I am having a simple .bat file in my project folder which needs to create a folder (mkdir "testfolder") in the installation directory.
How i need to execute this .bat file using execute script/batch from IA 2015SP1 ??


Thanks and Regards,
Chaitanya.
Labels (1)
0 Kudos
(1) Reply
Nischal_B_V
Level 3

Hello,

Follow the below steps to achieve the script or batch execution using InstallAnywhere.

1.Add the Execute Script/batch file Action as part of your project settings in the respective Sequence phase.
2. In the properties customizer section of the Execute Script/batch file Action, There is text area called Script: where you need to add your platform specific lines of code(Note: the commands must know in which directory it has to execute, so add cd $USER_INSTALL_DIR$ as your first line of code in the script area).
3. The text area allows the end user to leverage the InstallAnywhere Variables like "USER_INSTALL_DIR" in the user script.
4. Add a Check platform rule to the action, to decide the running platform based on script.
5.Build and run the installer.

Solution for your sample create folder task:
batch-
cd $USER_INSTALL_DIR$
mkdir testfolder

script- new folder with a test file)
cd $USER_INSTALL_DIR$
mkdir testfolder
cd $USER_INSTALL_DIR$/ testfolder
touch testfile.txt

Additonal Suggestion: It is also possible to make use of Execute Command action which runs the script or batch file as a whole. By referring the .sh or .bat file in the command line.(Refer manual for more help)

Let me know if this works for you.

Thank You
0 Kudos