Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a Desktop Link
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00394305
Message ID:
00394367
Vues:
10
Here is a program I use as a post setup exe that will create the shortcut. Have the setup wizard place this file (shortcuts.exe) into the program directroy and call it as the post setup exe. Also, startup.exe is the application launcher.

LOCAL oShortcut, cDesktopDir, oLnk, lcHomeDir, lcEXE

*- Get list of exe's in application directory
lcHomeDir = JUSTPATH(SYS(16, 0))
= ADIR(aFiles, '*.exe')

*- Get name of application EXE
FOR i = 1 TO ALEN(aFiles, 1)
IF aFiles[i, 1] != 'STARTUP.EXE' .AND. aFiles[i, 1] != 'SHORTCUTS.EXE'
lcEXE = aFiles[i, 1]
EXIT
ENDIF
NEXT

*- Create shortcut file
oShortcut = CREATEOBJECT('Wscript.Shell')
cDesktopDir = oShortcut.SpecialFolders('Desktop')
oLnk = oShortcut.CreateShortCut(cDesktopDir + '\\' + SUBSTR(lcEXE, 1, (LEN(lcEXE) - 4)) + '.lnk')

*- Is there a startup program?
*- Point shortcut at file
IF FILE(lcHomeDir + '\STARTUP.EXE')
oLnk.TargetPath = lcHomeDir + '\STARTUP.EXE'
ELSE
oLnk.TargetPath = lcHomeDir + '\' + lcEXE
ENDIF

oLnk.WorkingDirectory = lcHomeDir
oLnk.SAVE()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform