'Create desktop shortcut to exe with argument with Inno Setup

I'm trying to create an installer for a Python script with Inno Setup. My goal is to have a single installer.

With Inno Setup, I packed my Python script, an embedded version of Python, and an icon.

But I don't figure how to tell to Inno Setup that my app is a .exe with an argument like:

.\python.exe .\myScript.py

I want to create an icon that will execute ".\python.exe .\myScript.py"

Is there any way to do this?



Solution 1:[1]

To create a desktop icon that will execute installed python.exe with your script as an argument, add an entry to [Icons] section of your Inno Setup script:

[Icons]
Name: "{autodesktop}\My Program"; Filename: "python.exe"; \
    Parameters: ".\myScript.py"; WorkingDir: "{app}"

Solution 2:[2]

Have you compiled your python file to a .exe? Or is it a .py? The best way to setup Inno Setup is to use its inbuilt installer creation wizard. It steps you through exactly what you need to do. Then you can go back in and change the code after if you're not happy.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Martin Prikryl
Solution 2 Squigglybark357