Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Installation query 1

Status
Not open for further replies.

vinodi

Programmer
May 23, 2003
41
IN
Hi,

Is there a way to create a shortcut of my application on the desktop using the Package and Deployment Wizard. I mean should I tinker with setup.lst to something about it?
 
That code looks pretty good, but since it says "I needed to create a shortcut in the Startup group, not on the Desktop. " I think I can help.

I found some VBA code about a year ago that I saved just incase I ever needed to create a shortcut on the desktop. Unfortunately I have no idea where it came from or who the author is. (It may have come from tek-tips.) I do however, know it works.
I believe if you just create a function somewhere in your setup1.vbp and call it before the setup1.exe ends it should work.

Private Sub Command0_Click()
Dim objShell As IWshShell_Class
Dim objShortcut As IWshShortcut_Class
Dim FolderItem As Variant
Dim lsPath As String
Dim lsShortCut As String
Dim lsURL As String
Dim lsConfigFileName As String
Dim nType As Variant

Set objShell = New IWshShell_Class

lsShortCut = "Shortcut to Test.mdb"
lsPath = Chr(34) & "C:\Test.mdb" & Chr(34)

'lsShortCut = App.Title
'lsPath = App.Path & "\" & App.EXEName

For Each FolderItem In objShell.SpecialFolders
If Mid(FolderItem, Len(FolderItem) - 6, 7) = "Desktop" And _
InStr(1, FolderItem, "All Users") = 0 And _
InStr(1, UCase(FolderItem), "ADMINISTRATOR") = 0 Then
Set objShortcut = objShell.CreateShortcut(FolderItem & _
"\" & _
lsShortCut & _
".lnk")
objShortcut.TargetPath = lsPath
objShortcut.Arguments = lsURL & " " & _
lsConfigFileName & " " & _
CStr(nType)
objShortcut.Save
End If
Next

End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top