Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 15

Working With MTS Packages - The Package and Deployment Wizard

In order to add your component to an MTS package, you must first run the setup program for your component on the machine running MTS. Visual Basic includes an add-in that can be used to create setup programs. Although it can be used to provide distribution files and a setup program for any Visual Basic project type, this chapter will focus on using it to create the setup program for an ActiveX DLL. It must be noted that the term ‘package’ is meant in a different sense when in the context of the Package and Deployment Wizard.

If you have used the Setup Wizard from previous versions of Visual Basic, the Package and Deployment Wizard will be very familiar:

STEP BY STEP
15.3 Add the Package and Deployment Wizard to the Add-Ins Menu

The first step in using the Package and Deployment Wizard is to make sure that the add-in is enabled:

  1. From the Visual Basic development environment, go to the Add-Ins menu and select the Add-In Manager menu item.

  2. From the Available Add-Ins list, select Package and Deployment Wizard.

  3. While the Package and Deployment Wizard is selected, click both the Loaded/Unloaded check boxes and the Load on Startup check box in the lower-right corner of the dialog box.

  4. Click OK.

  5. Click on the Add-Ins list again, and notice that the Package and Deployment Wizard now shows up as an item in the menu.

Once the Package and Deployment Wizard is available in the Add-Ins menu, you are ready to create a setup program for your ActiveX DLL. The wizard simplifies this process by reading your project in an intelligent manner. It checks for DLL dependencies, references to other COM components, as well as file dependencies related to any ActiveX controls used in your project. If your component needs additional files to function properly (such as local databases, INI files, text files, etc.) and they are not detected by the wizard, you may manually add them. The Package and Deployment Wizard is best explained through a step by step example:

STEP BY STEP
15.4 Use the Package and Deployment Wizard to Create a Setup Program

  1. Before you start the Package and Deployment Wizard, you must have already compiled your DLL. If you choose not to compile, the wizard will direct you to do so. It’s a good idea to save the project before proceeding. After this has been done, select the Package and Deployment Wizard from the Add-Ins menu.

  2. Click on the button that is labeled Package (see Figure 15.7).

    The wizard allows you to create setup files for your Visual Basic project and provides you with means to deploy them.
    FIGURE 15.7 The wizard allows you to create setup files for your Visual Basic project and provides you with means to deploy them.

  3. If you did not save your project before the wizard was started, the wizard will prompt you with a warning that the source files are newer than the compiled DLL. You can choose to have the wizard recompile, but if you had just recompiled this would not be necessary and you could click the No button.

  4. The next dialog box allows you to select the package type. You will be presented with three choices (see Figure 15.8):

    For an ActiveX DLL, select Standard Setup Package.
    FIGURE 15.8 For an ActiveX DLL, select Standard Setup Package.

    • Standard Setup Package
    • Internet Package
    • Dependency File

  5. Select the Standard Setup Package. The Internet Package is used to distribute software such as ActiveX controls via the Web. A dependency file is used to document the file dependencies of your project. This could be necessary if your project becomes a subproject of another project. For example, your project might be an ActiveX DLL that will be referenced by another Standard EXE project. In this case, the EXE depends on your DLL and any subsequent file in the DLL’s dependency list.

  6. After you have selected the Standard Setup Package item, click on the Next button to go to the Package Folder screen. Here you will specify the path to the setup files. Notice that it defaults to the same path as your DLL in a Package folder.

  7. Click Next.

  8. The resulting dialog box asks if you want to create a folder called Package. Click Yes.

  9. The next window shows the Included Files. These are all the files that the wizard detected as necessary to support your DLL. Notice that you can manually add more files by clicking the Add button. See Figure 15.9.

    These files will be included on all clients who use the setup program
    FIGURE 15.9 These files will be included on all clients who use the setup program

  10. Click Next.

  11. The Cab Options window allows you to select how the setup package will be created. You have the choice between a Single cab, suitable for a network distribution, or Multiple cabs, suited for floppy distribution.

  12. Make sure that Single cab is selected and click Next.

  13. The next screen allows you to type in the title that is displayed in the setup program as it is running. Click Next.

  14. The Start Menu Items window makes it possible for you to have the setup program add Start Menu items. Since this will be a DLL, it is not necessary to add anything.

  15. Click Next.

  16. The Install Locations window allows you to select the target location of your program. Click Next.

  17. The wizard will then prompt you to check if your DLL should be installed as a shared file. Since this is a DLL, it’s probably a good idea to check it off. Basically, the operating system will keep a usage count of the DLL if it is a shared file. In other words, if more than one setup program adds that DLL to the system, the usage count is incremented accordingly. If an application using the DLL is uninstalled, the operating system will keep the DLL in place if the usage count has not reached zero.

  18. With your DLL’s check box selected, click Next.

  19. The wizard will create a setup script with corresponding entries for every setup option you chose. The title of this script is displayed in the Finished window.

  20. To complete the process, click the Finish button. The wizard will then package your DLL and all support files into a single CAB file. When it is complete, it will show you a Packaging Report screen.

  21. Click the Close button on the report screen and then the Close button on the wizard.


  

<< Previous | Content | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved