0

as the title says, is it possible to execute a python script inside the installer without having it copied to the installdir and then executing it throught a CustomAction?

I have a config script which is used during install and unninstall but currently i'm copying it to the installdir and then executing it, but I wish I could just execute it without copying...

Thanks

  • I am not sure. So why answer? Because my best guess is that you can't - at least not yet. I think only VBScript and JavaScript are supported as built-in custom actions, but I suppose Python is an Active Scripting language as well, and could technically be supported. I noticed Installshield now supports PowerShell custom actions - for example - but I don't know how that works technically either (probably proprietary). I guess we need Bob Arnson or Rob Mensching to really answer. And for the record: WiX 3 and WiX4 look very similar in this respect (custom action types). – Stein Åsmul Jan 25 '18 at 05:05

1 Answers1

0

There is no current support for running a python script like there is for vbscript that I know of as Setin Asmul noted in his comment.

There are some convoluted ways of running a custom action and directly extracting a binary out of the MSI database and executing it but a simpler way would be to just make a custom action dll and include the script in the self-extracting package created during the build process.

You can use the CustomActionContents property to include your python script as a file needed by the custom action dll. When you run your custom action the CA.dll package is extracted into a temporary location and the custom action is run. Since the python script was added as a CustomActionContents file it will be in the same temporary dir as the custom action dll so you can run it from there.

Brian Sutherland
  • 4,698
  • 14
  • 16
  • Hmmm a bit confusing, but let me see if I got it. I'll take a look at this CustomActionContents. I would have to create a dll then that calls the python script? And setting it as a CustomActionContent it would be copied to the temp folder. – Rafael Mendes Jan 25 '18 at 22:32