Visual Basic Concepts

Testing your Internet Component Download

Testing your download file is more complex than testing a conventional setup program because the software does not install unless one of two things is true:

  • The software does not already exist on the user's computer.

    -or-

  • The software being downloaded is newer than any version that already exists on the user's machine.

Because of this, you must be careful when you test your download to ensure that you test both scenarios. As a developer, you should test your application on multiple machines with varying configurations. At a minimum, you should test the download on both your development machine and on a machine that does not have Visual Basic installed, and on multiple operating systems. In addition, you must check your safety levels.

Note   If you do not have a machine without Visual Basic installed, you can simulate one. See "Testing Component Download on Clean Machines" for instructions.

Setting Safety Levels Prior to Testing

Before testing your download, be sure the safety level in Internet Explorer is set to Medium. If the safety level is set to High, the required files will not get downloaded. If you set the safety level to None, all of the missing components will be installed without warning.

When the safety level is set to Medium, the following warnings occur:

  • The browser warns you that an installation attempt is being made and prompts you to install the . If you choose to continue, the browser downloads and expands the .cab.

  • The browser asks if you want to install any dependency files, such as Microsoft Automation or the Microsoft Visual Basic run-time library. The Authenticode screen displays information about these components. If you choose to continue, the browser installs these files.

  • If you are downloading an ActiveX document in a version of Internet Explorer prior to 4.0, a script warning appears warning you that the Web page contains scripting code. This code is necessary in order to view your ActiveX document. If you choose to continue, the download proceeds. This warning does not appear in Internet Explorer 4.0 or later.

These warnings are all part of the Internet Explorer's safety mechanisms. If you do not receive all of these warnings, do not be alarmed. You may not receive a warning if a necessary component is already installed on the client machine or a security level option in Internet Explorer is set to something other than the defaults.

To check the safety level in Internet Explorer 4. x

  1. Click InternetOptions from the View menu.

  2. From the Options dialog box, click the Security tab.

  3. Click the appropriate safety level, then click OK.

To check the safety level in Internet Explorer 3.x

  1. Click Options from the View menu.

  2. From the Options dialog box, click the Security tab.

  3. Click the Safety Levels button.

  4. Click the appropriate safety level, then click OK.

  5. Click OK to return to the browser.

Testing Safety Levels

You can check safety levels by creating additional .cab files and HTML pages for testing, as suggested in the following table:

To test pages with Create a page that hosts a control with
No initialization or scripting No PARAM values or other variables set by the control.
Initialization only PARAM values assigned to a control.
Scripting only PARAM values set by VBScript only.
Scripting and initialization Initial PARAM values set and then modified by VBScript.