How do I troubleshoot Visual Basic* applications that don't run after installation?
Have you ever had a Visual Basic application that failed to run after installation? This generally occurs because of missing dependency files or improperly registered files. Visual Basic applications are dependent on .dll and .ocx files to run properly. When these dependent files are missing or are improperly registered, the Visual Basic application does not run.
Use Wise Visual Basic Import Wizard as a springboard to create your application. The Wise Visual Basic Import Wizard reads a Visual Basic project file and imports all of the files referenced by the Visual Basic project. The Visual Basic Import Wizard also checks for file dependencies in corresponding .dep files and adds those dependencies to the installation script. If the Visual Basic project file is not complete or there is not a .dep file associated with a file that has dependencies, then the installation might be missing files required for the application to run successfully. This article explains the three most common troubleshooting steps you should take whenever your Visual Basic application does not run properly.
To troubleshoot your Visual Basic installation:
- Review the Install.log, which is a text file usually located in the application directory. The Install.log file lists the actions performed during the installation. View the log file to see which files self-registered during the installation. Files that did not self-register can be causing the application to not run. You might also find that the application installed successfully on one computer but not on another computer. To troubleshoot this, compare the Install.log files from the two installations to see what the differences are. Here are the five most common reasons why a file does not register:
Check runtime files. Many different applications require MDAC, Jet, OLE, ADO and more. Missing runtime files in an installation can cause the installation to fail. Ask the VB application developer whether the runtime files are needed. Frequently, the decision about whether runtime files are needed for the application is determined at application design time.
When installing runtime files that require reboots such as OLE and MDAC, make sure you reboot the machine. Files that depend on the runtime files do not install and register correctly if you do not reboot during the installation.
- Missing dependencies. To find out if a dependent file is missing, use Dependency Walker, a free Microsoft tool available at www.dependencywalker.com. This tool generates a list of files that are dependent on the main file in your application. If any of the dependent or main files are missing from your installation package, add them to your installation, then self-register the files.
- Third party files that need to register via Regsvr32.exe. If there is not a missing dependency file in your installation, you might need to register files. Use Regsvr32.exe to register the file that was not registered by the VB Import Wizard. To do this, run Regsvr32.exe outside of Wise Installation System. If it registers the file without errors, then use the Execute Program action in the Script Editor to call Regsvr32.exe from within Wise Installation System. If the file does not register using Regsvr32.exe, then the file is probably corrupt or still missing a dependency file.
- Corrupted .DLL or .OCX files. To determine if the file is corrupt, change the source of the file so that the version you compile in your installation executable is from a different source. Run the installation again. If the installation runs successfully, the problem was a corrupt file. Otherwise, there is another issue preventing a successful installation.
- Not coded as a self-registering file. There might be a file in your installation that needs to be registered. Look in the file’s properties to see if OLE Self-Register is listed in the version source information. If it is listed, then the file needs to be self-registered. When OLE Self-Register is not listed, the file usually does not need to be registered, but this is not always the case. A more reliable method to find out if the file needs to be registered is to ask the application vendor or research the file on MSDN.
- .DLL and .OCX files need to be installed and registered in a specific order. A file can register using Regsvr32.exe after the installation, but the VB application can still fail. The failure can be caused by the order in which the files are installed. For example, one file requires another file to register, but the file that is needed is not installed yet. Until it is installed and registered, the file that is dependent on it won’t register. Check with the vendor to see if there is a specific order in which the files you are distributing should be installed.
Missing dependency files or improperly registered files in your application often cause errors when an installation is complete. Apply the troubleshooting tips in this article to decrease the time you spend debugging the application and increase the likelihood that every installation of your application runs successfully.