Section 5.6.Distribute .NET Components


5.6. Distribute .NET Components

Visual Studio .NET uses Setup and Deployment projects to create the installation applications you use to distribute .NET components or any other type of application. These tools are greatly improved over the Visual Basic 6.0 setup wizards and there are a number of paths you can take to create an installation program for your .NET components.


Note: .NET Setup and Deployment projects create Windows installer files (.msi) that can be installed as standalone components or made part of a chained installation involving other applications including installations created using the Office Custom Installation Wizard (CIW).

5.6.1. How to do it

The following steps outline one of the possible paths:

  1. From Visual Studio .NET, choose File Add Project New Project. Visual Studio .NET displays the Add New Project dialog box.

  2. Follow the steps in the Setup Wizard to install a Windows application and select the Primary output for NetForExcel project group in Step 3 of the Wizard as shown in Figure 5-8.

    Figure 5-8. Select the primary output for the project to install


  3. When you click Finish in the Setup Wizard, Visual Studio .NET creates a folder for the setup project, determines the dependencies for NetForExcel, and creates a setup project as shown in Figure 5-9.

  4. From the Build menu, select Build Solution or Build setup project to package NetForExcel.dll and NetForExcel.tlb and build an installation program to install and register those files on a client's machine.

    Figure 5-9. Setup project for the NetForExcel component


  5. The setup project creates Setup.exe, Setup.msi , and Setup.ini files in its /Debug folder by default. Use those files to test deployment before changing the Setup project's configuration to Release and rebuilding.

5.6.2. How it works

The installation program created using the preceding steps installs the component in the /Program Files folder on the user's machine and registers the component's type library in the system registry. Excel workbooks that reference this type library use the system registry to find the component by its GUID (which is part of the code generated automatically when you create the COM class in .NET).

The installation program also creates an entry in users' application list so they can uninstall the application using the Windows Control Panel. In short, it does everything you need it to!



    Excel 2003 Programming. A Developer's Notebook
    Excel 2003 Programming: A Developers Notebook (Developers Notebook)
    ISBN: 0596007671
    EAN: 2147483647
    Year: 2004
    Pages: 133
    Authors: Jeff Webb

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net