akay0402
Posts: 2
Joined: Wed Aug 20, 2025 5:49 am

How to run a bat/cmd file that launches an exe installation

Hi All,

I'm fairly new to Advanced Installer and was wondering on how you get to launch a exe installation using custom action. My project settings is as follows:

Product Details:
Name: My App
Version: App Version
Publisher: App Publisher
register product with Windows Installer (unchecked)

Files and Folders:
Windows Volume -> Temporary -> MyAppFolder -> Has 4 files
Install.bat
app_x86.exe
app_x64.exe
Readme.txt

Builds:

Package Type: Single MSI
Archive: Archive Installation files into CAB files
Compress CAB files for smaller size (checked)
One CAB archive containing all installation files (selected)
Include CAB file into the MSI database

Custom Action:
Installation Sequences -> Execute Sequences -> Add Resources -> Launch File (Placed after Publish Product)

The bat file works when run on the computer and manually run. But when I build the msi and hit run, it runs but doesn't install (no entries in control panel). It appears during the installation but not after.

Bat file:

Code: Select all

@echo off
set current_dir=%~dp0
cd %current_dir%

set progfiles86root=%ProgramFiles(x86)%
IF NOT "%progfiles86root%"=="" GOTO 64Bit
app_x86.exe /Q
GOTO Exit

:64Bit
app_x86.exe /Q
app_x64.exe /Q

:Exit
exit 0
Version of Advanced Installer is 22.9.1, and Windows version on test machine is Win11
Catalin
Posts: 7794
Joined: Wed Jun 13, 2018 7:49 am

Re: How to run a bat/cmd file that launches an exe installation

Hello and welcome to our forums,

Instead of doing the installation through a BAT file, it'd be much easier to use our out-of-the-box support for Prerequisites.

In "Prerequisites" page, you can add both your EXE packages (simply select "New prerequisite" and then select the EXE from the disk) and also set them to run using the /Q parameter through the "Command line" fields.

Also, you no longer need to add the packages in "Files and Folders" page, as they are automatically embedded when you add them as prerequisites.

Could you please try that and let me know if you encounter any issues?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
akay0402
Posts: 2
Joined: Wed Aug 20, 2025 5:49 am

Re: How to run a bat/cmd file that launches an exe installation

Hi Catalin,

Thanks for your reply, but I was wondering if there's a way to do this in custom actions as opposed to the pre-requisite section, as I could have a list of steps executed in sequential order, rather than pre-requisite.
Catalin
Posts: 7794
Joined: Wed Jun 13, 2018 7:49 am

Re: How to run a bat/cmd file that launches an exe installation

Hello,

Installing the prerequisite via a custom action is not really recommended due to a big limitation of the Windows OS - where two installation packages can not run at the same time.

If you still require this, you can follow this article:

How do I uninstall another MSI package when my application is uninstalled?(deprecated)

The one explains how to achieve the uninstall, but it is quite similar for install.

Hope this helps!

Best regards,
Catain
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”