Lab 10: Creating an Installer Application

Lab 10: Creating an Installer Application

In this lab, you will create a setup project for the application you created in Chapter 8 and Chapter 9. You will use the Setup Project Wizard to create a setup project and configure the project with the Property Pages. You will add a shortcut to the desktop of the target computer and add a launch condition to verify that the operating system is Windows 2000 or later. In addition, you will build your setup project and install your application to your computer. Once installed, you will verify the security permissions for your application. The solution to this lab is available on the Supplemental Course Materials CD-ROM in the \Labs\Ch10\Solution folder.

Before You Begin

Before you begin this lab, you must have completed the Chapter 8 and Chapter 9 labs or loaded the Chapter 10 lab partial solution from the \Labs\Ch10\Partial folder on the CD-ROM.

Estimated lesson time: 30 minutes

Exercise 10.1: Creating the Setup Project

In this exercise, you will use the Setup Project Wizard to create a setup project for your application.

To create the setup project

  1. From the File menu, choose Add Project and then choose New Project. The Add New Project dialog box opens.

  2. In the left pane of the Add New Project dialog box, choose Setup And Deployment Projects. In the right pane, choose Setup Wizard. Name your project InternationalSales, and click OK to continue.

  3. In the Setup wizard, click Next to go to the Choose A Project Type page.

  4. Choose Create A Setup For A Windows Application. Click Next to go to the Choose Project Outputs To Include page.

  5. Choose Primary Output, Localized Resources, and Content Files for inclusion in the setup project. Click Next to continue.

  6. Click Next in the next step of the wizard, and then click Finish on the final step to create your setup project.

  7. In Solution Explorer, right-click InternationalSales and choose Properties. The InternationalSales Property Page opens.

  8. In the Bootstrapper drop-down menu, choose None to skip creating a bootstrapper application.

    NOTE
    If you are using a machine running Windows 2000, you should choose a Windows bootstrapper application instead of None.

  9. Click OK to close the property page.

  10. From the File menu, choose Save All to save your work.

Exercise 10.2: Configuring Your Application

In this exercise, you will create a shortcut for your application and add a launch condition to verify that the target machine is running Windows 2000 or later.

To add a shortcut to your application

  1. In Solution Explorer, click and highlight the setup project. From the View menu, choose Editor, File System to open the File System Editor.

  2. In the left pane of the File System Editor, click Application Folder to open the Application Folder. The output from your setup project should appear in this folder in the right pane of the File System Editor.

  3. In the right pane, right-click Primary Output and choose Create Shortcut. A new shortcut is created. Name the shortcut International Sales.

  4. Drag the shortcut to the User s Desktop Folder.

  5. From the View menu, choose Editors, Launch Conditions Editor to open the Launch Conditions Editor.

  6. Right-click Launch Conditions, and choose Add Launch Condition to add a new launch condition. Name the Launch Condition Windows2000.

  7. In the Properties window, set the Condition property to VersionNT>=500 to specify Windows 2000 or later. Set the Message property to You must be running Windows 2000 or later to install this application.

  8. In Solution Explorer, highlight the International Sales project, and from the Build menu, choose Build International Sales to build your setup application.

  9. From the File menu, choose Save All.

  10. Close Visual Studio .NET.

Exercise 10.3: Installing Your Application

In this exercise, you will install your application to your computer. You will test the shortcut added by your setup application, and you will verify the security policy for your assembly.

To install your application

  1. In Windows, browse to the folder containing your setup project. It should be in the Debug folder of your Setup Project folder.

  2. Double-click the International Sales icon, and follow the directions provided by the Windows Installer.

  3. After the Windows Installer has finished, locate the shortcut named International Sales on your desktop. Double-click the shortcut to open your application.

  4. Close your application.

  5. Open the Visual Studio .NET Command Prompt. Use the DOS cd command to change the current directory to the directory where your application is installed.

  6. Use the Permview.exe utility to view the security policy for your assembly. Use the /DECL flag to view all security declarations in the assembly. An example follows. (Note that the name of your application might differ, depending on how you named it.)

    Permview /DECL Chapter10.exe

    NOTE
    If your file name contains any spaces, you will be unable to use it with Permview.exe on the command line. In this case, you should enclose the file name in quotation marks to use Permview.exe.



MCAD(s)MCSD Self-Paced Training Kit(c) Developing Windows-Based Applications With Microsoft Visual Basic. Net a[.  .. ]0-316
MCAD(s)MCSD Self-Paced Training Kit(c) Developing Windows-Based Applications With Microsoft Visual Basic. Net a[. .. ]0-316
ISBN: 735619263
EAN: N/A
Year: 2003
Pages: 110

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