In this chapter, we will walk you through the process of creating an executable and then packaging it up into an installer. See full list on subscene.cc. We will be using a really neat little user interface called GUI2Exe that was written by Andrea Gavana to create the executable. It is based on wxPython, so you will need to have that installed to use it. GUI2Exe supports py2exe, bbfreeze, cx_Freeze, PyInstaller and py2app. Then once we have the dist folder created, we will use Inno Setup to create our installer.
First Install Inno setup and then Inno-script-studio. Installation is simple and straight forward. Create a Visual Studio Project Now let us get started. Download the sample Project from the link above. You can use any of your existing project. Compile the project in release configuration. Creating Script File (.iss) Go to Start-All Programs.
- Application Destination Folder — It is the name of folder where the installed files will be located once a user installs an application using the installer created by this process.For example in above case the Program files option is chosen so if the application is installed then the installation files will be located in Program Files folder.If other folder is chosen then the files will be.
- If the application has a Mutex, you can add an AppMutex value in your Inno Setup installer and it will display a message telling the user to stop the program. You might be able to find the Mutex (if it's got one) by using SysInternals Process Explorer and selecting the program / process and looking at the Handles (CTRL-H) in the Lower Pane.
We will be using the following code once more:
Let’s get started!
Getting Started with GUI2Exe¶
To use GUI2Exe, you just have to go to its website (http://code.google.com/p/gui2exe/) and download a release. Then you unzip it and run the script that’s called GUI2Exe.py. The GUI2Exe project is based on wxPython, so make sure you have that installed as well. I ran mine successfully with wxPython 2.9. Here’s how you would call it:
If that executed successfully, you should see a screen similar to this one:
Now go to File -> New Project and give your project a name. In this case, I called the project wxForm. If you want to, you can add a fake Company Name, Copyright and give it a Program Name. Be sure to also browse for your main Python script (i.e. sampleApp.py). According to Andrea’s website, you should set Optimize to 2, Compressed to 2 and Bundled Files to 1. This seems to work most of the time, but I’ve had some screwy errors that seem to stem from setting the last one to 1. In fact, according to one of my contacts on the py2exe mailing list, the bundle option should be set to 3 to minimize errors. The nice thing about setting bundle to “1” is that you end up with just one file, but since I’m going to roll it up with Inno I’m going to go with option 3 to make sure my program works well.
Once you have everything the way you want it, click the Compile button in the lower right-hand corner. This will create all the files you want to distribute in the dist folder unless you have changed the name by checking the dist checkbox and editing the subsequent textbox. When it’s done compiling, GUI2Exe will ask you if you want to test your executable. Go ahead and hit Yes. If you receive any errors about missing modules, you can add them in the Python Modules or Python Packages section as appropriate. For this example, you shouldn’t have that issue though.
![Inno Inno](https://images.sftcdn.net/images/t_app-cover-l,f_auto/p/16accf72-96db-11e6-bf8a-00163ec9f5fa/3982751454/inno-setup-screenshot.jpg)
Now we’re ready to learn about creating the installer!
Let’s Make an Installer!¶
Inno Setup Kill Process Before Install A Door
Now that we have an executable and a bunch of dependencies, how do we make an installer? For this chapter we’ll be using Inno Setup, but you could also use NSIS or a Microsoft branded installer. You will need to go to their website (http://www.jrsoftware.org/isdl.php), download the program and install it. Then run the program. Pokemon ruby nuzlocke randomizer download. You should see the main program along with the following dialog on top of it:
Choose the Create a new script using the Script Wizard option and then press the OK button. Click Next and you should see something like this:
Fill this out however you like and click Next (I called mine wxForm). This next screen allows you to choose where you want the application to be installed by default. It defaults to Program Files which is fine. Click Next. Now you should see the following screen:
Browse to the executable you created to add it. Then click the Add file(s).. button to add the rest. You can actually select all of the files except for the exe and hit OK. This is how mine turned out:
Now you’re ready to click Next. Make sure the Start Menu folder has the right name (in this case, wxForm) and continue. You can ignore the next two screens or experiment with them if you like. I’m not using a license or putting information files in to display to the user though. The last screen before finishing allows you to choose a directory to put the output into. I just left that empty since it defaults to where the executable is located, which is fine with this example. Click Next, Next and Finish. This will generate a full-fledged .iss file, which is what Inno Setup uses to turn your application into an installer. It will ask you if you’d like to go ahead and compile the script now. Go ahead and do that. Then it will ask if you’d like to save your .iss script. That’s a good idea, so go ahead and do that too. Hopefully you didn’t receive any errors and you can try out your new installer.
If you’re interested in learning about Inno’s scripting language, feel free to read Inno’s Documentation. You can do quite a bit with it. If you happen to make changes to your build script, you can rebuild your installer by going to the build menu and choosing the compile menu item.
Wrapping Up¶
At this point, you now know how to create a real, live installer that you can use to install your application and any files it needs to run. This is especially handy when you have a lot of custom icons for your toolbars or a default database, config file, etc that you need to distribute with your application. Go back and try creating the installer again, but choose different options to see what else you can do. Experimenting is a great way to learn. Just make sure you always have a backup in case something goes wrong!
Inno Setup
Inno Setup is a free installer for Windows programs by Jordan Russell and Martijn Laan. First introduced in 1997, Inno Setup today rivals and even surpasses many commercial installers in feature set and stability.
Inno Setup Service
- Features
Learn more about what Inno Setup can do. - Download Inno Setup
Get the latest version of Inno Setup here. - Mailing List
Be notified by e-mail whenever major new versions are released. - Frequently Asked Questions
Get answers to common questions and problems. - Third-Party Files
Here you can find various useful tools for Inno Setup (for example, GUI script editors) and translations of the Setup text in many languages. - Donate
Support the Inno Setup project.
Don't forget to check out the Inno Setup forum, the primary source for Inno Setup support. Additionally, a large number of questions and answers can be found on Stack Overflow.
Want to be notified by e-mail of updates? Then click here to subscribe to the Inno Setup announcements mailing list. If you subscribed before October 2019, please resubscribe. Deap 2.1 software, free download.
- Support for every Windows release since 2006, including: Windows 10, Windows 10 on ARM, Windows Server 2019, Windows Server 2016, Windows 8.1, Windows 8, Windows Server 2012, Windows 7, Windows Server 2008 R2, Windows Server 2008, and Windows Vista. (No service packs are required.)
- Extensive support for installation of 64-bit applications on the 64-bit editions of Windows. The x64, ARM64 and Itanium architectures are all supported.
- Extensive support for both administrative and non administrative installations.
- Supports creation of a single EXE to install your program for easy online distribution. Disk spanning is also supported.
- Standard Windows wizard interface.
- Customizable setup types, e.g. Full, Minimal, Custom.
- Complete uninstall capabilities.
- Installation of files:
Includes integrated support for 'deflate', bzip2, and 7-Zip LZMA/LZMA2 file compression. The installer has the ability to compare file version info, replace in-use files, use shared file counting, register DLL/OCX's and type libraries, and install fonts. - Creation of shortcuts anywhere, including in the Start Menu and on the desktop.
- Creation of registry and .INI entries.
- Running other programs before, during or after install.
- Support for multilingual installs, including right-to-left language support.
- Support for passworded and encrypted installs.
- Support for digitally signed installs and uninstalls, including dual signing (SHA1 & SHA256).
- Silent install and uninstall.
- Unicode installs.
- Integrated preprocessor option for advanced compile-time customization.
- Integrated Pascal scripting engine option for advanced run-time install and uninstall customization.
- Full source code is available from GitHub.
- Tiny footprint: only about 1.5 mB overhead with all features included.
- All features are fully documented.
- Used by Microsoft Visual Studio Code and Embarcardero Delphi.
Is it really free of charge, even for commercial use?
Yes, it may be used completely free of charge, even when deploying commercial applications. However if you wish to show your appreciation and support its development you can make a donation.
(Note: 'Completely free of charge' must not be confused with 'completely free'. Inno Setup is copyrighted software, not public domain software. There are some restrictions on distribution and use; see the LICENSE.TXT file for details.)
Site contents Copyright © 1997-2020 Jordan Russell. All rights reserved.
Portions Copyright © 2000-2020 Martijn Laan. All rights reserved.
Portions Copyright © 2000-2020 Martijn Laan. All rights reserved.