How to Modify SetupKit to Install New Icon & Working DirectoryLast reviewed: February 16, 1996Article ID: Q114774 |
The information in this article applies to:
- Standard and Professional Edition of Microsoft Visual Basic for Windows, version 3.0
SUMMARYUsing the Visual Basic Setup Toolkit, you can modify the setup program that was created by Setupwizard. The example shown below modifies your setup program to install a separate icon and default working directory for your program. You can do this by changing the SETUP1A.FRM and SETUP1.BAS source code. You can then make a new SETUP1.EXE file and new SETUP1.EX_ file on your distribution disk. For additional information regarding the updates and other modifications you can make to the SetupKit, please see the following articles in the Microsoft Knowledge Base: ARTICLE-ID: Q110395 TITLE : How to Modify Destination Directory of Setupwizard SETUP1.EXEARTICLE-ID: Q100003 TITLE : UPD: New Setup Toolkit & Setup Wizard Available for VB ver 3.0 MORE INFORMATION
Step-by-Step ExampleThe following step-by-step example, is based on an example developed by Jim St. John:
'---------------------------------------------------------- ' Procedure: CreateProgManItem ' ' Arguments: X The form where Label1 exists ' ' CmdLine$ A string that contains the command ' line for the item/icon. ' ie 'c:\myapp\setup.exe' ' ' IconTitle$ A string that contains the item's ' caption ' ' IconPath$ A string that contains the filename ' for the icon to be displayed in the ' group window ' ' IconIndex Specifies the index of the icon in ' the file indicated by the IconPath$ ' parameter ' -1 for default icon ' ' xPos Specifies the horizontal position ' of the icon in the group window ' -1 for next icon in group ' ' yPos Specifies the vertical position ' of the icon in the group window ' -1 for next icon in group ' ' DefDir$ A string that contains the name of ' the default (or working) directory ' Win 3.1 ' ' HotKey Identifies a hot (or shortcut) key ' that is specified by the user ' Win 3.1 ' NOTE: For the HotKey parameter, specify the ASCII ' value of the desired key. The application can ' create a key combination (for example, ALT+SHIFT+A) ' by adding one or more of the following values to ' the ASCII value for the key: ' ' Decimal ' Key Offset ' --- ------ ' SHIFT 256 ' CTRL 512 ' ALT 1024 ' ' For example, ALT+SHIFT+A is signified by 1345 ' (1024+256+65). ' ' fMinimize Specifies whether an application ' should be minimized when it is ' first displayed ' Win 3.1 ' '---------------------------------------------------------- ' Enter the following two lines as one, single line: Sub CreateProgManItem (x As Form, CmdLine$, IconTitle$, IconPath$, IconIndex, xPos, yPos, DefDir$, HotKey, fMinimize) Dim sParam As String ... ' Add the following lines in place of the single LinkExecute line above sParam = CmdLine$ + "," + IconTitle$ sParam = sParam + "," + IconPath$ + "," If IconIndex >= 0 Then sParam = sParam + Format$(IconIndex) sParam = sParam + "," + Format$(xPos) + "," + Format$(yPos) If gfWin31% Then ' Win 3.1 - additional parameters allowed sParam = sParam + "," + DefDir sParam = sParam + "," If HotKey Then sParam = sParam + Format$(HotKey) sParam = sParam + "," If fMinimize Then sParam = sParam + Format$(fMinimize) End If x.Label1.LinkExecute "[AddItem(" + sParam + ")]" ... End Sub CreateProgManItem Setup1, destPath$ + "<your>.EXE", "your title" Change it to read:
' The following installs your program's icon setting it to be used ' from the the destination directory. It also sets the default working ' directory as the windows directory. ' Enter the following two lines as one, single line: CreateProgManItem Setup1, destPath$ + "<your>.EXE", "your title", destPath$ + "your.ico", -1, -1, -1, winDir$, 0, 0 CreateProgManItem Setup1, destPath$ + "ODBCADM.EXE", "ODBC Administrator" Change it to read: ' Enter the following three lines as one, single line: CreateProgManItem Setup1, destPath$ + "ODBCADM.EXE", "ODBC Administrator", destPath$ + "ODBCADM.EXE", -1, -1, -1, destPath$, 0, 0 in the C:\VB\SETUPKIT\SETUP1 directory. C:\VB\SETUPKIT\KITFILES\COMPRESS -r SETUP1.EXE A:\ This replaces the old SETUP1.EX_ created on the distribution disk by the Setupwizard.
|
Additional reference words: 3.00 CustomerContrib
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |