[RESOLVED] URL Packet

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
Smart
Messages: 45
Registration: July 2, 2018 - 11:11
Location: Laon

November 5, 2019 - 1:35 PM

WAPT 1.7.4 - CentOS Server - OS Machine Admin under Windows Server 2016.

Good morning, gentlemen
I want to create a package that creates a website shortcut on the desktop and adds a specific icon. Currently, I have this:

Code: Select all

from setuphelpers import *

uninstallkey = []

destdir = makepath(programfiles32,'ELI')

def install():
    print('installing test-eli')
    mkdirs(destdir)
    filecopyto('icone.ico',makepath(programfiles32,'ELI'))
    create_desktop_shortcut('ELI', target = "http://*******, wDir="C:\Program Files (x86)\ELI", icon="C:\Program Files (x86)\EVA\icone.ico")

def uninstall():
    print('Removing ELI')
    remove_desktop_shortcut('ELI')
    remove_tree(destdir)
Problem: it doesn't accept the icon.
Do you have a solution?

Sincerely
Last edited by Futé on 06 Nov 2019 - 14:27, edited 2 times.
Smart
Messages: 45
Registration: July 2, 2018 - 11:11
Location: Laon

November 6, 2019 - 11:15

Okay, I've figured out the installation:

Code: Select all

def install():
    print("installing test-eli")
    filecopyto(ur"icone.ico",makepath("C:","Windows"))
    create_shortcut(makepath(common_desktop(),ur"ELI.URL"),target=r'http://****', icon=makepath('C:','Windows','icone.ico'))
I don't know how to "uninstall" it yet, but I'll figure it out :)
Last edited by Futé on 06 Nov 2019 - 14:27, edited 1 time.
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

November 6, 2019 - 11:42

Smart
Messages: 45
Registration: July 2, 2018 - 11:11
Location: Laon

November 6, 2019 - 2:26 PM

Code: Select all

def uninstall():
    print('Removing ELI')
    remove_desktop_shortcut('ELI')
    remove_user_desktop_shortcut('ELI')
Thanks, but it doesn't work...
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

November 6, 2019 - 3:09 PM

Try creating the shortcut with this function:
https://wapt.tranquil.it/wapt/nightly/a ... p_shortcut
I think it's missing the label ;)
Smart
Messages: 45
Registration: July 2, 2018 - 11:11
Location: Laon

November 6, 2019 - 3:53 PM

Code: Select all

create_user_desktop_shortcut('ELI',target=r'http://****', icon=makepath('C:','Windows','icone.ico'))
I tried that, but it doesn't recognize the specified path...
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

November 6, 2019 - 3:57 PM

Try it like this instead:

Code: Select all

create_user_desktop_shortcut(r'ELI',target='http://****', icon=makepath('C:','Windows','icone.ico'))
The 'r' is not used for the target.
Smart
Messages: 45
Registration: July 2, 2018 - 11:11
Location: Laon

November 6, 2019 - 4:09 PM

Still nothing, it's showing me the following error:

Code: Select all

com_error: (-2147024894, 'Le fichier sp\xe9cifi\xe9 est introuvable.', None, None)
0x80070002 : Le fichier spÚcifiÚ est introuvable.
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

November 6, 2019 - 4:19 PM

Smart
Messages: 45
Registration: July 2, 2018 - 11:11
Location: Laon

November 7, 2019 - 7:33 AM

THANKS :)
Locked