Page 1 of 1

The 'user' variable during package installation

Published: November 15, 2016 - 6:30 PM
by Murasakiiru
Hello,

I'm trying to create a package with Wapt, and I'd like to send files to the User folder.
I tried using the user_appdata variable, which seemed like a good idea, but it keeps returning this error:

Otherwise, I tried `os.getenv(USERPROFILE): C:\Windows\system32\config\systemprofile`
or `os.getenv(USERNAME):`: returns my machine name and not my username.

I'm a bit stuck here. I understand that the commands are executed with the 'SYSTEM' user, hence the output I'm getting, but how do I fix this?

Thanks,
Mura.

EDIT: More descriptive title

Re: Variable 'user' during package installation

Published: November 16, 2016 - 5:07 PM
by Aguay
Hello,

are you targeting a specific user?
Or do you want to deploy something to all users on the machine?


You might want to check out https://dev.tranquil.it/sphinxdocs/sour ... local_users.

You'll certainly find other useful information there. ;)
And if you still can't find what you're looking for and/or don't know how to proceed, feel free to repost. :)

Good luck!

Re: Variable 'user' during package installation

Published: November 21, 2016 - 4:20 PM
by htouvet
To customize the installation of software in the user's context, a function must be added
session_setup
add to your package and include the additional actions


example :

Code: Select all

def install():
    # system wide
    run('...')
 
def session_setup():
    # un raccourci personnalise...
    create_user_desktop_shortcut('Navigateur pour %s'%get_current_user(), target = makepath(programfiles32,'Mozilla Firefox','firefox.exe'))