Create shortcut

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
User avatar
dvinouze
Messages: 4
Registration: May 21, 2019 - 08:41

August 5, 2019 - 3:30 PM

Good morning,
I'm having a small problem installing a shortcut on the desktop:
the function create_user_desktop_shortcut() goes back in error while this one create_desktop_shortcut() works correctly.
However, via pyscripter the installation is correct, both shortcuts are created.

Code: Select all

create_user_desktop_shortcut('Sillage', target='c:\\sillage\\sillage.bat', arguments='http://medprod-tom:52100/sillagePSDM/', wDir='c:\sillage', icon='c:\sillage\sillage.ico')
create_desktop_shortcut('Sillage', target='c:\\sillage\sillage.bat', arguments='http://medprod-tom:52100/sillagePSDM/', wDir='c:\sillage', icon='c:\sillage\sillage.ico')
WAPT console returns

Code: Select all

Installation de SillageInstallation du raccourciTraceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 3818, in install_wapt
    exitstatus = setup.install()
  File "c:\windows\temp\waptedrff6\setup.py", line 8, in install
  File "C:\Program Files (x86)\wapt\setuphelpers.py", line 486, in create_user_desktop_shortcut
    sc_path = os.path.join(desktop(0),label)
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 159, in desktop
    return get_path ((shellcon.CSIDL_DESKTOP, shellcon.CSIDL_COMMON_DESKTOPDIRECTORY)[common])
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 140, in get_path
    return shell.SHGetFolderPath (0, folder_id, None, 0)
com_error: (-2147024894, 'Le fichier sp\xe9cifi\xe9 est introuvable.', None, None)
0x80070002 : Le fichier spÚcifiÚ est introuvable.
The error appears to be related to the function sc_path = os.path.join(desktop(0),label) ...

Do you have any idea?
- Installed WAPT version (1.7.4)
- Server OS (Debian Stretch 9.9)
- Administration/package creation machine OS (Windows 10 - 1903)
User avatar
eblaudy
WAPT Expert
Messages: 16
Registration: August 5, 2019 - 2:15 PM

August 8, 2019 - 2:42 PM

Hello,

Could you try using the `makepath` function from setuphelpers to create your paths (by the way, one of them is missing a backslash)?

It handles creating the paths directly; you can use it like this: `makepath('c:','sillage','sillage.bat')`

Best regards,

Evan Blaudy
Developer WAPT at TRANQUIL IT
Guillaume_I
Messages: 10
Registration: March 15, 2024 - 4:34 PM

March 15, 2024 - 5:17 PM

Good morning,

Sorry to resurrect this old thread, but I have exactly the same problem and I can't find a solution.
I do this:
import from setuphelpers *

Code: Select all

def install():
    create_user_desktop_shortcut(r'WAPT Console Management', target='C://Program Files (x86)//wapt//waptconsole.exe')
It works perfectly with Pyscripter (I tried with different paths: c:\pro.., c:/pro...)

But via the wapt console:

Code: Select all

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4234, in install_wapt
    exitstatus = setup.install()
  File "C:\WINDOWS\TEMP\wapt8x3n6idv\setup.py", line 5, in install
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 3993, in create_user_desktop_shortcut
    sc_path = os.path.join(desktop(0), label)
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 159, in desktop
    return get_path ((shellcon.CSIDL_DESKTOP, shellcon.CSIDL_COMMON_DESKTOPDIRECTORY)[common])
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 140, in get_path
    return shell.SHGetFolderPath (0, folder_id, None, 0)
pywintypes.com_error: (-2147024894, 'Le fichier spécifié est introuvable.', None, None)

0x80070002 : Le fichier spécifié est introuvable
If anyone has any leads, thank you in advance.
Environment information:
WAPT Server OS version: Debian 12;
WAPT version: 2.6.0.16937 (Enterprise Edition);
OS of the machine from which the packages are created: Windows 10 22H2;
Secondary repository: Ubuntu 22.04
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

March 18, 2024 - 11:47

Hello Guillaume,

please refrain from posting dead threads; it complicates things for those who maintain the forum. Could you please start a new thread?

And could you please include the Wapt version, edition, operating system, etc. (basically, what's written in red in the forum rules...).

I'm closing this 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