DOCUMENT:Q189625 17-JUL-1998 [vbwin] TITLE :PRB: Error 168 When Installing or Running Visual Basic PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5.0 OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 5.0 --------------------------------------------------------------------- SYMPTOMS ======== During Visual Basic setup, the following error may be received while the system registry is being updated: Setup error 168 : Setup encountered an error updating your registry This problem occurs on Windows NT 4.0, Windows 95, and Windows 98. CAUSE ===== On Windows NT, this problem frequently occurs when a user attempts to install or use Visual Basic without having the necessary access rights. On Windows 95 or Windows 98, this problem frequently occurs when Registry keys being updated are locked, are used by another application, or have exceeded their size limits. See the MORE INFORMATION section below. RESOLUTION ========== IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information on how to do this, view the "Restoring the Registry" online Help topic in Regedit.exe or the "Restoring a Registry Key" online Help topic in Regedt32.exe. This article provides workarounds for Windows NT 4.0, Windows 95, and Windows 98. Resolution for Windows NT 4.0 ----------------------------- NOTE: The procedures shown here must be performed by a person with Administrator rights for the machine. Step-by-Step Example -------------------- 1. From the Windows Start menu, choose Run. 2. Type in the path to the Registry Editor (for example, C:\WINNT\SYSTEM32\Regedt32.exe), and then click OK. 3. From the HKEY_LOCAL_MACHINE on Local Machine window, select the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools registry key. 4. Choose Permissions from the Security menu. 5. From the Registry Key Permissions dialog box, click Replace Permission on Existing Subkeys. 6. From the Name text box, select Everyone, and then choose Full Control from the Type of Access combo box. 7. Click OK. 8. From the HKEY_LOCAL_MACHINE on Local Machine window, highlight the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib registry key. 9. Repeat steps 4 through 7. 10. From the HKEY_CLASSES_ROOT on Local Machine window, highlight the HKEY_CLASSES_ROOT\TypeLib registry key. 11. Repeat steps 4 through 7. 12. Try to reinstall Visual Basic. Resolutions for Windows 95 or Windows 98 ---------------------------------------- NOTE: Five possible resolutions for Windows 95 or Windows 98 are provided here. Resolution 1 ------------ Run RegClean.exe to clean the Registry. For additional information on how to obtain and use RegClean, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q147769 TITLE : INFO: RegClean 4.1a Description and General Issues Resolution 2 ------------ Remove erroneous entries from the SharedDLLs registry key. Step-by-Step Example -------------------- 1. From the Windows Start menu, choose Run. 2. Type the path to the Registry Editor (for example, C:\WINDOWS\Regedit.exe), and then click OK to open the Registry Editor. 3. Locate the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs 4. Examine the SharedDLLs key entries to see if any files with extensions such as .c, .cpp, or .rc are registered. Note that this key is to be used for registering only DLL files. Delete any file entries from the SharedDLLs registry key that contain extensions other than .dll or .exe. 5. Install Visual Basic again. Resolution 3 ------------ Replace the existing SharedDLLs registry key. Step-by-Step Example -------------------- 1. From the Windows Start menu, choose Run. 2. Type in the path to the Registry Editor (for example, C:\WINDOWS\Regedit.exe), and then click OK to open the Registry Editor. 3. Locate the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs 4. From the Registry menu, choose Export Registry File to save the existing registry key. 5. Name the exported registry key file and save it in a temporary directory (for example, C:\Temp\OldKey.dat). 6. Delete the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs 7. Install Visual Basic again. NOTE: Whether installation is successful or unsuccessful, perform steps 1-2 above again, then continue to step 8. 8. Save the new SharedDLLs registry key as described in steps 4-5, giving it a new name (for example, C:\Temp\NewKey.dat). 9. From the Registry menu, choose Import Registry File. Enter the name of the original registry key (in our example, C:\Temp\OldKey.dat), then click on Open. This important step restores SharedDLLs registry key information that would otherwise be lost. 10. What you do now depends on whether the installation in step 7 was successful: If the installation in step 7 was successful, import the second saved registry file (in our example, C:\Temp\NewKey.dat) just in case importing OldKey.dat wrote over some key values. See step 9 for this procedure. If the installation in Step 7 was unsuccessful, it may be because the size limit of the Registry has been exceeded. See Resolutions 4 and 5 for workarounds for this problem. Resolution 4 ------------ Reduce Registry size by temporarily deleting fonts. Step-by-Step Example -------------------- 1. From the Windows Control Panel, select Fonts. 2. Check the number of fonts loaded on the machine: the number of fonts appears at the bottom of the Fonts window. If you have more than 800 fonts on your system, move some fonts from the Windows\Fonts folder to a temporary location. 3. Install Visual Basic again. 4. Move the fonts back after Visual Basic has been successfully installed. Resolution 5 ------------ Reduce Path size to allow for more Registry entries. Step-by-Step Example -------------------- 1. Examine the directory structure into which you have loaded applications on your system. The full directory path for DLLs is entered into the SharedDLLs registry key and the number of characters in the path reduces the number of entries in a registry key. 2. To allow for more Registry entries, you may wish to uninstall particular applications and then reinstall the applications closer to the root directory. 3. Install Visual Basic again. STATUS ====== Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION ================ This problem occurs on Windows NT 4.0, Windows 95, and Windows 98. This article provides additional information and workarounds for both platforms. Windows NT 4.0 -------------- 1. If you do not have Administrator rights on an NT machine and try to install Visual Basic as a regular user, you will get error 168 while the system registry is being updated. 2. If you do have Administrator rights and some of the subkeys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools are owned by someone else or do not have an owner (they become gray), you will also get error 168. 3. If you don't have access to HKLM\Software\Microsoft\Shared Tools and HKCR and HKLM\Software\Classes\TypeLib subkeys, you will get "Unexpected error quitting" when trying to start Visual Basic. This usually happens when you are a regular user and the administrator did not grant you access rights. Windows 95 or Windows 98 ------------------------ 1. Windows 95 and Windows 98 appear to have a Registry key size limit beyond which it will not respond to the RegistrySizeLimit value. If this size limit is exceeded, Visual Basic may not be able to update the Registry and complete setup. REFERENCES ========== For additional information, please see the following article in the Microsoft Knowledge Base. ARTICLE-ID: Q185647 TITLE : PRB: Setup Error 168: Setup Encountered Error Updating Registry Additional query words: kbDSupport kbdss kbSetUp kbRegistry kbVBp500 kbVBp ====================================================================== Version : WINDOWS:5.0 Platform : 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. Copyright Microsoft Corporation 1998.