SDutt
Posts: 18
Joined: Fri Oct 17, 2025 8:35 am

Installing prerequisite MSI in main application path

Hello,

I have a prerequisite to be installed before my main application package. For this, I've included the prerequisite's MSI as a "New Windows Installer Package" in the Prerequisites tab.

In the "Installation" tab for this prerequisite, I want to use a silent install, with a command line like:

/quiet INSTALLSERVICE=1 APPDIR="[APPDIR]" ADMINUSER=admin ADMINPASSWORD=password /norestart

However, only hard-coded paths like "C:\MyApp\MyPreReqA\" work, and APPDIR="[APPDIR]" does not work.

I have tried other options like these:

/quiet INSTALLSERVICE=1 APPLICATIONFOLDER=%APPDIR ADMINUSER=admin ADMINPASSWORD=password /norestart
/quiet INSTALLSERVICE=1 APPLICATIONFOLDER="%APPDIR" ADMINUSER=admin ADMINPASSWORD=password /norestart
/quiet INSTALLSERVICE=1 APPLICATIONFOLDER="[APPDIR]\MyPreReqA" ADMINUSER=admin ADMINPASSWORD=password /norestart
/quiet INSTALLSERVICE=1 APPDIR="[APPDIR]\MyPreReqA" ADMINUSER=admin ADMINPASSWORD=password /norestart
/quiet INSTALLSERVICE=1 APPDIR="[APPDIR]" ADMINUSER=admin ADMINPASSWORD=password /norestart

but none of these work.

Please let me know how to proceed with this.

Thanks,
SDutt
Catalin
Posts: 7794
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing prerequisite MSI in main application path

Hello SDutt and welcome to our forums,

Is the prerequisite also created with Advanced Installer?

I am asking this because APPDIR is an Advanced Installer specific property and it will not work if the prerequisite is not created with Advanced Installer.

Additionally, the reason why this does not work is because your prerequisite is scheduled before the main package, because at that point, APPDIR does not exist.

Instead, try to schedule the prerequisite as "During main package" and that should work:
Screenshot_75.png
Screenshot_75.png (1.06 KiB) Viewed 20737 times
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SDutt
Posts: 18
Joined: Fri Oct 17, 2025 8:35 am

Re: Installing prerequisite MSI in main application path

Hello Catalin,

The pre requisite that we need has not been created using Advanced Installer. In fact, this is a different Open Source product that we are pre installing with our product, since our product depends on it. So, we need its MSI to run first, and install that particular product as a Windows service. Our product can install only after that.

So, if this approach doesn't work, can you please suggest an alternate approach?

Thanks,
SDutt
Catalin
Posts: 7794
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing prerequisite MSI in main application path

Hello SDutt,
has not been created using Advanced Installer.
Please note that APPDIR is an Advanced Installer related property and it is not available in MSI packages created with other tools.

I think a solution might be to have your prerequisite MSI installed into a predefined location.

This can be done by using the TARGETDIR property.

For example, you can pass TARGETDIR="C:\SampleProject\SubFolder" as a command line for your prerequisite in the "Prerequisites" page.

The prerequisite, ideally, is to be installed silently so that the user can not modify this path.

Now, in your Advanced Installer project, you can configure the installation path to have the same value, e.g. C:\SampleProject.

This, together with the previous will ensure they are installed in the same folder - your application in the main folder and the prerequisite in the subfolder.

Hope this helps!

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

Return to “Building Installers”