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!

ourlaw
Posts: 4
Joined: Sat Sep 13, 2014 12:38 pm

How to run bat file as Prerequisite

Hello

I want to create setup for my files but my setup has a Prerequisite(mysql server).
I can add mysql as Prerequisite but I wrote a .bat file like this:

Code: Select all

echo off
cls

echo Starting MySQL mysql-server-5.5.39 install
msiexec.exe /i  %~dp0mysql-server-5.5.39.msi /qn INSTALLDIR="C:\MySQL" 
echo MySQL mysql-server-5.5.39 installed successfully.
"C:\MySQL\bin\MySQLInstanceConfig.exe" -i -q ServiceName="MySQL567" RootPassword="1234" ServerType=DEVELOPER DatabaseType=InnoDB Port=3306 

echo MySQL Instance Configured. Service started.
Then how can I run this .bat file as Prerequisite?
Please consider that this .bat file should run as administrator and as I coded this is a silent install and has a configuration line.

I read some articles in this forum but non of them couldn't help me.
I would appreciate if anyone can help me.

Regards
Massoud Maboudi
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to run bat file as Prerequisite

Hi Massoud,

Normally, a BAT file cannot be run as a prerequisite, it can be run only through a custom action.

However, it may work if you add it as a "pre-install" prerequisite. Just select the "All Files" option from the bottom-right corner when you want to select the BAT file, otherwise it will not be displayed. Also, if you want it to run as administrator, you need to select the "Run as administrator" option from the "Install Parameters" page of the main package.

If you want to run it as a "feature-based" or "post-install" prerequisite, you can create a simple MSI package, add that BAT file in a "Launch file" custom action, then add that MSI as a prerequisite in your main package.

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

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”