Create a self extracting archive and launch an installer

2

Last updated on March 30th, 2023 at 05:17 pm

Read Time:2 Minute, 1 Second

If you have used Visual Studio to create an installer, then you will find that their are two output files required for the installation – setup.exe and setup,msi. You can zip these together into a package, but what if you want a single EXE file installer? Well you can use 7-Zip to create a packaged EXE installer which will then execute your Visual Studio installer all in one go.

First of all, you need a few pre-requisites which are listed below:

  • 7-Zip should be installed on the machine you are creating the EXE package with
  • You need the “7zS.sfx” file which can be downloaded from our Downloads section

So, you will first need to use 7-Zip to package together your Visual Studio setup files (setup.msi and setup.exe), but instead of compressing them into a zip file, you need to compress them into a 7z file:
Create a self extracting archive and launch an installer 1

You then need to create a “config.txt” file. You should use Notepad++ to create this file and ensure that you are using UTF-8. To do this, click the “Encoding Menu” and choose “Encode in UTF-8”.

Then you need to enter the following into the config.txt file:

;!@Install@!UTF-8!
Title=”Installer v1.0″
BeginPrompt=”Are you sure you want to install Installer v1.0?”
RunProgram=”setup.exe”
;!@InstallEnd@!

You should edit the config.txt to how you require it.

Then create a folder (lets call it C:package for this guide) and put in the following files:

  • config.txt
  • package.7z
  • 7zS.sfx

You then need to package up the three files to create your EXE in all one installer. To do this, create a text file in “C:Package” and rename it run.bat – ensuring that you have made the file a batch file and no longer a text file (changing the file extension). Then edit this file and enter the following and save:

copy /b 7zS.sfx + config.txt + package.7z package.exe

Note that the “package.exe” is the filename you want to give to your final installer output.

Once you have done this, you should now find that you have a EXE standalone installer – run it and test it to ensure that everything is how you want it to be.

Comments

If you have any comments or questions on this guide, please feel free to leave us a message below using our comments system.

Click to rate this post!
[Total: 0 Average: 0]

Free Subscription

If you want to be notified when we post more quality guides like this one, sign up to our free subscription service and you will receive an email when a new post is live.

Join 441 other subscribers.

No need to worry, we will not be filling your inbox with spam and you can unsubscribe anytime you like.


Leave us a message...

This site uses Akismet to reduce spam. Learn how your comment data is processed.