[SOLVED] Shortcut creation problem

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
Clement
Messages: 2
Registration: December 20, 2022 - 12:25

December 27, 2022 - 5:52 PM

Good morning,

Installed WAPT version: 2.2.3.12481, Enterprise edition.
Server OS:
Operating system (administrative machine/package creation): Windows 10

(I have put the information specific to my company in brackets.)

I'm having trouble creating a package. I want to create a desktop shortcut that points to our ticketing tool, and for that, I created this Python script:

Code: Select all

def session_setup():
    create_user_desktop_shortcut(r'Formulaire-GLPI',target='http://support-informatique[...].fr/')
I don't get an error message when I run "wapt:session-setup" from PyScripter:

Code: Select all

Command Line : session-setup "c:\waptdev\[...]-FormulaireGLPI_1_x64_Windows_PROD-wapt\WAPT\.."
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Configuring c:\waptdev\[...]-FormulaireGLPI_1_x64_Windows_PROD-wapt ...
Running session_setup for package [...]-FormulaireGLPI(=1-0) and user [...]
Done
But I don't have a shortcut added to my desktop.
My boss ran it on his machine and it works, so it's not the script.

I think it might be due to a config file on my machine but I can't see which one (I've already gone through wapt-get.ini).

I'm afraid I'll be blocked from creating any more packages.

Do you have any idea what could be causing this?

Thank you in advance.


Sincerely,
Clement
julien.guyonnet
Messages: 12
Registration: Apr 21, 2021 - 10:38

December 27, 2022 - 6:34 PM

Hello,

I find the behavior of session_setup sometimes difficult to predict.

This is linked to the various launch contexts:
- from Pyscripter (launched with an admin account on the development machine)
- package installation from the wapt console (only one user logged into the machine)
- from the self-service
- during shutdown.

The question I consistently ask myself is, "Which account is it running under?"
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

December 29, 2022 - 11:54 AM

julien.guyonnet wrote: Dec 27, 2022 - 6:34 PM - from Pyscripter (launched with an admin account on the dev machine)
with the session that launched PyScripter, therefore the admin account

julien.guyonnet wrote: Dec 27, 2022 - 6:34 PM - Package installed from the wapt console (only one user connected to the machine)
The session setup will be launched in all sessions opened with the user's account (this is an impersonation)
julien.guyonnet wrote: Dec 27, 2022 - 6:34 PM - from the self-service area
Same as the previous case (impersonation)

julien.guyonnet wrote: Dec 27, 2022 - 6:34 PM - during the extinction
No session is open at this time, so session setup is not launched. However, since session setup is opened every time a session is opened, it will run at the next session opening

ATTENTION :arrow:

It's important to remember that session setup runs only once per package version and only once per session. Therefore, if you create a shortcut on a user's desktop and they delete it, the next execution of session setup will not recreate the shortcut, as it has already been run in the session for package version 1.0-2.
Clement
Messages: 2
Registration: December 20, 2022 - 12:25

January 3, 2023 - 5:50 PM

Good morning,

I created a new script this time for the Office 365 installation:

Code: Select all

def install():

    if not installed_softwares(u'O365BusinessRetail'):
        print('Microsoft Office 365: Installation en cours...')

        run(u'OfficeSetup.exe /configure ConfigurationOffice365.xml',timeout=2000,accept_returncodes=[1641,3010,0])

        print('Microsoft Office 365: Installation OK')
    else:
        print('Microsoft Office 365: Deja installe!')

    if not isdir(makepath(programefiles,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
        mkdirs(makepath(programefiles,'Microsoft Office','OfficeClickToRunWAPTUninstall'))
    filecopyto ('OfficeSetup.exe',makepath(programfiles,'Microsoft Office','OfficeClickToRunWAPTUninstall','ConfigurationUninstall.xml'))

def uninstall():

    print('Microsoft Office 365: Desinstallation...')

    #Closing applications:
    killalltasks(['WINWORD.EXE','POWERPNT.EXE','EXCEL.EXE','MSPUB.EXE','MSACCESS.EXE','ONEDRIVE.EXE','OUTLOOK.EXE','ONENOTE.EXE','Teams.exe'])

    #Uninstalling:
    if installed_softwares(u'O365BusinessRetail'):
        if isfile(makepath(programfiles,'Microsoft Office','OfficeClickToRunWAPTUninstall','OfficeSetup.exe')):
            run('"' + makepath(programfiles,'Microsoft Office','OfficeClickToRunWAPTUninstall','OfficeSetup.exe') + r'" /configure UninstallOffice365.xml',timeout=2000,accept_returncodes=[1641,3010,0])
            remove_file(makepath(programfiles,'Microsoft Office','OfficeClickToRunWAPTUninstall','OfficeSetup.exe'))
            remove_file(makepath(programfiles,'Microsoft Office','OfficeClickToRunWAPTUninstall','UninstallOffice365.xml'))
            if dir_is_empty(makepath(programfiles,'Microsoft Office','OfficeClickToRunWAPTUninstall')):
                remove_tree(makepath(programfiles,'Microsoft Office','OfficeClickToRunWAPTUninstall'))

    print('Microsoft Office 365: Desinstallation terminee')
Same as before: no error message, but not the expected result either:

Code: Select all

Command Line : install "c:\waptdev\[...]-microsoft-office_16.0.15225.20288_x64_Windows_PROD\WAPT\.."
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Installing WAPT files c:\waptdev\[...]-microsoft-office_16.0.15225.20288_x64_Windows_PROD
Installing: OfficeSetup.exe
Installing: OfficeSetup.exe (16.0.15225.20288)

Results :

 === install packages ===
  c:\waptdev\[...]-microsoft-office_16.0.15225.20288_x64_Windows_PROD | [...]-microsoft-office (16.0.15225.20288-0)
Since I already have Office installed on my computer, I should at least have received the message "Microsoft Office 365: Already installed!" but nothing happens.

Any ideas?

Thank you in advance.


Sincerely,
Clement
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

January 4, 2023 - 12:34

Hello Clément,

please do not reuse an existing thread for a new topic. If you have a new question, please start a new thread.

Regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked