PRB: WinExec Error 0002h When Running SetupWiz Setup Program

Last reviewed: May 9, 1997
Article ID: Q149266
The information in this article applies to:
  • Professional and Enterprise Editions of Microsoft Visual Basic, 16-bit only, for Windows, version 4.0

SYMPTOMS

After the initial Copying Initialization Files dialog box is displayed by a Setup Wizard-generated setup program, an error is raised stating:

   Cannot start main setup program (winexec). Error code 0002H

The setup is not successful and fails after this dialog box.

MORE INFORMATION

The corresponding error message for error code 0002H from WinExec is "File not found." This error can be raised any time that one or more of the files that the Setup1.exe program requires to begin operation are missing. This can occur if one or more files are removed during step 7 of the Setup Wizard. In addition, if the Swdepend.ini file that is used by the Setup Wizard to determine what files are needed is missing any entries, then the distribution media may not contain all necessary files.

The Setup Wizard checks for the existence of the Swdepend.ini file when it starts. If the file does not exist it will be created by the Setup Wizard from template file \vb\setupkit\kitfiles\Sw16tmpl.ini for 16 bit and \vb\setupkit\kitfil32\Sw32tmpl.ini for 32 bit. The 16-bit Setup Wizard adds entries to Swdepend.ini based on Sw16tmpl.ini, and the 32-bit version does likewise using Sw32tmpl.ini. If either of the template files have been corrupted or were installed incorrectly during the installation of Visual Basic 4.0, then the Swdepend.ini file may be missing important entries.

The approximate sizes for correctly installed template files are listed here:

   Edition of Visual Basic 4.0      SW16TMPL.INI   SW32TMPL.INI
   ---------------------------      ------------   ------------
   Standard                         NA            4.0K
   Professional                     2.7K          4.0K
   Enterprise                       3.5K          5.0K

If the Sw16tmpl.ini or Sw32tmpl.ini is smaller than this size, it may be corrupted or may not have been installed correctly. To resolve this problem, follow these steps:

  1. Copy over the incorrect file using the relevant and correct file from the vb\setupkit\kitfiles or vb\setupkit\kitfil32 directory of the Visual Basic 4.0 CD. It may be a good idea to back up the file before it is overwritten in case any changes have been made to it by installation programs for 3rd party OCXs or other components.

  2. Edit \Windows\Swdepend.ini using a text editor such as Notepad. Locate any lines containing the entry 'CreatedSW=1' and delete them. This will force the Setup Wizard to re-create the entries in Swdepend.ini the next time it runs.

  3. Run the Setup Wizard to create a correct copy of Swdepend.ini.

After these steps the Setup Wizard will be able to include all basic necessary files when creating setup programs for Visual Basic 4.0 applications. Any changes made to the previous copy of the template files can be added manually to the template file before creating Swdepend.ini or added directly to the Swdepend.ini file. A description of the format of Swdepend.ini may be found in the VB4 help file under Swdepend.ini syntax.


Keywords : TlsSetWiz vb416 vb4win kbprb
Version : 4.0
Platform : NT WINDOWS
Issue type : kbprb


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.

Last reviewed: May 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.