Page 1 of 1

Problem executing a package containing a script in session setup mode

Published: May 16, 2022 - 10:22
by Albin
Hello,

I have a package that runs a script in session setup mode. When I run the package on a computer, it doesn't work, but the script itself runs fine.
The script in question is:

`def install():
run(r'wapt-get session-setup test')`.

Apparently, this mode only allows execution at startup. However, from the command line on the computer, I can force execution using `wapt-get session-setup test`.

Is there a way to force this command to run through Wapt? Thank you.
The startup method has several drawbacks that are incompatible with our needs.

Best regards,

Albin

Re: Problem executing a package containing a script in session setup mode

Published: May 16, 2022 - 11:20
by sfonteneau
Hello,

the session-setup runs automatically in open sessions after each package installation, so it's not necessary to run it within a package.

However, it will only run once per package version and per session.

If you want it to run every time, you can return "ERROR" at the end of session-setup.

Re: Problem executing a package containing a script in session setup mode

Published: May 16, 2022 - 11:40 AM
by Albin
Hello again,

Thank you for your reply. As I explained in my previous message, I need to be able to control the execution because triggering at

startup doesn't fit our constraints (mapping resources that may be unavailable at startup).

Is there any way to trigger a "wapt-get session-setup package name -f" with Wapt when my users are on the LAN? Thank you.

Albin,

Re: Problem executing a package containing a script in session setup mode

Published: May 17, 2022 - 1:38 PM
by dcardon
Hello Albin,

please reread the last topic you opened on run_powershell and review the corresponding documentation.

`def install()` runs as the SYSTEM account, so there's no chance your script will execute correctly.

Regards,

Denis