Closed JoshMayberry closed 6 years ago
Thanks for opening a PR; I can see that you've put in a lot of work on this, and I appreciate that you're interested enough in Pynsist to work on it and contribute to it. However, I'm going to decline this feature: it's a lot of added complexity that I don't want to try to support.
I've written a page in the docs that explains why I often decline features for Pynsist, and what you can do instead if you need more flexibility: https://pynsist.readthedocs.io/en/latest/design.html
Makes sense. Thank you for taking the time to look at it.
Added code for running prerequisite installers for your installer. For example, say you needed to have specific drivers installed for your program to work correctly. It would be nice if the installer for your program checked to see if those drivers were installed, and if they were not- run the installer to install them.
In the example below, I have a file called
Datalogic_USBCOMInstaller.msi
, which will install the drivers for a barcode scanner. I pass in the following tonsist.InstallerBuilder
as the parameterextra_installers
:'extra_installers': [('Datalogic_USBCOMInstaller.msi', '', 0, {'not_inRegistry': ('HKLM', 'DRIVERS\\DriverDatabase\\DriverInfFiles\\oem187.inf', 'Active', '')})]
This will add code to the generated .nsi file which will run the installer
Datalogic_USBCOMInstaller.msi
and wait for it to finish, only if the keyDRIVERS\\DriverDatabase\\DriverInfFiles\\oem187.inf
with the sub-keyActive
is not in theHKLM
registry.Multiple conditions can be added by adding keys to the dictionary that is passed in as the 4th element in the tuple. Other installers can be added as more 4-item tuples in the list.
Right now, I have code for:
The conditions that I have created are:
inRegistry
: The given key must be in the given registrynot_inRegistry
: The given key must not be in the given registrycontains
: The given folder must contain the given filenot_contains
: The given folder must not contain the given fileConditions that I laid the groundwork for, but need more work on the NSIS function that accompanies them:
starts_with
: The given folder must contain a file that starts with the given valuenot_starts_with
: The given folder must not contain a file that starts with the given valueends_with
: The given folder must contain a file that ends with the given valuenot_ends_with
: The given folder must not contain a file that ends with the given valuelike
: The given folder must contain a file that contains the given value anywhere in it's filenamenot_like
: The given folder must not contain a file that contains the given value anywhere in it's filename