KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q193082: HOWTO: Build a Setup Program Creating Multiple Groups and Icons

Article: Q193082
Product(s): Microsoft Visual Basic for Windows
Version(s): WINDOWS:5.0
Operating System(s): 
Keyword(s): kbGrpDSVB
Last Modified: 11-JAN-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Visual Basic Professional Edition for Windows, version 5.0 
- Microsoft Visual Basic Enterprise Edition for Windows, version 5.0 
-------------------------------------------------------------------------------

SUMMARY
=======

By default, the Microsoft Visual Basic 5.0 Setup Wizard creates one program
group using the project name, and one icon within the program group for the
executable file generated by the project. This article shows how to create
additional program groups and more than one icon within a group for any
additional executable files you want to ship by customizing the Visual Basic
Setup Toolkit's Setup1.vbp project.

NOTE: Microsoft Technical Support does not support the modification of the setup
process or any of the setup files. Support is provided for the Setup Wizard on
an "as is" basis only.

MORE INFORMATION
================

To allow for multiple group and icon creation, the Setup Toolkit uses
CreateShellGroup and CreateOSLink procedures. These procedures can be used to
create custom groups and icons.

NOTE: Before making any modifications to the Setup1.vbp, backup the contents of
the Setup1 directory. This directory can be located in the following path:

  c:\program files\devstudio\vb\setupkit\setup1\setup1.vbp
  (Modify path information accordingly.)

Step-By-Step
------------

1. Start Microsoft Visual Basic and open the Setup1.vbp project located in the
  following directory by default:

  c:\program files\devstudio\vb\setupkit\setup1\setup1.vbp
  (Modify path information accordingly.)

2. In the Project Explorer window, click to expand the Forms collection.

3. Right-click on the form "frmSetup1" and click View Code.

4. In the Form_Load event, locate the following line of code:

     CreateOSLink frmSetup1, strGroupName, gsDest.strAppDir & "My Exe 1.exe",
           "My Exe 1 command-line arguments", "My Exe 1"

  NOTE: The line above represents one line of code.

5. The lines of code below demonstrate how an additional group and icon can be
  created:

        'Allows for creation of additional icons
        fAdditionalIcons = True
        'Creates a group entitles "My Group" on the Programs menu
        fCreateShellGroup "My Group", False, True
        'Creates a shortcut in the "My Group" folder, where the target
        'application is test.exe and is entitled "My test exe file"
        CreateOSLink frmSetup1, "My Group", gsDest.strAppDir & "test.exe", _
        "", "My test exe file"

6. On the File menu, click Make Setup1.exe. If desired, save the Setup Toolkit
  project and exit Visual Basic.

7. Use the Setup Wizard as normal to create the application distribution set.

REFERENCES
==========

For additional information, please see the following articles in the Microsoft
Knowledge Base:

  Q193270 : INFO: Troubleshooting VB Application Installation Issues

  Q189738 : HOWTO: Run Setup1.vbp in the Design Environment

Additional query words: kbdss kbDSupport kbVBp kbVBp500 kbAppSetup kbWizard kbToolKit

======================================================================
Keywords          : kbGrpDSVB 
Technology        : kbVBSearch kbAudDeveloper kbZNotKeyword6 kbZNotKeyword2 kbVB500Search kbVBA500 kbVB500
Version           : WINDOWS:5.0
Issue type        : kbhowto

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.