Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

setup to put icon on desktop

Posted on 1999-07-28
3
Medium Priority
?
208 Views
Last Modified: 2008-02-01
How do i get my setup application to automatically ask the user if he wishes to have a shortcut icon on the desktop, and if he says yes, get the setup routine to do it?
0
Comment
Question by:ldeutsch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Expert Comment

by:Pepster
ID: 1527964
As far as I know you have to edit the SETUP1.VBP in the VB Directory, but what you have to edit I don`t know.
0
 
LVL 14

Accepted Solution

by:
waty earned 60 total points
ID: 1527965
http://www.mvps.org/vbnet/code/shell/shshortcutcheat.htm


' #VBIDEUtils#************************************************************
' * Programmer Name  : Waty Thierry
' * Web Site         : www.geocities.com/ResearchTriangle/6311/
' * E-Mail           : waty.thierry@usa.net
' * Date             : 3/05/99
' * Time             : 10:12
' **********************************************************************
' * Comments         : Adding shortcuts to the Start menu
' *
' *
' **********************************************************************

'© Copyright 1998 Romke Soldaat. All Rights Reserved.
'-------------------------------------------------------------------
'The source code described in this article, and listed in this
'module, is copyrighted material which may not be published
'in any form without explicit prior permission from the author.
'However, you are free to use the source code in your private,
'non-commercial, projects without permission. You are allowed to
'use these functions and routines in commercial products, provided
'the documentation of these products makes a reference to the
'original source. The following reference is recommended:
'-------------------------------------------------------------------
'PART OF THIS SOFTWARE IS BASED ON SOURCE CODE, ORIGINALLY
'CREATED BY ROMKE SOLDAAT (WWW.OFFICETOYS.COM), AND PUBLISHED IN
'MICROSOFT OFFICE & VISUAL BASIC FOR APPLICATIONS DEVELOPER,
'BY INFORMANT COMMUNICATIONS GROUP (WWW.INFORMANT.COM)
'----------------------------------------------------------------

Public Sub vbCreateShortcut( _
   TargetPath As String, _
   Where As String, _
   DisplayName As String, _
   Optional Hotkey As Variant, _
   Optional IconLocation As Variant, _
   Optional WindowStyle As Variant, _
   Optional WorkingDirectory As Variant)
   'This routine creates a file or internet shortcut
   Dim WSHShell As Object
   Dim MyShortcut As Object
   Dim Extension As String
   'Is it an Internet or File shortcut?
   If InStr(TargetPath, "://") Then
      Extension = ".url"
   Else
      Extension = ".lnk"
   End If
   Set WSHShell = CreateObject("WScript.Shell")
   'See if Where is a full path
   If InStr(Where, "\") = 0 Then
      'If not, assume it's a special folder
      Where = WSHShell.SpecialFolders(Where)
   End If
   'Make sure there's trailing backslash
   If Right(Where, 1) <> "\" Then Where = Where & "\"
   Set MyShortcut = WSHShell.CreateShortcut(Where & _
      DisplayName & Extension)
   'Set shortcut object properties and save it
   With MyShortcut
      .TargetPath = TargetPath
      If Not IsMissing(Hotkey) Then .Hotkey = Hotkey
      If Not IsMissing(IconLocation) Then .IconLocation = IconLocation
      If Not IsMissing(WindowStyle) Then .WindowStyle = WindowStyle
      If Not IsMissing(WorkingDirectory) Then .WorkingDirectory = WorkingDirectory
      .Save
   End With
   Set WSHShell = Nothing

End Sub

Sub FileShortcutDemo()
   vbCreateShortcut _
      TargetPath:="C:\my documents\badges.mdb", _'''Your mdb
      Where:="C:\Windows\Desktop", _
      DisplayName:="Testshort"'Name the shortcut what you want
   'Hotkey:="ALT+CTRL+W", _'The following are optional
   ' IconLocation:="C:.DLL,16", _
   '  WindowStyle:="3", _
   ' WorkingDirectory:="C:documents"
End Sub


0
 
LVL 8

Expert Comment

by:vettranger
ID: 1527966
I take it you're using VB Package and Deployment Wizard (or the Setup Wizard for a version earlier than VB6)?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question