Inno setup is an installer framework made by jrsoftware.org. It is a super cool and FREE tool for making executable setup programs.
Prevents Setup from closing applications using files that need to be updated by Setup.
Inno Setup Recommendations
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. I need to install a Web Application on client computer, I tried inno setup and succeed. But I want to add a form with 2 input and port checking for apache and mysql before installing the program. And change httpd.conf (apache) and my.ini (mysql) with desired port and install the service.
I recommend that you use the /VERYSILENT and /SUPPRESSMSGBOXES as fixed parameters for the uninstall of the wrapped setup. This ensures that the uninstall of the wrapped product only shows the MSI dialogs.Install Command Line Switches
/SP-
Disables the This will install… Do you wish to continue? prompt at the beginning of Setup./SILENT, /VERYSILENT
Instructs Setup to be silent or very silent. When Setup is silent the wizard and the background window are not displayed but the installation progress window is. When a setup is very silent this installation progress window is not displayed. Everything else is normal so for example error messages during installation are displayed and the startup prompt is (if you haven’t disabled it with the ‘/SP-‘ command line option explained above).If a restart is necessary and the ‘/NORESTART’ command isn’t used (see below) and Setup is silent, it will display a Reboot now? message box. If it’s very silent it will reboot without asking./SUPPRESSMSGBOXES
Instructs Setup to suppress message boxes. Only has an effect when combined with ‘/SILENT’ and ‘/VERYSILENT’.The default response in situations where there’s a choice is:Yes in a ‘Keep newer file?’ situation.No in a ‘File exists, confirm overwrite.’ situation.Abort in Abort/Retry situations.Cancel in Retry/Cancel situations.Yes (=continue) in a DiskSpaceWarning/DirExists/DirDoesntExist/NoUninstallWarning/ExitSetupMessage/ConfirmUninstall situation.Yes (=restart) in a FinishedRestartMessage/UninstalledAndNeedsRestart situation.5 message boxes are not suppressible:The About Setup message box.The Exit Setup? message box.The FileNotInDir2 message box displayed when Setup requires a new disk to be inserted and the disk was not found.Any (error) message box displayed before Setup (or Uninstall) could read the command line parameters.Any message box displayed by code./LOG
Causes Setup to create a log file in the user’s TEMP directory detailing file installation and actions taken during the installation process. This can be a helpful debugging aid. For example, if you suspect a file isn’t being replaced when you believe it should be (or vice versa), the log file will tell you if the file was really skipped, and why.The log file is created with a unique name based on the current date. (It will not overwrite or append to existing files.)/LOG=”filename”
Same as /LOG, except it allows you to specify a fixed path/filename to use for the log file. If a file with the specified name already exists it will be overwritten. If the file cannot be created, Setup will abort with an error message./NOCANCEL
Prevents the user from cancelling during the installation process, by disabling the Cancel button and ignoring clicks on the close button. Useful along with ‘/SILENT’ or ‘/VERYSILENT’./NORESTART
Prevents Setup from restarting the system following a successful installation, or after a Preparing to Install failure that requests a restart. Typically used along with /SILENT or /VERYSILENT./RESTARTEXITCODE=exit code
Specifies a custom exit code that Setup is to return when the system needs to be restarted following a successful installation. (By default, 0 is returned in this case.) Typically used along with /NORESTART./NOCLOSEAPPLICATIONS
![Process Process](https://images.sftcdn.net/images/t_app-cover-m,f_auto/p/16accf72-96db-11e6-bf8a-00163ec9f5fa/313576495/inno-setup-313576495.jpg)
/NORESTARTAPPLICATIONS
Prevents Setup from restarting applications. If Setup didn’t close these applications (for example because /NOCLOSEAPPLICATIONS was used), this command line parameter is ignored./LOADINF=”filename”
Instructs Setup to load the settings from the specified file after having checked the command line. This file can be prepared using the ‘/SAVEINF=’ command as explained below.Don’t forget to use quotes if the filename contains spaces./SAVEINF=”filename”
Instructs Setup to save installation settings to the specified file.Don’t forget to use quotes if the filename contains spaces./LANG=language
Specifies the language to use.When a valid /LANG parameter is used, the Select Language dialog will be suppressed./DIR=”x:dirname”
Overrides the default directory name displayed on the Select Destination Location wizard page. A fully qualified pathname must be specified. May include an “expand:” prefix which instructs Setup to expand any constants in the name. For example: ‘/DIR=expand:{pf}My Program’./GROUP=”folder name”
Overrides the default folder name displayed on the Select Start Menu Folder wizard page. May include an “expand:” prefix, see ‘/DIR=’./NOICONS
Instructs Setup to initially check the Don’t create a Start Menu folder check box on the Select Start Menu Folder wizard page./TYPE=type name
Overrides the default setup type.If the specified type exists and isn’t a custom type, then any /COMPONENTS parameter will be ignored./COMPONENTS=”comma separated list of component names”
Overrides the default component settings. Using this command line parameter causes Setup to automatically select a custom type. If no custom type is defined, this parameter is ignored.Only the specified components will be selected; the rest will be deselected.If a component name is prefixed with a “*” character, any child components will be selected as well . If a component name is prefixed with a “!” character, the component will be deselected./PASSWORD=password
Specifies the password to use.When an invalid password is specified, this command line parameter is also ignored.Uninstall Command Line Switches
/SILENT, /VERYSILENT
When specified, the uninstaller will not ask the user for startup confirmation or display a message stating that uninstall is complete. Shared files that are no longer in use are deleted automatically without prompting. Any critical error messages will still be shown on the screen. When ‘/VERYSILENT’ is specified, the uninstallation progress window is not displayed.If a restart is necessary and the ‘/NORESTART’ command isn’t used (see below) and ‘/VERYSILENT’ is specified, the uninstaller will reboot without asking./SUPPRESSMSGBOXES
Instructs the uninstaller to suppress message boxes. Only has an effect when combined with ‘/SILENT’ and ‘/VERYSILENT’. See ‘/SUPPRESSMSGBOXES’ under Setup Command Line Parameters for more details./LOG
Causes Uninstall to create a log file in the user’s TEMP directory detailing file uninstallation. This can be a helpful debugging aid.The log file is created with a unique name based on the current date. (It will not overwrite or append to existing files.)/LOG=”filename”
Same as /LOG, except it allows you to specify a fixed path/filename to use for the log file. If a file with the specified name already exists it will be overwritten. If the file cannot be created, Uninstall will abort with an error message./NORESTART
Instructs the uninstaller not to reboot even if it’s necessary.In this chapter, we will walk you through the process of creating an executable and then packaging it up into an installer. 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.
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.
Now we’re ready to learn about creating the installer!
Let’s Make an Installer!¶
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. You should see the main program along with the following dialog on top of it:
Max plus ii license cracker download. 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 Liege shotgun serial numbers list. 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¶
Kill Process Program
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!