We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

blewis999
Posts: 6
Joined: Sat Sep 20, 2014 7:01 am

Run a batch file/command file after install

I watched the Tutorial on Editing and Event in the Build tab but still have an understanding issue.

I want the builder to include my simple batch file in the build and then run it after the install is finished. I can run the file from the Command Line in windows and it works but I can't get it to run using the Edit Event.

Command: \android\a12Install.bat
arguments:
.
.
all blank

So I have a sub directory \android\ that I load the batch file into and I would like to run it after the install finishes.

But I get and error in the build
[ DefaultBuild ]
Install TwistLogic Android App... Failed to launch application with retCode: -1.


Can you tell me how to configure this please so that can run the batch file from the command prompt from the installation sub directory ...\android\ please?

Thank you

Robert
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Run a batch file/command file after install

Hello Robert,

Please note that our "Build Events" tab from "Builds" page can be used to launch events (e.g. a BAT file) just after the setup build operation, and not after the setup installation (at install time).

To launch a BAT file after the installation is done you can take a look on the following articles which should be useful for you:
1. How do I launch a CMD or BAT file?
2. How do I launch a file after an installation?

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
blewis999
Posts: 6
Joined: Sat Sep 20, 2014 7:01 am

Re: Run a batch file/command file after install

Thank you Dan, for the advice.

But it still does not work. The bat file doesn't seem to be run, I used the wizard and also tried to manually set the parameters. Neither works. Is there a working example I can look at?

Thanks

Robert
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Run a batch file/command file after install

Hello Robert,

Here it is attached a sample created with Advanced Installer 12.3.1 which launches a BAT file at the end of the installation.
sample.zip
(2.8 KiB) Downloaded 1030 times
Also, here it is a detailed step by step configuration:
1. create a BAT file (run.bat) with the following content:

Code: Select all

echo The installation folder is %1
pause
2. create a new project and go to "Files and Folders" page
3. using the [Add file] toolbar button add the "run.bat" file under the "Application Folder" directory (APPDIR property)
4. go to "Custom Actions" page and add a "Launch file" custom action with sequence, scheduled after "Install Execution Stage -> Finish Execution" action group, configured like this:
  • File to launch: [#run.bat] (use the "File..." context menu option to choose the bat file)
    Command line: "[APPDIR]"
5. build and run the project

Let us know if this helped, otherwise please give us more details about your specific scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
blewis999
Posts: 6
Joined: Sat Sep 20, 2014 7:01 am

Re: Run a batch file/command file after install

Hi Daniel

That worked perfectly, thank you.

Robert
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Run a batch file/command file after install

You're welcome Robert.

For the other requirement of your installation setup we discussed over the phone, you can post here (or send us over email if there are private details) a download link to the products you want to add as prerequisites to your setup project and some information about the detection criteria (e.g. a registry search, a file search, etc) which could be used to detect when they are installed.

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

Return to “Building Installers”