Page 1 of 1

[SOLVED] Using a file in the Package directory

Published: June 7, 2024 - 2:44 PM
by sebastien4444
Good morning,

When creating a package for an installation that requires running a command and for which this command calls files, is it possible to put these files in the directory that contains the setup.py file and call them in the install() function?

Let's say I have an install.exe file and a conf.xml file, which I put with setup.py. Is it possible to do something like this in my install() function:

Code: Select all

run_as_administrator('install.exe /config conf.xml')
I tried exactly that and it doesn't work, so my question is more about how to accomplish this kind of thing.

Thank you in advance for your feedback :)

Re: Using a file in the Package directory

Published: June 13, 2024 - 11:35
by dcardon
Hello Sébastien,

It is possible to add files to the package, and these files will be available when the `def install()` command is executed. Indeed, after verification and signature validation, the package is unzipped as is into a temporary directory before the `def install()` command is launched.

Installations are done under the LOCAL SYSTEM account, so it is normally not necessary to call a run_as_administrator() unless the app is very poorly packaged and does not install under the LOCAL SYSTEM account.

So if you have your install.exe and conf.xml files in the wapt package, a simple

Code: Select all

run("install.exe /config conf.xml")
should be enough.

Sincerely,

Denis