[SOLVED] The session-setup function does not run automatically

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

December 24, 2024 - 3:20 PM

Good morning,

I'm having a problem with the `session_setup()` function, which isn't running automatically. We've upgraded to the latest version of WAPT Enterprise 2.6.0.016613, and so far I've only tested the package in question, which works except for the `session_setup()` function. The behavior is actually quite strange:

- If a user is logged in during package installation, the session_setup function will run correctly for that user only, after the package is installed. However, it will not run when other users log in.

- If no user is logged in, after installing the package and logging into the machine, the function does not execute (although I did see the WAPT icon briefly appear in the taskbar during login). However, if I open a command prompt and run `wapt-get session-setup "package name"`, the `session-setup` function then executes without any problem! I don't understand why it doesn't execute automatically at login, whereas it can be executed manually.

In both cases, the behavior is the same as for a user who logs in as either an administrator or a standard user. The behavior is also the same under Windows 11 or Windows 10.

I tried to look at the WAPT agent settings but did not see any settings in the documentation that affect the session-setup function, so I did not notice anything special in the agent settings on the workstations (wapt-get.ini file).

The session_setup() function that is called is as follows:

Code: Select all

def session_setup():

    import os

    mkdirs(makepath(user_home_directory(),'.arduinoIDE'))

    with open(r'C:\cachefileWAPT\arduino-ide\arduino-cli.yaml', "r", encoding='utf-8') as fichier:
        data = fichier.read()

    data_modified=data.replace('username',os.environ['USERNAME'])

    with open(makepath(user_home_directory(),'.arduinoIDE','arduino-cli.yaml'), "w", encoding='utf-8') as fichier:
        fichier.write(data_modified)

    filecopyto(r'C:\cachefileWAPT\arduino-ide\settings.json',makepath(user_home_directory(),'.arduinoIDE'))

Apart from this single problem of the non-automatic launch of the session_setup function when a session is opened, the package works and the application installed and configured by it is functional (if the session_setup function is executed manually).

Could you help me solve this problem?
Best regards
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
jlepiquet
Messages: 69
Registration: Sep 3, 2024 - 4:09 p.m.

December 26, 2024 - 8:43 AM

Good morning,

This is a known bug on our end; the --hide parameter in the launched command is malfunctioning.

This issue is fixed in version 2.6.16714, which you can upgrade to.

Otherwise, here is the process to follow:
In

Code: Select all

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\WAPT session setup
Remove the --hide from the shortcut path

Code: Select all

"C:\Program Files (x86)\wapt\wapt-get.exe" session-setup ALL --hide

Code: Select all

"C:\Program Files (x86)\wapt\wapt-get.exe" session-setup ALL
And the Python code that automates this:

Code: Select all

start_menu_path = start_menu(1) # C:\\ProgramData\\Microsoft\\Windows\\Start Menu 
wapt_session_setup_shortcut = makepath(start_menu_path, 'Programs', 'Startup', 'WAPT session setup.lnk') 
r = winshell.Shortcut(wapt_session_setup_shortcut) 
r.arguments = r.arguments.replace(' --hide', '') 
r.write()
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

December 26, 2024 - 2:33 PM

Hello,

Thank you so much for your quick reply! :)

I'm glad to know that you identified this bug and that it's fixed in a new version of WAPT. We'll be installing it very soon. Thank you also for the temporary Python automation workaround.

Best regards
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
Locked