Testing Component Download on Clean Machines

By testing your download on a clean machine — one that does not already have Visual Basic installed — you get an accurate look at the download experience your users are likely to encounter. This is an essential part of the testing process. You can simulate a clean machine by removing certain files and registry settings from one of your development machines, then restoring those files and settings after you have finished testing.

Note   The procedures in this section require a copy of regsvr32.exe to be installed on your machine. If it is not, you can find it on the Visual Basic installation CD-ROM.

Simulating a Clean Machine

One of the systems you test should be a machine that does not have Visual Basic or the Visual Basic Run-time Library installed — a "clean machine". If you do not have access to this type of machine, you can simulate one by following the instructions in this section. These steps may also be taken to clean a client machine that has been exposed to one or more of the files in the download.

Warning   Removing, renaming, or unregistering files as described below can impact other programs on your machine. Before deleting, renaming, or unregistering any files, it is advisable to copy these files to a safe alternate location from which you can restore them.

This process requires a copy of Regsvr32.exe. This file may be installed onto your development machine; if it is not, it may be found on the Visual Basic installation CD-ROM.

To simulate a clean machine

  1. From the Start menu, click Run.

  2. In the Run dialog, type in the following command;
    Regsvr32.exe /U <Path to Windows folder>\System\Msvbvm60.dll
    

    Note   If you are running on a Windows NT machine, the Msvbvm60.dll is installed into the Windows\System32 folder.

  3. From the Start menu, click Find, and then select Files or Folder.

  4. Delete or rename the following two files, located in either your System or System32 directory:

    Msvbvm60.dll
    Asycfilt.dll

    Important   Do not delete other versions of these files in alternative locations.

  5. Unregister and delete or rename the item to be downloaded and any remaining dependency files installed on the client machine:

    where file is the name of the file to unregister.

    Note   Most controls install into the Windows\System, Windows\System 32, Windows\OCCache, or the Downloaded Program Files folders. However, some downloaded controls are not visible in Explorer's file view after download. It is necessary for these files to open a DOS window, navigate to the Downloaded Program Files folder, then run regsvr32 for those .ocx files to unregister them. You can then delete them at the DOS prompt.

    Tip   For a list of dependency files, open the .inf file created by the Package and Deployment Wizard and look in the Add.Code section. If you are uncertain whether a file needs to be unregistered, you can run REGSVR32.EXE with the /U switch. If you receive an error, the file does not need to be unregistered.

To test your download on a simulated clean machine

Restoring Your Simulated Clean Machine

You can reverse all the changes you made when you simulated a clean machine, if necessary. Normally, you do not need to do this because downloading the component you were testing should install and register the necessary files. However, if something goes wrong during download, you can restore the files yourself.

There are two steps to restoring your machine: You must rename or restore any files you deleted or renamed, and you must re-register the files you removed from the registry. When you restore, you must rename or restore any file you deleted or renamed.

To retrieve a file you deleted

Once the necessary files have been restored, you can run Regsvr32.exe to register those files that you unregistered. For example, to register the Visual Basic Run-time Library, execute the following command from the run dialog:

Regsvr32 <Path to Windows>\System\Msvbvm60.dll

To register a file you unregistered