Best practices for deploying Visual Basic 6.0 applications
On This PageSUMMARYThis article discusses how to prepare to deploy a Microsoft Visual Basic 6.0 application. To prepare a Visual Basic 6.0 application for deployment, make sure that you do the following:
To troubleshoot a deployed Visual Basic 6.0 application, use the following methods:
To troubleshoot a deployed Visual Basic 6.0 application that was installed by using an alternative installer technology, use the following methods:
INTRODUCTIONBefore you deploy a Visual Basic 6.0 application, you must plan how you want to build and to deploy the package that installs the application. You must also decide what files you want to include in the package. Additionally, you must test the package before you deploy it to make sure that the installed application works as expected. This article discusses issues that you must consider and tools that you can use to deploy your application. Prepare to deploy your Visual Basic 6.0 applicationWhen you are preparing to deploy a Visual Basic 6.0 application, consider how much time you will require to package and to test the application. Include time to prepare the computers that you will use, time to identify and to minimize application dependencies, and time to prepare the Redist folder that contains the correct versions of files that you want to redistribute with the application.Plan ahead and budget time to package and to test your applicationMany developers spend lots of time and effort to develop an application, and then they spend little time or no time to package and to test the application on other computers. This is a common mistake. It is best to budget time into your development schedule for packaging and for testing your application. Consider which operating system versions and which configurations you will support for your application, and budget time for testing the application on those configurations.The Visual Basic 6.0 Package and Deployment Wizard was designed to deploy applications to Microsoft Windows 95, Windows 98, and Microsoft Windows NT 4.0 or later. However, for obsolete operating systems, such as Windows 95, Microsoft provides support for deploying Visual Basic 6.0 applications on a "best effort" basis after the problem is identified as being specific to the operating system. For information about the life cycle of a specific version of Internet and MSN, visit the following Microsoft Web site: http://support.microsoft.com/gp/lifeselectintmsn (http://support.microsoft.com/gp/lifeselectintmsn) Note Microsoft does not provide support for deploying or for running Visual Basic 6.0 applications on Windows NT 4.0 Terminal Server.For more information about how to run Visual Basic 6.0 applications on Windows NT 4.0 Terminal Server, click the following article number to view the article in the Microsoft Knowledge Base: 196201 (http://support.microsoft.com/kb/196201/)
Visual Basic is not supported on Terminal Server 4.0
Prepare the development computer and the packaging computerWhen you are preparing to develop and to package a Visual Basic 6.0 application, consider the following best practices:
Identify and minimize application dependenciesMissing or mismatched versions of application dependencies are the most common cause of problems that developers experience when they distribute Visual Basic 6.0 applications. Therefore, it is extremely important that you identify exactly what dependencies your application requires, and their versions. This way, you can make sure that you are redistributing the correct dependencies with your application.Generally, the Package and Deployment Wizard does a good job of redistributing the correct dependencies for your application. However, to minimize problems, minimize the dependencies that your application requires. The main dependencies in a Visual Basic 6.0 application are component references and COM library references. Component references include ActiveX controls or designers that are located in an external .ocx file or in an external .dll file. When you select an ActiveX control in the Components dialog box, Visual Basic puts an icon for the control in your control toolbox and then adds a reference to the external library in the Visual Basic project. If a component requires a supporting DLL, Visual Basic automatically adds the DLL as a library reference in the References dialog box. A COM library reference is a reference to a type library (DLL, TLB, OLB) that has been selected in the References dialog box. When the Package and Deployment Wizard determines the files to deploy with your application, the Package and Deployment Wizard reviews the project file to determine which components and which COM library references the project uses. The Package and Deployment Wizard then searches for any dependency files (.dep) that are associated with these components to determine if any supporting files must be redistributed with the application. Verify that the project does not reference any components or libraries that are not required so that the Package and Deployment Wizard does not try to redistribute files that the application does not require. Project componentsTo identify and to minimize references to components in your project, follow these steps:
Project referencesTo identify and to minimize references to COM libraries in your project, follow these steps:
Prepare the Redist folderThe Redist folder is located on the packaging computer. By default, the Redist folder is located in the following folder:C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard After the Package and Deployment Wizard determines the application's dependencies, the Package and Deployment Wizard tries to locate the files that it has determined must be included with the Setup package. The first location that the Package and Deployment Wizard scans is the Redist folder. If the Package and Deployment Wizard does not locate the required files in the Redist folder, it tries to locate the files in other folders, such as the System32 folder. This behavior may cause problems because your operating system may contain versions of system files that are not compatible with earlier operating systems. Therefore, make sure that the Redist folder contains the correct versions of any files that the Package and Deployment Wizard copies from your system. If you have installed Visual Basic 6.0 Service Pack 4 or later, the Redist folder already contains most of the files that the Package and Deployment Wizard requires for the package. However, if you have specific versions of files that you want to redistribute with the application, make sure that you copy them manually to the Redist folder. Additionally, if you use a packaging script that you have saved from an earlier application packaging project, the Package and Deployment Wizard collects the files from the location that appears in the earlier packaging script. The Package and Deployment Wizard will not collect the dependencies from the Redist folder unless it collected them from the Redist folder earlier. Troubleshoot deployment issues of Visual Basic 6.0 applicationsMany tools and resources exist to help you troubleshoot the deployment of your Visual Basic 6.0 application. The following tools and link provide information that you can use to troubleshoot common issues that may occur when you deploy your application.Tools for troubleshooting deployment issuesThe following tools monitor registry access, monitor file access, determine file dependencies, and determine the versions of loaded modules.The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products. RegmonRegmon (Regmon.exe) monitors registry access on a real-time basis. You can use Regmon to determine which applications are accessing the Windows registry. For more information about Regmon, visit the following Sysinternals Freeware Web site: http://technet.microsoft.com/en-us/sysinternals/default.aspx (http://technet.microsoft.com/en-us/sysinternals/default.aspx) To use Regmon, follow these steps:
FilemonFilemon (Filemon.exe) monitors file access on a real-time basis. You can use Filemon to determine which applications are accessing files on the system. For more information about Filemon, visit the following Sysinternals Freeware Web site: http://technet.microsoft.com/en-us/sysinternals/default.aspx (http://technet.microsoft.com/en-us/sysinternals/default.aspx) To use Filemon, follow these steps:
Dependency WalkerDependency Walker (Depends.exe) is used to determine the explicit dependencies that a file has. A dependency is a secondary file that a file requires to load or to run correctly. For example, a Microsoft Visual Basic application depends on the Microsoft Visual Basic run-time files. Dependency Walker also includes a profiling feature that you can use to monitor the way that your application loads and the way that your application runs. This feature is useful for troubleshooting a Visual Basic application that has problems during startup. For more information about Dependency Walker, visit the following Dependency Walker Web site: http://www.dependencywalker.com (http://www.dependencywalker.com) To use Dependency Walker to profile your application, follow these steps:
For more information about Dependency Walker, see the Dependency Walker online Help file. ListDLLsListDLLs outputs the names and the versions of all modules that are loaded in a specific process. You can use ListDLLs when a deployed application works on some computers but not on others. You can also use it to compare the versions of modules that are loaded. This information is helpful for determining if any mismatches exist between the loaded modules and your application's dependencies. To use ListDLLs, follow these steps:
For more information about tools that you can use to troubleshoot deployed Visual Basic 6.0 applications, click the following article numbers to view the articles in the Microsoft Knowledge Base: 198038 (http://support.microsoft.com/kb/198038/)
Useful tools for Package and Deployment issues
Common deployment issues of Visual Basic applicationsFor more information about common issues with deploying Visual Basic 6.0 applications, click the following article numbers to view the articles in the Microsoft Knowledge Base:831491 (http://support.microsoft.com/kb/831491/)
You receive multiple "System files are out of date" error messages when you install a Visual Basic 6.0 application
193270 (http://support.microsoft.com/kb/193270/) Troubleshooting VB application installation issues
330314 (http://support.microsoft.com/kb/330314/) Your computer does not restart after you install a Microsoft Visual Basic 6.0 application that includes a Msvcrt.dll file
216231 (http://support.microsoft.com/kb/216231/) Application Setup errors while displaying "copying files, please stand by"
200271 (http://support.microsoft.com/kb/200271/) How to diagnose and resolve some automation errors
254166 (http://support.microsoft.com/kb/254166/) Distribution of Microsoft Scripting Runtime Library fails
216158 (http://support.microsoft.com/kb/216158/) Multiple "please insert disk" messages when installing VB6 application
197580 (http://support.microsoft.com/kb/197580/) Distribution issues with Riched32.dll
Common deployment issues of database applicationsFor more information about common issues with deploying Visual Basic 6.0 database applications, click the following article numbers to view the articles in the Microsoft Knowledge Base:213846 (http://support.microsoft.com/kb/213846/)
Deploy database applications with the Package and Deployment Wizard (PDW)
299457 (http://support.microsoft.com/kb/299457/) Error "can't find installable ISAM" when you connect to Access database with intrinsic DataControl
217754 (http://support.microsoft.com/kb/217754/) How to control which MDAC version the Package and Deployment Wizard (PDW) distributes
299645 (http://support.microsoft.com/kb/299645/) Error "unable to register Msado15.tlb" if you use a PDW package to install a VB application
Deploy your Visual Basic 6.0 application by using alternative installer technologiesFrequently, developers deploy Visual Basic 6.0 application packages by using alternative installer technologies, such as Microsoft Windows Installer, instead of by using the Package and Deployment Wizard. However, if you use alternative installer technologies, unexpected problems may occur during deployment.Note Microsoft only supports the deployment of a Visual Basic 6.0 application if you deploy the application by using the Package and Deployment Wizard. If you plan to use other deployment technologies, consider the following recommendations to help you successfully redistribute your application. Redistribute minimum dependenciesThe following files are the minimum dependencies that are required for any simple Visual Basic 6.0 application to function:
If you want to add these files manually to your redistribution package, copy these files from the Redist folder on a computer where Visual Basic 6.0 and its latest service pack are installed. By using this method, you can make sure that your package does not include newer versions of operating system files that may cause problems during installation. Build a Setup package by using the Package and Deployment WizardConsider building a Setup package for the application by using the Package and Deployment Wizard before you build a package by using an alternative technology. This method will help you determine what dependencies the Package and Deployment Wizard includes in its Setup package.
For more information about third-party installers and Visual Basic applications, click the following article numbers to view the articles in the Microsoft Knowledge Base: 257773 (http://support.microsoft.com/kb/257773/)
Support for third-party installers
APPLIES TO
| Article Translations
|

Back to the top
