Page 1 of 2

[Resolved] Package customization: Start menu

Published: March 26, 2018 - 3:00 PM
by Jonattend
Hello,

WAPT Server: Debian 9.0.3
WAPT Console: 1.3.1.3.0 on Windows 7 x64
WAPT Client: 1.3.13.0
Client machines: Running Win7 x32 or Win7 x64.

As a new WAPT user (thanks to JRES 2017 for the introduction), I would like to know if it is possible to customize the packages before installation?

I'd like to have shortcuts for office applications like LibreOffice placed in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Office Tools".
For multimedia software (VLC, Audacity, Format Factory, etc.), I'd like the Start Menu shortcuts to go to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Multimedia Tools,
and so on.

I've seen that it's possible to edit the setup.py file, but for VLC, for example, I haven't found anything in either the setup.py file or the switches available in their installer.
How can I do this?
The idea is to create a post-installation, zero-touch package tailored to the target machine.

Thanks for any suggestions. :)

Re: Package customization: Start menu

Published: March 26, 2018 - 4:34 PM
by agauvrit
Hello,

The easiest way is to delete the shortcuts at the end of the package installation and recreate them in the desired locations.

See the documentation: https://www.wapt.fr/fr/doc/CreationPaqu ... shortcuts

Alexandre

Re: Package customization: Start menu

Published: March 26, 2018 - 4:59 PM
by Jonattend
Hello,
unless I'm mistaken, we're talking about shortcuts on the user's desktop, not in the Start menu... right?
The idea of ​​deleting and recreating the shortcut is perfect. But is that possible in the Start menu?

Re: Package customization: Start menu

Published: March 26, 2018 - 5:10 PM
by agauvrit
My apologies, I read too quickly

For Start menu shortcuts, it's possible using the following functions: remove_programs_menu_shortcut And create_programs_menu_shortcut

Re: Package customization: Start menu

Published: March 27, 2018 - 08:15
by Jonattend
Shame on me for not reading the entire document... I'll look into that and give feedback.

Thanks for the tip ;)

Re: [SOLVED] Package customization: Start menu

Published: April 9, 2018 - 5:09 PM
by Jonattend
Hello,
what would be the correct syntax, for example, to create a VLC shortcut in the Start menu (All Users)\Multimedia Tools\?

In the `def install()` function, right after `remove_desktop_shortcut`, I'd be tempted to use `create_programs_menu_shortcut`, but I'm unsure about the arguments to pass... in the example with the WAPT Console, not all the arguments are used?

Re: Package customization: Start menu

Published: April 11, 2018 - 10:45 AM
by htouvet
With Wapt 1.5.1.23:

Code: Select all

def install():
    ...
    create_programs_menu_shortcut('VLC',target=makepath(programfiles64,'VideoLAN','VLC','vlc.exe'),folder=u'Outils multimédias')
    

Re: Package customization: Start menu

Published: April 11, 2018 - 10:08 PM
by vcardon
Hello Jonattend,

Hubert suggests a solution using WAPT version 1.5, while you're currently on 1.3. There's a good chance Hubert's suggestion will work for you in the short term.

Your best option is to upgrade to 1.5. Version 1.5 is far superior to 1.3, and you'll receive reliable advice and suggestions every time.

At Tranquil IT, version 1.3 will quickly become obsolete because fewer and fewer public repositories will provide ready-to-use packages for WAPT 1.3.

Version 1.5 is really good and doesn't justify staying on 1.3.

Regards,

Vincnet

Re: Package customization: Start menu

Published: April 12, 2018 - 1:51 PM
by Jonattend
Hello,

thank you for your replies.

When I wrote this request, I was indeed on version 1.3, but I've since upgraded to 1.5 :D (see signature)

. I'll run some tests and post an update. ;)

Re: [SOLVED] Package customization: Start menu

Published: May 11, 2018 - 4:04 PM
by Jonattend
Good morning,
I was (finally) able to run some tests again... and it works :)

I'm posting my memo here, which might be useful to others in need:

WAPT: Modify an application shortcut: example: the VLC shortcut should land in Programs\Multimedia Tools\

- Open the setup.py file using PyScripter
- in the "def install()" section, insert:

Code: Select all

 print("Creation du raccourci vers Outils Multimedias ....")
  # creation du raccourci dans le menu demarrer, programmes, outils multimedias ...
  create_programs_menu_shortcut('VLC',target=makepath(programfiles64,'VideoLAN','VLC','vlc.exe'),folder=u'Outils Multimedias')
  # suppression du raccourci de l application dans le menu demarrer, programmes ... sinon deux raccourcis seront créés : celui par défaut et celui qu'on a ajouté
  remove_tree(r'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\VideoLAN')

- save the changes
- Perform a test on the test machine via Run Configurations, install
- If the test is OK, run Configurations, -i-build-upload to upload the package to the server

Result: when installing VLC via WAPT, the shortcut will go in Programs\Multimedia Tools.

Thank you for your help :)

:) :)