UPD: New Setup Toolkit & Setup Wizard Available for VB ver 
Q100003

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

- Microsoft Visual Basic programming system for Windows, version 3.0
---------------------------------------------------------------------

SUMMARY
=======

Several bugs were fixed in the Visual Basic Setup Toolkit and Setup Wizard
after Visual Basic version 3.0 was released. The latest release of each of
these updated files (version 1.00.002 of SETUP.EXE, version 1.00.002 of
the Setup1 project files, and version 1.00.551 of the Setup Wizard) can be
found in the self-extracting file SETUPK.EXE. In addition, as of June 1994,
SETUPK.EXE also includes WW1000.EXE, a self-extracting file that is also
available separately in the Microsoft Software Library (MSL).

WW1000.EXE is a self extracting file that contains two files (README.TXT
and VSHARE.386). VSHARE.386 currently ships as a component of Microsoft
Windows for Workgroups versions 3.1 and 3.11, so you may already have it.
The VSHARE.386 file is a driver that eliminates the need for SHARE.EXE
when you run Windows version 3.1 in 386 enhanced mode. README.TXT is
an Application Note that describes the installation and use of the
VSHARE.386 driver. By installing and using VSHARE.386, you will prevent
all known sharing violation errors when using the Setup Wizard to create
installation disks. For more information, please see the "Problems and
Limitations" section in this article.

NOTE: VSHARE.386 is exclusively a Windows utility. If you need a file
sharing utility for MS-DOS, you still need to use SHARE.EXE.

How to Get SETUPK.EXE
---------------------

Download SETUPK.EXE, a self-extracting file, from the Microsoft Software
Library (MSL) on the following services:

 - CompuServe
      GO MSL
      Search for SETUPK.EXE
      Display results and download

 - Microsoft Download Service (MSDL)
      Dial (206) 936-6735 to connect to MSDL
      Download SETUPK.EXE

 - Internet (anonymous FTP)
      ftp ftp.microsoft.com
      Change to the \softlib\mslfiles directory
      Get SETUPK.EXE

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

The following sections outline the bugs that were fixed and give specific
instructions on how to install the updated files.

Installation
------------

After downloading SETUPK.EXE, run it in an empty directory to obtain the
files it contains. Then copy the following files to the following locations
on top of the existing files by the same name. (This assumes that you have
installed Visual Basic in to the default directory C:\VB and Microsoft
Windows in the C:\WINDOWS directory.)

SETUP.EXE         ->  C:\VB\SETUPKIT\KITFILES\SETUP.EXE
SETUP1.FRM        ->  C:\VB\SETUPKIT\SETUP1\SETUP1.FRM
SETUP1.FRX        ->  C:\VB\SETUPKIT\SETUP1\SETUP1.FRX
SETUP1.BAS        ->  C:\VB\SETUPKIT\SETUP1\SETUP1.BAS
SETUPWIZ.EXE      ->  C:\VB\SETUPKIT\KITFILES\SETUPWIZ.EXE
SETUPWIZ.INI      ->  C:\WINDOWS\SETUPWIZ.INI
                      and C:\VB\SETUPKIT\KITFILES\SETUPWIZ.INI

NOTE: Please update lines 2 through 5 of the SETUPWIZ.INI file
to reflect the directory where you installed Visual Basic if it is
different from the C:\VB directory.

The SETUPWIZ.INI file included here does not reflect the changes necessary
to use the Access 2.0 Compatibility Layer files.

For more details on the Compatibility Layer, please see the following
article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q113594
   TITLE     : Updated ACC2COMP.TXT for Jet 2.0/VB 3.0 Compatibility Layer

Distribution
------------

You can distribute these files royalty free with any Visual Basic
application that you create.

Setup Wizard Notes
------------------

To check the internal version number of your SETUPWIZ.EXE, open a copy
of the file in an editor, and search for the string "ver:" This will
show the version number. Visual Basic version 3.0 for Windows shipped
with SETUPWIZ.EXE version 1.00.532.

Version      Bugs Fixed
--------------------------------------------------------------------
1.00.533     When using "Save Template," you must enter a file name
             with extension. The extension is no longer required.
1.00.533     The "max" setting for the horizontal scrollbar on the Step
             Five screen is so large that the middle button of the
             scroll bar really can't be used. The max has been reset to
             a smaller value.
1.00.533     The standard command .PIF file may not have the EXECUTION =
             EXCLUSIVE on some computers. As a result, the DOS shells
             for compressing files may sit in the background. Now shell
             with parameter makes the task active with focus.
1.00.534     Minor tweaks to the user interface to widen the TEMPLATE
             buttons, added an accelerator to the R in Rebuild, and
             changed the accelerator in Exit to the 'x' key.
1.00.535     Start SetupWiz. Enter C:\. Click NEXT. This causes an
             untrapped error: "Path/file access error."
1.00.536     Removed line FILE10=OLE2UI.DLL under the [MSOLE2.VBX]
             section in SETUPWIZ.INI.
1.00.536     Try using Setup Wizard to create setup disks for the
             OLE2DEMO sample application after removing the OLE2UI entry
             from SETUPWIZ.INI. In step 2, select OLE. The Next button
             doesn't work. The Back button does work, and the Next
             button works if nothing is selected in step 2. The Finish
             button also works. This problem affected any OLE
             application.
1.00.537     Selecting more than 40 files with the Common Dialog during
             ADD FILES was not handled before. Now it is.
1.00.538     Cleaned up the MSOLE2.VBX and OLE Automation sections in
             SETUPWIZ.INI.
1.00.539     A PATH pointing to non-existing directories or drives
             resulted in a "User-defined error." Now Setup Wizard
             returns the correct error message and continues.
1.00.542     Fixed compression problems when running under Windows NT.
1.00.543     Fixed an invalid keyword in some common dialogs that asked
             where a file is located.
1.00.543     Fixed problem: if a template's .EXE file was deleted or
             moved.
1.00.544     SetupWizard incorrectly added VER.DL_ to the SETUP.LST
             file. Setup Wizard no longer adds this file to SETUP.LST.
1.00.545     SETUPWIZ.INI added two files to the CRYSTAL.VBX section.
1.00.546     Fixed problem where after adding files in step 5, you can
             get a "File not Found" or "Compress error."
1.00.546     Fixed problem where after deleting your project's EXE
             (such as MYAPP.EXE), you'd get an "Illegal function call in
             CreateVBSetup1."
1.00.547     Fixed problem where MYAPP.EXE in same dir as MAK file,
             and PATH= in MAK file points to different drive.  Thus
             wrong file was added to list.
1.00.548     Fixed problem when a compressed file is larger than 1.2
             meg. This fix also requires 4 changes in the SETUP1.MAK
             project.
1.00.548     Fixed problem when SETUP1.MAK has a .VBX or .DLL file.
1.00.548     Fixed problem where after adding multiple files, another
             'point to a file' dialog came up asking for a support file
             location resulting in a path with no filename is listed in
             the file distribution box.
1.00.549     Fixed problems where SETUP1.FRM grows beyond an assumed
             size. SetupWizard is now not dependent on SETUP1.FRM's
             size.
1.00.550     Fix to the SETUP1.MAK files for concatenating split files
             back together.
1.00.551     Changed caption of Financial Functions checkbox to IFF &
             Financial Functions
1.00.551     Fixed problem where a project with many files would cause a
             Disk Full error on distribution disk 1.

1.00.552     Fixed problem under Windows NT 3.51 where the Setup Wizard
             would start another instance of itself rather than running
             the batch file which compresses the distribution files.
             This problem is due to internal changes in Windows NT 3.51
             rather than an error in the code in the Setup Wizard.

SETUP.EXE Notes
---------------

To check the internal version number of your SETUP.EXE, open a copy of the
file in an editor, and search for the string "FileVersion" to show the
version number. Note, This version information was added only after version
1.00.002.

Version    Bug Fix/Feature              Comments
---------------------------------------------------------------------
1.00.002   VER.DLL is truncated to      SETUP.EXE now checks to see
           zero bytes if it is not      if VER.DL_ exists on  your
           found or has an incorrect    distribution disk. If it is
           name on the distribution     not found, the following error
           disk.                        error is displayed and then
                                        SETUP.EXE terminates:
                                        "Error - File not found:
                                        A:\VER.DL_. This file is
                                        required by Setup."

1.00.002   SETUP.EXE does not run       When running SETUP.EXE in
           in Windows version 3.0.      Microsoft Windows version 3.0,
                                        you will receive the error "This
                                        application requires a newer
                                        version of Windows."  This error
                                        causes SETUP.EXE to terminate.
                                        This bug has been fixed so that
                                        SETUP.EXE will run successfully
                                        in Microsoft Windows version
                                        3.0.

1.00.002   The Visual Basic version     This problem occurs because
           3.0 THREED.VBX does not      the file type of THREED.VBX
           overwrite the Visual Basic   changed from "APP" to "DLL"
           version 2.0 THREED.VBX.      between version 2.0 and 3.0.
                                        SETUP.EXE now ignores file
                                        type differences and will
                                        install any file where the
                                        source and destination names
                                        are the same when the source
                                        file is the same or a newer
                                        version.

1.00.002   This error message:          The error messages are now
           "Could not open or read      "Error - Could not open file:
           file: <filename>" was        <filename>" and "Error - Could
           replaced with two            not read file: <filename>."
           separate error messages.     Both errors cause SETUP.EXE to
                                        terminate.

1.00.002   New error message added:     The new error message replaces:
           "Error - Insufficient        "Error - Could not copy file:
           disk space on drive          <source filename> ->
           <drive letter>:" This        <destination filename>"
           error causes SETUP.EXE       when there is insufficient
           to terminate.                disk space.

1.00.002   Version information was      The version number 1.00.002
           added to SETUP.EXE.          was added to SETUP.EXE.
                                        Previous versions of SETUP.EXE
                                        have no version number.

1.00.003   Running SETUP.EXE            This problem has been fixed so
           version 1.00.002 from a      that you can run SETUP.EXE from
           subdirectory causes          a subdirectory. SETUP.EXE
           "Error - Could not open      provided with Visual Basic
           file: <path name> SETUP.LST  version 3.0 does not have this
                                        problem.

1.00.003  VER.DL_ on distribution       SETUP.EXE now copies VER.DL_
          disk does not copy over       when the file/date time stamp of
          VER.DLL in destination        the destination VER.DLL file is
          directory if the file date/   the same.
          time stamp is the same for
          both files.

1.00.004  A  "Cannot copy file ..."     SETUP.EXE no longer gives an
          error message occurs when     error when the source file has
          attempting to copy a file     an older version number than
          referenced in SETUP.LST that  the destination file.
          has an older version number
          than the same file on the
          destination drive.  This
          error causes SETUP.EXE to
          terminate.

1.00.004  SETUP.EXE copies over the     SETUP.EXE no longer attempts to
          same or older version of      copy VER.DLL if it is already in
          VER.DLL if it is in use       use.  It assumes that it can use
          by another application such   an older version of VER.DLL if
          as File Manager.  This can    it exists and is in use.
          lead to a General Protection
          Fault (GP fault).

SETUP1 Project Files Notes
--------------------------

To check the internal version number of the Setup1 project files, check the
general declarations section of SETUP1.FRM. (This version information
was added only after version 1.00.002 of the Setup kit.)

Version  Bug                               Comments
----------------------------------------------------------------------
1.00.001 SETUP1.EXE fails to copy the      This problem occurs because
         Visual Basic version 3.0          the file type of THREED.VBX c
         THREED.VBX over the Visual        changed from APP to DLL
         Basic version 2.0 THREED.VBX.     between Visual Basic versions
                                           2.0 and 3.0.
                                           The CopyFile function in
                                           SETUP1.BAS was modified so
                                           that any file will be copied
                                           regardless of its type as
                                           long as the source file is
                                           the same or newer version
                                           when compared to the
                                           destination file.

1.00.001 SETUP1.EXE fails when attempting  A problem in
         to show a Program Manager group   CreateProgManItem when
         under Norton Desktop              executing the ShowGroup DDE
                                           command causes SETUP1.EXE to
                                           fail under Norton Desktop.
                                           The syntax on the call to the
                                           ShowGroup DDE command was
                                           fixed to overcome this
                                           problem.

1.00.001 Unnecessary code included in      SETUP1.FRM contains code that
         Form_Load event procedure of      has been disabled by making
         SETUP1.FRM.                       it into a comment. This code
                                           was useful in the Visual
                                           Basic version 1.0 of the
                                           Setup Toolkit. However, the
                                           features demonstrated by this
                                           code were removed from the
                                           Visual Basic version 2.0 and
                                           3.0 Setup Toolkit. This code
                                           was removed.

1.00.001 Incorrect references to           Messages containing
         "Test Application"                references to "Test
                                           Application" were changed to
                                           reference the actual name of
                                           the application.

1.00.002 Setup Wizard is not able to       Changes to the Setup Wizard
         break large files (greater        version 1.00.548 to fix this
         than 1.2 meg in size)             problem required changes to
         across multiple disks             the CopyFile and
                                           ConcatSplitFiles routines in
                                           SETUP1.BAS.

1.00.002 A version number was added        Check the general
         to a comment in the general       declarations section of
         declarations section of           SETUP1.FRM to determine the
         SETUP1.FRM.                       current version number of
                                           SETUP1.

Changes Made to the CopyFile and ConcateSplitFiles Routines in SETUP1.BAS
-------------------------------------------------------------------------

Old SETUP1 Code:

   In Function CopyFile:

      If InFileVer$ <= OutFileVer$ Then

   In Sub ConcatSplitFiles:

      CopyLeftOver& = outfileLen& Mod 10
      CopyChunk# = (outfileLen& - CopyLeftOver&) / 10
      filevar$ = String$(CopyLeftOver&, 32)
      Get #fh2%, , filevar$
      Put #fh1%, , filevar$
      filevar$ = String$(CopyChunk#, 32)
      iFileMax% = 10

New SETUP1 Code:

   In Function CopyFile:

      If InFileVer$ <= OutFileVer$ And SourcePath <> DestinationPath Then

   In Sub ConcatSplitFiles:

      CopyLeftOver& = outfileLen& Mod 100
      CopyChunk# = (outfileLen& - CopyLeftOver&) / 100
      filevar$ = String$(CopyLeftOver&, 32)
      Get #fh2%, , filevar$
      Put #fh1%, , filevar$
      filevar$ = String$(CopyChunk#, 32)
      iFileMax% = 100

Problems and Limitations
------------------------

 - COMPRESS.EXE will take only a limited length command line. If
   SetupWizard is in a subdirectory that is nested too deep, COMPRESS
   will not work correctly. In this case, you will encounter a 'File
   does not exist' error when the file does exist. To work around this
   problem, move the SETUPKIT subdirectory up one or more directory
   levels until COMPRESS works.

 - The Setup Wizard requires that your <appname>.EXE file completely
   reside on the first distribution disk. It will not split this file.
   If <appname>.EX_ is too large to fit on the first disk, an error will
   occur. To work around this problem, perform these steps:

   1. Start Visual Basic and create a temporary project file,
      <apptemp>.MAK. Give the project one codeless form and no custom
      controls. Save the project, create the <apptemp>.EXE file, and
      exit Visual Basic.

   2. Run the Setup Wizard specifying <apptemp>.MAK, and add your real
      project's .EXE file and all of the required supporting files during
      step 5 to create installation disks.

   3. Start Visual Basic and open the SETUP1A.MAK project file in the
      \VB\SETUPKIT\KITFILES directory and modify the Form_Load
      procedure in SETUP1A.FRM as follows:

       - Delete the following line:

            If Not CopyFile(SourcePath$, destPath$, "<apptemp>.EX_",
               "<apptemp>.EXE") Then GoTo ErrorSetup

       - Change the file name <apptemp>.EX_ in the following statement:

            If Not PromptForNextDisk(1, SourcePath$ + "<apptemp>.EX_")
               Then GoTo ErrorSetup

         to the name of another file found of the first distribution disk,
         such as SETUP1.EX_:

            If Not PromptForNextDisk(1, SourcePath$ + "SETUP1.EX_")
               Then GoTo ErrorSetup

       - Create a new SETUP1.EXE

   4. Shell out to MS-DOS to the \VB\SETUPKIT\SETUP1 directory and compress
      SETUP1.EXE using this command:

         \VB\SETUPKIT\KITFILES\COMPRESS SETUP1.EXE -R

   5. Copy your new SETUP1.EX_ onto your first distribution disk.

 - The Setup Wizard will not write to an installation disk that has damaged
   sectors, even if there is room for the project on it. This behavior
   is by design.

 - The Setup Wizard will not split a file into more than nine pieces. If
   you need to ship a file that large, use another method to store the
   file.

 - When doing step 1 of the Setup Wizard, if you select a valid .MAK file
   by using the common dialog and then reset it to C:\, you will cause an
   untrapped fatal error. This problem occurs only when you use the 'Select
   MAK file' option and then modify the result. This problem does not occur
   if the 'Select MAK file' option is not used.

 - When doing step 5 of the Setup Wizard, if you add a large number of
   files, such as the entire WINDOWS directory, by using the common dialog
   box, the Setup Wizard:

    - Adds none of the file names.

    - Places a pause symbol (sideways =) in the list.

    - Does not generate an error message.

   This is caused by exceeding a buffer size limitation. You can delete the
   pause symbol without consequence.

 - The Setup Wizard does not handle files that have nearly identical names
   correctly. If the names are identical except for the last letter (such
   as FORM1.FRM and FORM1.FRX), when the Setup Wizard compresses the second
   file, it does not check to determine if a file of that name (FORM1.FR_)
   already exists.

   To work around this problem, rename files that will cause this error
   before they are compressed. For example rename FORM1.FRX to FORM1X.FRX.
   To create the distribution disks, following these steps:

   1. Start Visual Basic, and open the SETUP1A.MAK project file in the
      \VB\SETUPKIT\KITFILES directory. Modify the Form_Load
      procedure in SETUP1A.FRM as follows:

       - Change the file name FORM1X.FRX in the following statement:

            If Not CopyFile(SourcePath$, destPath$, "FORM1X.FR_",
               "FORM1X.FRX") Then GoTo ErrorSetup

         to the correct file name, FORM1.FRX:

            If Not CopyFile(SourcePath$, destPath$, "FORM1X.FR_",
               "FORM1.FRX") Then GoTo ErrorSetup

       - Create a new SETUP1.EXE

   2. Shell out to MS-DOS in the \VB\SETUPKIT\SETUP1 directory, and
      compress SETUP1.EXE by using this command:

         \VB\SETUPKIT\KITFILES\COMPRESS SETUP1.EXE -R

   3. Copy your new SETUP1.EX_ onto your first distribution disk.

 - Program manager Groups and Items may not install correctly on systems
   using an alternate desktop, such as Norton Desktop for Windows 2.2.
   For more information on this problem, please see the following
   article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q108498
   TITLE     : PRB: DDE Error When Running Setup on Norton Desktop

 - The error message 'Sharing Violation on drive C:' may be displayed
   during the compression stage (Step 6) when using the Setup Wizard.
   This is caused by the combination of the file sharing utility
   SHARE.EXE, the compression utility COMPRESS.EXE, and the Setup Wizard
   tool SETUPWIZ.EXE. The problem occurs when the compression utility
   tries to open the files SETUPKIT.DLL, VBRUN300.DLL, COMMDLG.DLL,
   and/or CMDIALOG.VBX.

   To work around this problem, copy SETUPKIT.DLL, VBRUN300.DLL,
   COMMDLG.DLL, and CMDIALOG.VBX from the \WINDOWS\SYSTEM directory to
   the directory where the SETUPWIZ.EXE file is located. Then
   SETUPWIZ.EXE and COMPRESS.EXE will not try to use the same files at
   the same time. Set the read-only attribute of all four files. This
   can be done via File Manager in Windows or by using the Attrib
   command from the DOS prompt.

   Users of Windows for Workgroups do not encounter this problem due to
   the fact that it uses VSHARE.386, an alternative file sharing utility
   to SHARE.EXE. Users of Windows 3.1 can also use this utility by
   installing VSHARE.386. Run the file WW1000.EXE, a self-extracting file
   included in SETUPK.EXE, to obtain the instructions (README.TXT) and
   the driver (VSHARE.386).

   For more information on this Bug, please see the following article
   in the Microsoft Knowledge Base:

   ARTICLE-ID: Q102478
   TITLE     : BUG: Setup Wizard Error: Sharing Violation Reading Drive C:

 - Filenames specified in SETUPWIZ.INI must be specified with all uppercase
   letters. This works around a problem with the Setup Wizard where files
   specified with the ":1" option are improperly installed into the same
   directory as the project .EXE file.

Additional reference words: Update3.00 softlib 3.00
KBCategory: kbtool kbfile kbprg kbcode
KBSubcategory: TlsSetWiz
