Page 1 of 1

[SOLVED] Configuration def session-setup

Published: May 24, 2024 - 11:58 AM
by Emmanuel64
Good morning

I added a "session-setup" parameter to a package:

Code: Select all

def session_setup():
   filecopyto('v6-gpo-configuration.json',makepath(user_local_appdata(),'UpSignOn'))
When I'm on the DEV console and I run "session-setup" directly, the file transfers correctly. But during package installation, it doesn't work. I tried "wapt-get session-setup -f hasp-UpSignOn", but there was no change

Do you have any idea what my mistake might be?

THANKS

Re: Configuration def session-setup

Published: May 28, 2024 - 08:02
by gaelds
Good morning,
I asked pretty much the same question in 2017 ;) Simon's answer is here:

viewtopic.php?t=595
Hello, as indicated in the documentation:

https://www.wapt.fr/fr/doc/CreationPaqu ... sion-setup

, with session_setup, it is not possible to access files contained within the package.

You will need to copy them beforehand to a directory.

Re: Configuration def session-setup

Published: May 28, 2024 - 08:52
by Emmanuel64
Thanks gaelds.

I had searched for the answer on the forum, but hadn't managed to find it. :oops:

Have a good day.

Re: Configuration def session-setup

Published: May 30, 2024 - 08:27
by Emmanuel64
Good morning

To close this ticket, and for those who will be looking for an answer

Simon therefore confirms that:
With session_setup, it is not possible to call files contained in the package.
They will need to be copied into a directory beforehand.

For example, in my case:

Code: Select all

def session_setup():
if not isdir(makepath(user_local_appdata,'UpSignOn')):
mkdirs(makepath(user_local_appdata,'UpSignOn'))
filecopyto('C:/Windows/System32/v6-gpo-configuration.json',makepath(user_local_appdata(),'UpSignOn'))

def install():
# Declaring local variables

# Installing the software
print("Installing: UpSignOn-7.7.1-silent-installer.msi")
install_msi_if_needed('UpSignOn-7.7.1-silent-installer.msi' , key = '' ,  min_version = "7.7.1" )
filecopyto('v6-gpo-configuration.json',makepath(system32))
The file will therefore be copied from the local disk to c:/user/xxx/appdata/local/UpSignOn the next time the user logs in

Thanks to gaelds for redirecting me