Results 1 to 3 of 3

Thread: Setup1.vbp

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    Egypt
    Posts
    179

    Setup1.vbp

    Hello,

    I have made an application using Visual Basic 5.0, I want to distribute
    my application using Setup wizard, but setup wizard by default doesn't provide
    option to make program group for the application.

    How can I alter the "Setup1.vbp" to make program group for my VB application and
    make shortcut for the application on Desktop.

    Thank you for help,
    Belal Marzouk

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    The code for shortcut on desktop:
    Using the OSfCreateShellLink API

    Code:
    'In a module
    
    Option Explicit
    Option Base 1
    Public Declare Function OSfCreateShellLink Lib "vb6stkit.dll" Alias "fCreateShellLink" _
             (ByVal lpstrFolderName As String, _
             ByVal lpstrLinkName As String, _
             ByVal lpstrLinkPath As String, _
             ByVal lpstrLinkArguments As String, _
             ByVal fPrivate As Long, _
             ByVal sParent As String) As Long
    
    Public Const gstrQUOTE$ = """"
    Public Sub CreateShellLink(ByVal strLinkPath As String, _
             ByVal strGroupName As String, _
             ByVal strLinkArguments As String, _
             ByVal strLinkName As String, _
             ByVal fPrivate As Boolean, _
             sParent As String, _
             Optional ByVal fLog As Boolean = True)
    Dim fSuccess As Boolean
    Dim intMsgRet As Integer
    Dim lREt       As Boolean
       strLinkName = strUnQuoteString(strLinkName)
       strLinkPath = strUnQuoteString(strLinkPath)
       
       If StrPtr(strLinkArguments) = 0 Then strLinkArguments = ""
       
       lREt = OSfCreateShellLink(strGroupName, strLinkName, strLinkPath, strLinkArguments, _
             fPrivate, sParent)    'the path should never be enclosed in double quotes
    
    End Sub
    
    
    Public Function strUnQuoteString(ByVal strQuotedString As String)
    '
    ' This routine tests to see if strQuotedString is wrapped in quotation
    ' marks, and, if so, remove them.
    '
        strQuotedString = Trim$(strQuotedString)
    
        If Mid$(strQuotedString, 1, 1) = gstrQUOTE Then
            If Right$(strQuotedString, 1) = gstrQUOTE Then
                '
                ' It's quoted.  Get rid of the quotes.
                '
                strQuotedString = Mid$(strQuotedString, 2, Len(strQuotedString) - 2)
            End If
        End If
        strUnQuoteString = strQuotedString
    End Function
    
    'On a form
    On Error GoTo EH
       CreateShellLink "c:\hello.exe", "..\..\Desktop", , "Hello", True, "$(Programs)"
    
       'CreateShellLink strProgramPath, strGroup, strProgramArgs, strProgramIconTitle, True, sParent
       
       Exit Sub
    EH:
       MsgBox Err.Description
       Exit Sub

    This example would create a shortcut to "C:\hello.exe", on the Desktop, with a caption of "Hello"



    This thread might help you

    How To Make My Project Run While Every Time Windows Start ?

  3. #3
    Megatron
    Guest
    See this link.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width