What do you do when you’ve created some new Windows software — anything from a simple diagnostic tool to a complex PC video game — and you want to share it with the world? Well, you could compress the files into a single ZIP file and distribute that.
Or you can be fancy and create an installer EXE instead.
We’ll be covering three different methods in this post: a self-extracting package, a simple installer using the built-in IExpress, and an advanced installer using the customizable Inno Setup.
Quick Method: Using 7-Zip
You probably already use 7-Zip for extracting all kinds of archive files , and you probably already know that 7-Zip can create archive files, but did you know that you can also use it to create an EXE file that acts like an installer?
It’s called an SFX archive (“self-extracting”) and works by compressing all of your end files together, then embedding a special EXE file inside the archive that knows how to extract everything. In other words, the recipient can extract the SFX archive (which appears as an EXE file itself), even if they don’t have the right software, which can happen with formats like 7Z, RAR, TAR, and ZIP.
How to create your own SFX archive with 7-Zip:
- Prepare all of your files and directories within a single main directory and name the directory whatever you wish.
- Right-click on the directory and select 7-Zip > Add to archive…
- Under Options, enable Create SFX Archive and select the following settings…
> Archive Format: 7z
> Compression Level: Normal
> Compression Method: LZMA2
> Dictionary Size: 16 MB
> Word Size: 32
> Solid Block Size: 2 GB
- Click OK. Done!
Note that SFX archives aren’t true installer files. They don’t place the extracted files into a designated target directory. They don’t modify the Windows Registry. They don’t create install logs and they don’t show up as “installed software” in the Uninstall app. They are literally archive files dressed up as EXE files.
Download — 7-Zip (Free)
Easy Method: Using IExpress
IExpress is a utility that comes bundled with versions of Windows starting with Windows XP and beyond. The utility comes with a front-end graphical interface (called IExpress Wizard), but you can also create installer files using hand-scripted Self Extraction Directive (SED) files. We recommend the Wizard.
Like 7-Zip above, this method creates a self-extracting archive but with two major differences: one, the end user will proceed through a multi-page Installation Wizard, and two, the end user can specify the target directory to where the tool will extract the files.
How to create your own installer EXE using IExpress:
- Open the Run prompt (Windows key + R) and type iexpress.exe to launch the IExpress Wizard.
- Select Create new Self Extraction Directive file and click Next.
- Select Extract files only and click Next.
- For the package title, the name of your app is a safe choice.
- For the confirmation prompt, choose No prompt or Prompt user with. It doesn’t matter either way. For the sake of the end user, including one is always a safe choice.
- For the license agreement, Display a license if you want the end user to agree to some kind of End User License Agreement (EULA). If not, it’s fine to select Do not display a license.
- Add all the files you want to see installed by clicking Add, browsing to where the files are, and selecting them all.
- Continue through the IExpress Wizard and select your preferred options for the Show Window and Finished Message prompts.
- For the package name, click Browse, navigate to where you want the installer EXE to be created, and give it a name. This is the EXE file that you are going to distribute to end users. Click Next.
- Finally, select Save Self Extraction Directive (SED) file if you want to create a modified installer later on, such as when you’ve patched the software and need an updated installer. If you select Don’t save, then you’ll have to run through the entire process from scratch.
- On the Create Package page, click Next. Wait. Done!
Note that IExpress has some quirks and issues. It doesn’t allow inclusion of empty directories. If your installation has subdirectories, the subdirectories won’t be included. If you have multiple files of the same name, even within separate directories, the installer creation will fail.
Because of these oddities, we recommend using the method below instead.
Recommended Method: Using Inno Setup
Inno Setup is an open source utility that’s been in active development since 1997. It was created partly in response to the at-the-time subpar InstallShield Express. Since then, it has become the installer creator of choice for those who don’t care to explore proprietary options.
Its biggest draw is its flexibility. Inno Setup uses script files with an ISS extension (“Inno Setup Script”) to customize various aspects of the installer: which files are incorporated, where the installation happens, whether to create shortcuts, etc. ISS files use a similar formatting to INI files and can be generated using the Inno Setup Wizard.
How to create your own installer using Inno Setup:
- Launch the Inno Setup Compiler app.
- In the welcome prompt, select Create a new script file using the Script Wizard.
- Enter your Application Name and Application Version. Optionally, you can also include Application Publisher and Application Website details. Click Next.
- Select the Destination base folder, which defaults to Program Files. Enter an Application folder name, which is the name of main directory where your installation files will go. Click Next.
- For Application main executable file, browse and select the main EXE file that will launch your app. If you aren’t installing an app, enable The application doesn’t have a main executable file. Then add files and folders to your installation with the Add files… and Add folders… buttons. Click Next.
- On the Application Shortcuts page, leave the defaults or change them to fit your preferences. They’re all self-explanatory. Click Next.
- On the Application Documentation page, you can point to up to three TXT files that will be displayed throughout the end user’s installation process. Typically these will be LICENSE.TXT, INSTALL.TXT, and README.TXT, but they can be whatever you want. Click Next.
- On the Setup Languages page, keep English but feel free to add as many other languages as you wish. Click Next.
- On the Compiler Settings page, you can customize the installer EXE file:
> Custom compiler output folder is where the resulting installer EXE file will be placed.
> Compiler output base file name is what the EXE file will be called. The default setting is setup.exe.
> Custom Setup icon file is the icon that will be used for the installer EXE file. This must be an ICO file, which you can download or converted from PNG .
- Setup password will protect unauthorized users from using your installer. Leave it blank to disable this feature.
- Click Finish. When prompted to compile the new script, click Yes. When prompted to save the script, select No if this is a one-time installer file or select Yes if you plan to modify or update it later. Done!
Download — Inno Setup (Free)
Which Method Is Right for You?
If your software is extremely simple or if you’re only going to distribute to a limited number of people, go with the 7-Zip method. It’s easy, fast, and requires almost no technical expertise.
If your software is somewhat simple and you want to present a real installation wizard for your end users, go with the IExpress method.
If your software is complex and you have a lot of technical experience under your belt, go with the Inno Setup method. It’s the most flexible, most powerful, and doesn’t suffer from the issues that plague IExpress.
Which method will you be using? Are there any other methods that we missed? Let us know in the comments below!
Image Credit: sdecoret, DaGa5 via Shutterstock.com