Welcome to the tutorial! Let’s start simple:
import innopython
setup = innopython.setup()
setup.appname = 'Test'
setup.appdir = 'test'
setup.appver = 1.0
setup.license = 'C:\\Users\\abc123\\Documents\\LICENSE_1_0.txt'
setup.files = {'C:\\Users\\abc123\\Documents\\test.py':'{app}\\innopython.py'}
setup.build()
Let’s explain it one line at a time:
import innopython
This one’s rather obvious; it imports InnoPython.
setup = innopython.setup()
This creates a new instance of the setup class.
setup.appname = 'Test'
This sets the library name to Test.
setup.appdir = 'test'
This sets the subdirectory of site-packages the app will be installed into.
setup.appver = 1.0
This sets the application version.
setup.license = 'C:\\Users\\abc123\\Documents\\LICENSE_1_0.txt'
This sets the program’s license.
setup.files = {'C:\\Users\\abc123\\Documents\\test.py': '{app}\\test.py'}
This is the interesting part. It sets the files that will be added to the installer.
The dictionary is composed like this:
srcpath: dstpath
srcpath is the file to add, while dstpath is the destination location.
Wait, what’s the {app} for? That is replaced with the installation directory you set, or the site-packages root if you didn’t set an installation directory.
And now, the final step:
setup.build()
This generates the Inno Setup script. Now we can just open the script in the Inno Setup compiler to compile the result.
Voila! That’s pretty much everything!