deilsoncso2
Posts: 1
Joined: Thu Mar 18, 2021 10:03 pm

Create MSI package using a BAT file (Batch File)

I am a novice, and not very familiar with the English language, but I am working hard. I believe that if you know how to make a package in this style, others will be easier to deal with once you understand the concept.

I have a Fortinet exe package (FortiClient VPN) that is installed from a "*.bat" file because after installing the FortClient VPN "*.exe" package, it needs to import the configuration file and this is done via command line, so I use a "*.bat" file that does it all. The folder contains three files which are these:
001.png
001.png (7.73 KiB) Viewed 4443 times

The *.bat script file is this:
002.png
002.png (20.23 KiB) Viewed 4443 times
Researching a little, I know that I need to do with what the MSI package (silent, this part is important because it will be in the SCCM Software Center and therefore it needs to be silent) to work, I have to put the files in a folder temporary, and create the "Custom Actions" I managed to perform the tests, but errors happen, or the "*.bat" script opens, runs the installation and does not wait for the "setup.exe" to finish and with that it pulls the configuration file before the installation is finished and thus generating an error.

Another issue is that as it will call a "*.bat" file soon, it will create an entry in "Uninstall Programs" in the control panel, and the MSI file also creates an entry, leaving two entries in the control panel.

Can someone help me? if i can create a project using these reference files and i will continue from here, it will help me a lot, as i said, i am a beginner and i recognize that i need to learn, but i have been trying for 6 hours and i am not succeeding hahaha.
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Create MSI package using a BAT file (Batch File)

Hello and welcome to our forums,

I think that the best approach here would be to add your .EXE file as a prerequisite in the "Prerequisites" page.

For instance, you can add it as a "feature-based" prerequisite. A "feature-based" prerequisite is installed when you click the "Install" button of your main package.

After doing so, you can have a "Custom Action" that runs your .BAT file (however, please note that this should be slightly modified, as the installation now happens from our main package).

Regarding the two entries from Control Panel, you can hide the entry of your MSI package by going to "Product Details" page and checking the "Do not show in list" option.

Hope this helps!

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

Return to “Building Installers”