How to launch a batch file at target machine - Advanced Installer Community
er.anuj21
Posts: 27
Joined: Fri Aug 16, 2013 10:59 am

How to launch a batch file at target machine

Hi ,
Need urgent help .
I need to run a batch file i.e test.bat .
Till now what i was doing is that i have defined a test.bat file in custom action named Launch File.But in the working directory i have hard coded the path i.e C:\Program Files (x86)\Latilla\C4i .But now i want to browse folder and locate them into the desired location in the system i.e C:\Users\lordpintai\Documents\mytesting\ .
test.bat file is added to Files and Folder. Now i want to run test.file after the copying of all the files to the desired location. i.e C:\Users\lordpintai\Documents\mytesting\ . Here copying of all the files means after following of all the steps of execution of .exe file , all files attached to Files and Folder are copied to my desired location i.e C:\Users\lordpintai\Documents\mytesting\ and launch the test.bat file.
Attachments
testy.png
testy.png (158.43 KiB) Viewed 7398 times
browseer.png
browseer.png (242 KiB) Viewed 7398 times
Last edited by er.anuj21 on Thu Sep 26, 2013 2:37 pm, edited 2 times in total.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to run a batch file with the browsing location

Hello,

Please note that the APPDIR is the public property that contains the path for the installation folder.
Please take a look on our Properties article which may be useful to you. Please keep in mind that this property is referenced by formatted data type so it is resolved at runtime.

In order to launch a batch file, you can go in the Custom Actions page and add the predefined Launch file custom action with sequence.

In the custom action properties, in the File to Launch line just select your batch file. (e.g. [#MyFile.bat]). Also, if you want to launch a BAT file with parameters you can use a similar approach like in our pass parameter to batch file thread.

Please let us know if that helped, otherwise give us more details about your specific scenario.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
er.anuj21
Posts: 27
Joined: Fri Aug 16, 2013 10:59 am

Re: How to run a batch file with the browsing location

Thanx for answering
For more clearance , i've updated the question.
.I'm still struggling with it . I tried 2 approches what you suggested me :-
Approach 1)
"[#test.bat]" "[APPDIR]" in Command line of Launch File Properties and given a build and then executed my .exe file but still test.bat didn't launched.


Approach 2)
[#test.bat] in the File to Launch option of Properties. Still didn't launched.


My test.bat file is added in the Files and Folder option of Advanced Installer.
er.anuj21
Posts: 27
Joined: Fri Aug 16, 2013 10:59 am

Re: How to launch a batch file at target machine

In my Install Parameters , I have defined Application Folder : [ProgramFilesFolder][Manufauturer]\[ProductName].Is it because of it ?
I'm not able to rectify it :cry:
er.anuj21
Posts: 27
Joined: Fri Aug 16, 2013 10:59 am

Re: How to launch a batch file at target machine

yahoooooooooooooo ... problem rectified :)
:D
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to launch a batch file at target machine

Hi,

I'm glad you got this working. If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
iansel4
Posts: 1
Joined: Sat May 06, 2017 8:24 am

Re: How to launch a batch file at target machine

How did you launch the batch file?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to launch a batch file at target machine

Hello and welcome to our forums,

Can you please give us more details about what do you want to achieve for a better understanding of your scenario?

Also, in order to see how to run a .bat within a setup created with AI, you can have a look on our "Launch a CMD or BAT file" article.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”