takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
896 stars 119 forks source link

Add option to execute commands after installation #144

Closed andreparames closed 6 years ago

andreparames commented 6 years ago

Hi, thanks for your work.

This is a suggestion for a new configuration field. The idea is to allow running commands after the installation is done. We're using it to install a service using nssm.

An example of the new option in use:

[Include]
files = service.exe
install_commands = "$INSTDIR\nssm.exe" install myservice "$INSTDIR\service.exe"
                   "$INSTDIR\nssm.exe" set myservice AppDirectory "$INSTDIR"

If you're interested but have some suggestions, I'd be happy to take them into account!

takluyver commented 6 years ago

Thanks, and sorry it's taken me so long to look at this.

I actually think this is an ideal use case for a custom template, rather than adding a new config option to Pynsist. See the design principles page for a general rationale. In this specific case, custom templating would give you more flexibility, e.g. to use the different exec commands, or to check for a command failing.

So if you're still interested, let's work out whether we need to add any blocks to the base template so you can easily add your commands in a custom template.

Maybe we also need some documentation on how to use custom templates.

andreparames commented 6 years ago

Hi, thanks for your help! I'm no longer working with pynsist, so I won't be proceeding with this PR; maybe someone else will find the suggestion useful and implement it properly.

takluyver commented 6 years ago

OK, thanks