PRB: WinExec Error 0002h When Running SetupWiz Setup Program

ID: Q149266


The information in this article applies to:


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.


NOTE: The SWDEPEND.INI may be damaged and may need to be recreated completely. To do this, rename the SWDEPEND.INI and run the Setup Wizard which will create a new copy of the file.

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.

Additional query words: kbVBp400 kbDSupport kbintluk kbdss kbdsstools kbWizard


Keywords          : kbsetup 
Version           : WINDOWS:4.0;
Platform          : WINDOWS winnt 
Issue type        : kbprb 

Last Reviewed: June 4, 1999