Page 1 of 1

[RESOLVED] URL Packet

Published: November 5, 2019 - 1:35 PM
by Smart
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

Re: URL Package

Published: November 6, 2019 - 11:15 AM
by Smart
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 :)

Re: [RESOLVED] URL Packet

Published: November 6, 2019 - 11:42 AM
by Gaetan

Re: [RESOLVED] URL Packet

Published: November 6, 2019 - 2:26 PM
by Smart

Code: Select all

def uninstall():
    print('Removing ELI')
    remove_desktop_shortcut('ELI')
    remove_user_desktop_shortcut('ELI')
Thanks, but it doesn't work...

Re: [RESOLVED] URL Packet

Published: November 6, 2019 - 3:09 PM
by Gaetan
Try creating the shortcut with this function:
https://wapt.tranquil.it/wapt/nightly/a ... p_shortcut
I think it's missing the label ;)

Re: [RESOLVED] URL Packet

Published: November 6, 2019 - 3:53 PM
by Smart

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...

Re: [RESOLVED] URL Packet

Published: November 6, 2019 - 3:57 PM
by Gaetan
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.

Re: [RESOLVED] URL Packet

Published: November 6, 2019 - 4:09 PM
by Smart
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.

Re: [RESOLVED] URL Packet

Published: November 6, 2019 - 4:19 PM
by Gaetan

Re: [RESOLVED] URL Packet

Published: November 7, 2019 - 7:33 AM
by Smart
THANKS :)