Convert your Python .EXE file to an Installer Setup file?

Reshma Haridhas
8 min readAug 18, 2024

--

It is quick and easy task to convert a python EXE file to an installable Setup file using Inno Setup compiler.

Consider you have your EXE file ready. If you need a installer file to make your python application install in your computer or to share with your friends and family to install the .exe application in their computer, this article will help you do it.

Step 1: Install Inno Setup compiler software.

Visit this URL https://jrsoftware.org/isdl.php to install the software.

On visiting the URL, you will see the webpage as shown above. In the tabular column, there is a filename ‘innosetup-6.3.3.exe’. There is a field ‘Download sites’ with ‘US’ and ‘Netherlands’ listed under it.

Click on any one of the country names ‘US’ or ‘Netherlands’.

The inno setup software gets downloaded. After downloading the inno setup, install the inno setup compiler in your computer. It is simple process to install inno setup.

After successfully installing Inno setup compiler in your computer, continue to Step 2 below.

Step 2: Open Inno setup compiler. A welcome window appears.

Step 3: Under the ‘New file’, click on the radio button ‘Create a new script file using the Script Wizard’. Then click ‘OK’ button.

Step 4: Click on the ‘Next’ button in the window. Keep the checkbox unchecked.

Step 5: The application details has to be filled in the window below,

  • In the field ‘Application Name’, type the name of your application. Here I am naming my application as ‘Dice roller’.
  • Under the ‘application version’, mention the version of your python .exe application as 1.0.0 or 1.2.0 or 2.0 or any version of your choice.
  • Under the ‘application publisher’, type the publishing company name of your application. If you are publishing your python app under any company name such as ‘XYZ Inc’, mention it there. Or mention your name there. Or leave it empty as it is optional.
  • If your python app has a separate website to show about its details, mention the URL of your python application under the field ‘application website’.

Now after entering the app details, click on the ‘Next’ button below.

Step 6: Type the name of your application in the window under the field ‘Application folder name’.

Here i am naming the folder of my application as ‘Dice roller’.

Click ‘Next’ button.

Step 7: In this window, click on the ‘Browse’ button to locate the .exe file of your python app which is created already.

Step 8: Locate the .exe file from your python project folder. My .exe file is under the folder ‘PyCharmProjects->DiceRoller->dist’ in my computer. Click on the .exe file, and click ‘Open’ button in the window.

Now the .exe file has been added.

Next choose the other required folders and files which has to be needed to run your .EXE file. These folders can contain supporting images, or audio files which are coded in the python .exe file.

Step 9: To include the supporting folders if any, click on ‘Add folder’ in the window.

A pop-up opens up, go to your project folder and choose the folders you want to add.

Here i want to add the folders named as ‘dice4’, ‘dice6’, dice8', ‘dice10’. Click on those folder one by one, and click ‘OK’ button.

First i am clicking ‘dice4’ folder, and clicking ‘OK’ button.

A confirmation pop-up shows as below:

Click ‘Yes’ to confirm.

Now you can see the selected folder has been added under ‘other application files’ with a asterisk at the end of the filename.

The asterisk * means that all the sub folders in the folder ‘dice4’ has also been included.

Now repeat the Step 9, to add the other folders you want. Here i am adding the other folders ‘dice6’, ‘dice8’ and ‘dice10’ also.

Screenshot after adding all the four folders required for the python app

Click ‘Next’ button below to continue the process, else if you want to add any file(s), go to Step 10.

Step 10: Click on ‘Add file(s)’ button to include any file that is required to run your .exe application.

Here i am adding an audio file named ‘dice-142528.mp3’ that is needed for my python app.

Locate the file you want to include, and click ‘Open’. Similarly, add any more files if needed.

Now after adding all your required file(s), click ‘Next’ button below. Continue to ‘Step 11’.

Step 11: Now uncheck the checkbox ‘Associate a file to the main executable’.

After unchecking, click ‘Next’ button.

Step 12: In the window appearing next, make sure to click the checkboxes next to ‘Create a shortcut to the main executable’ and

‘Allow user to create a desktop shortcut’.

Click ‘Next’ button below in the window.

Step 13: Locate the license file in your computer if you have, by clicking on the ‘Browse’ button next to License field.

Click ‘Next’ button below in the window.

Step 14: Under ‘install mode’, make sure to click the radio button ‘Administrative install mode (install for all users)’.

Click ‘Next’ button below in the window.

Step 15: Click on ‘English’ language and any other languages of your choice from the checkboxes, and click on ‘Next’ button below in the window.

Step 16: Now under compiler settings, locate the folder where you want your app installation package to be created in your computer.

Click on the ‘Browse’ button next to ‘custom compiler output folder’.

Select the folder, and click ‘OK’ button. Here my output base folder is ‘Downloads’ folder.

Step 17: Change the name of the ‘output base file name’ by renaming ‘setup’ to any setup name of your choice. Make sure to name your setup file in a proper way such as below format:

projectname_version_SETUP

As per the above format, I am naming my base file as ‘Diceroller_v1.1_SETUP’.

Step 18: Set the icon for your setup file.

To set an icon for setup file, a .ico file is needed. Click on the ‘Browse’ button next to the ‘Custom setup icon file’.

Locate the .ico file in your computer. Here i am choosing the file ‘setting_zul_icon.ico’ from my computer.

Now the selected .ico file has been included.

Click ‘Next’ button in the window.

Step 19: Click on the checkbox ‘Yes, use #define compiler directives’.

Click on the ‘Next’ button in the window.

Step 20: Click on ‘Finish’ button in the window.

Step 21: Now a pop-up appears asking ‘Would you like to compile the script now?’.

Click on ‘NO’ in the pop-up window. There is still an important step to do.

Step 22: In the Inno setup window, scroll down to reach the ‘[FILES]’ section. If you have added any required folder to this setup, this step is important. Otherwise skip to step 23.

In the places where the name of the folder which you have added appears as Sourcedir, there will be ‘Destdir’ mentioned next to it.

Just add a forward slash and type the name of the folder as it is next to {app}.

Here my folder name is ‘dice4’. So appending a word

/dice4

Similarly, added to all my folders. Now the script looks as below.

Step 23: Click on the ‘compile’ icon in the toolbar of Inno setup window.

Step 24: Click on ‘Yes’ in the pop-up window to save the compilation script. Otherwise click on ‘No’. The compilation script gets saved automatically to the ‘Documents’ folder in your computer.

Step 25: The compiling starts now.

Step 26: After the compiling process gets completed, the status of the compiling process is displayed at the bottom part of Inno setup window.

If the compilation is successful, it shows ‘Finished’ in green color text as below,

Step 27: Go to the base output folder you mentioned to view your SETUP file. Here i have mentioned as ‘Downloads’ folder in my computer. Hence, it gets saved there.

Step 28: Double click on that file to open and install your python exe in your computer.

Conclusion:

Now you have successfully converted your .exe file to a installable package. This installable package can be shared to your friends, colleagues, and family to install your python program in their computer.

Thanks for reading my article! Hope my article helped you.👩‍💻

--

--

Reshma Haridhas
Reshma Haridhas

Written by Reshma Haridhas

Coder - Python | Java | Passionate for coding - Ethereum DApp Developer - Smart contract developer — Graduate Software Engineer

No responses yet