Convert msi to exe using the command line ...

I want to convert the msi file to exe file. When I run the msi file with the qn option with msiexec, then my software installs silently. But now I want to convert this msi file to an .exe file, and that the exe file launches the msi file with the msiexec / i parameter of the msi file // qn file , any idea how to do this.

+7
command-line c # windows-installer msiexec
source share
3 answers

If you yourself configure the settings using Installshield , the tool itself should be able to create the setup.exe file by simply setting the release options in the release wizard . I think this just entails setting the release to "Compressed" , but this may require further configuration.

Please strictly follow these help file instructions . Perhaps some versions of Installshield (express, older versions, etc.) do not have this capability, but to be honest, I doubt it. He should be there when you look.

Perhaps also see this demo of the release wizard and this previous stack question: How to create InstallShield MSI without local files?

+1
source share

We can use 7zip SFX to create installers without a switch. here you can quickly go through

Requirements

  • 7Zip: You can download the latest version of 7zip from the official website .

  • 7Zip SFX Module: The official download page is here .

  • Resource Hacker or any other resource editor (optional): if you want to use a custom icon for the final executable, you must use the resource editor application and replace the icon with the desired one. here the Resource Hacker application download the link from the developer's site.

Step 1:

Create the exec.bat file in the same folder of your msi file and copy msiexec /i "path of msi file" /qn . I used Installer.msi for my example, here is my file:

 @Echo off msiexec /i installer.msi /qn 

Step 2:

Compressing msi and bat files into a 7z archive (you can download and install 7zip from here ) into a sample, I compressed my Installer.msi and exec.bat into an installer.7z archive.

enter image description here

Step 3:

Download and extract 7zSD (from the 7zSfx link) and place the file in the same archive folder, here is a direct link to it.

Step 4 (optional):

We can change the installer icon to do this, we must replace the 7zsd.sfx file 7zsd.sfx , in the resource hacker we need to open 7zsd.sfx and go to IconGroup > 101 > 1049 and replace the icon with the desired one. then save the new sfx file in the same folder of the generated 7z archive. I saved mine as 7zsdInstaller.sfx .

enter image description here

Step 5:

We must create a configuration file to tell the Sfx file what to do after extracting the archive, here is the configuration file for the sample:

 ; !@Install @!UTF-8! GUIFlags="8+32" ExtractDialogText="My Sample Installer" RunProgram="exec.bat" ; !@InstallEnd @! 

We must save it in the same folder of our 7z Archive, I named my config.txt .

Step6:

Now we need to combine our file with one executable file to do this, first we must go to our command line in the folder in which our generated files are stored, and then we must execute the following command:

 copy /b 7zsdInstaller.sfx + config.txt + Installer.7z "installer.exe" 

Now we should have the installer.exe file in the same folder

enter image description here

+5
source share

It is intended to use the product to install software for flexible programs. You can compress your msi to .exe with all supported files that were used to extract during installation.

+1
source share

All Articles