Creating shortcuts on the public desktop

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
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

March 1, 2016 - 2:18 PM

Good morning,

I'm stuck on creating a shortcut in a folder on the public desktop. `mkdirs` correctly creates the "Miscellaneous" folder, but then neither of the two `create_shortcut` lines adds a shortcut...

Code: Select all

if not isdir(makepath(common_desktop(),'Logiciels','Divers')):
        mkdirs(makepath(common_desktop(),'Logiciels','Divers'))
        create_shortcut(makepath(common_desktop(),'Logiciels','Divers','Ebeam Home'),target=u'C:\Program Files (x86)\Luidia\eBeam Interactive Suite\eBeamHome\eBeamHome.exe')
        create_shortcut(makepath(common_desktop(),'Logiciels','Divers','Ebeam Home'),target=makepath('C:\\','Program Files (x86)','Luidia','eBeam Interactive Suite','eBeamHome','eBeamHome.exe'))
Last edited by gaelds on March 4, 2016 - 09:38, edited 1 time.
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

March 1, 2016 - 3:13 PM

create_desktop_shortcut creates a shortcut on the shared desktop, so you don't need to go through the path.

https://dev.tranquil.it/sphinxdocs/sour ... p_shortcut

Something like this should work:

Code: Select all

def install():
    mkdirs(makepath(common_desktop(),'Logiciels','Divers'))
    create_desktop_shortcut(makepath('Logiciels','Divers','Ebeam Home.lnk'),target=makepath(programfiles32,'Luidia','eBeam Interactive Suite','eBeamHome','eBeamHome.exe'))
Tranquil IT
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

March 3, 2016 - 4:12 PM

Yes, it works, thank you very much!
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

March 4, 2016 - 09:38

Sorry, same problem today using the same code for the Scratch software; the shortcut won't create. I can't see what could be wrong with the code...

Code: Select all

    if not isdir(makepath(common_desktop(),'Logiciels','Informatique Programmation')):
        mkdirs(makepath(common_desktop(),'Logiciels','Informatique Programmation'))
    create_desktop_shortcut(makepath('Logiciels','Informatique Programmation','Scratch.lnk'),target=makepath(programfiles32,'Scratch 2','Scratch 2.exe'))
The executable is indeed located in "C:\Program Files (x86)\Scratch 2\Scratch 2.exe". No errors were reported during installation.
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

March 4, 2016 - 09:53

That seems about right to me.
At least, it works here...
Tranquil IT
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

March 4, 2016 - 11:43

Yes, I don't understand it at all; the same lines of code work in my PhotoFiltre package.
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

March 7, 2016 - 09:56

Perhaps the indentation?
Locked