[SOLVED] Programs Menu Shortcut: Create Folder?

Questions about WAPT Packaging / Requêtes et aides autour des paquets Wapt.
Règles du forum
Règles du forum communautaire
* English support on www.reddit.com/r/wapt
* Le support communautaire en français se fait sur ce forum
* Merci de préfixer le titre du topic par [RESOLU] s'il est résolu.
* Merci de ne pas modifier un topic qui est taggé [RESOLU]. Ouvrez un nouveau topic en référençant l'ancien
* Préciser version de WAPT installée, version complète ET numéro de build (2.2.1.11957 / 2.2.2.12337 / etc.) AINSI QUE l'édition Enterprise / Discovery
* Les versions 1.8.2 et antérieures ne sont plus maintenues. Les seules questions acceptées vis à vis de la version 1.8.2 sont liés à la mise à jour vers une version supportée (2.1, 2.2, etc.)
* Préciser OS du serveur (Linux / Windows) et version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019)
* Préciser OS de la machine d'administration/création des paquets et de la machine avec l'agent qui pose problème le cas échéant (Windows 7 / 10 / 11 / Debian 11 / etc.)
* Eviter de poser plusieurs questions lors de l'ouverture de topic, sinon il risque d'être ignorer. Si plusieurs sujet, ouvrir plusieurs topic, et de préférence les uns après les autres et pas tous en même temps (ie ne pas spammer le forum).
* Inclure directement les morceaux de code, les captures d'écran et autres images directement dans le post. Les liens vers les pastebin, les bitly et autres sites tierces seront systématiquement supprimés.
* Comme tout forum communautaire, le support est fait bénévolement par les membres. Si vous avez besoin d'un support commercial, vous pouvez contacter le service commercial Tranquil IT au 02.40.97.57.55
jnicol
Messages : 2
Inscription : 09 mars 2018 - 15:27

09 mars 2018 - 15:31

Hi,

I have been using

Code : Tout sélectionner

create_programs_menu_shortcut
to make shortcuts in the Programs Menu under Windows 10.

I would like to create a folder in the Programs Menu with my shortcuts arranged inside the folder. Can this be done? Is there a function that will do this?

Here is an example:

FOLDER1
- Shortcut1
- Shortcut2
FOLDER2
- Shortcut 3
- Shortcut 4

Thanks in advance.
John
Avatar de l’utilisateur
htouvet
Expert WAPT
Messages : 402
Inscription : 16 mars 2015 - 10:48
Contact :

09 mars 2018 - 16:24

there are 2 issues in the create_programs_menu_shortcut function:
  • it does not create subfolders of start programs menu prior to create the shortcut.
    it creates the shortcuts in \startup and not in \startup\Programs
I have pushed a fix which will be included in final 1.5.1.

https://github.com/tranquilit/WAPT/comm ... f5c613da0c

meanwhile, you can workaround by using

Code : Tout sélectionner

winshell.programs
function which returns the StartPrograms path and add your subfolder

Code : Tout sélectionner

import winshell
sc_path = makepath(winshell.programs(1),'FOLDER1','Shortcut1')  
ensure_dir(sc_path)
create_shortcut(sc_path,makepath(programfiles32,'myapp','toto.exe')) 
Tranquil IT
jnicol
Messages : 2
Inscription : 09 mars 2018 - 15:27

13 mars 2018 - 09:16

Thank you very much! I will give this a shot.

Regards
John
htouvet a écrit : 09 mars 2018 - 16:24 there are 2 issues in the create_programs_menu_shortcut function:
  • it does not create subfolders of start programs menu prior to create the shortcut.
    it creates the shortcuts in \startup and not in \startup\Programs
I have pushed a fix which will be included in final 1.5.1.

https://github.com/tranquilit/WAPT/comm ... f5c613da0c

meanwhile, you can workaround by using

Code : Tout sélectionner

winshell.programs
function which returns the StartPrograms path and add your subfolder

Code : Tout sélectionner

import winshell
sc_path = makepath(winshell.programs(1),'FOLDER1','Shortcut1')  
ensure_dir(sc_path)
create_shortcut(sc_path,makepath(programfiles32,'myapp','toto.exe')) 
Verrouillé