Deploying a Desktop Application - PowerPoint PPT Presentation

1 / 47
About This Presentation
Title:

Deploying a Desktop Application

Description:

Chapter 21 Deploying a Desktop Application – PowerPoint PPT presentation

Number of Views:127
Avg rating:3.0/5.0
Slides: 48
Provided by: lao50
Category:

less

Transcript and Presenter's Notes

Title: Deploying a Desktop Application


1
Chapter 21
  • Deploying a Desktop Application

2
Key Deployment Terms (1)
  • The process of distributing an application is
    called deployment
  • Deploy an application by creating another type of
    projected called an installer
  • The installer produces a Setup.exe file that is
    run by the user
  • The Setup.exe file relies on other support files
    containing the actual program to install

3
Key Deployment Terms (2)
  • The players
  • The development computer is the computer where
    the Deployment project is built
  • The target computer is the end users computer
    where the Deployment project will be run

4
Steps in the Deployment Process
  • Configure a Windows Application project for
    release distribution
  • Create a Deployment project within an existing
    solution
  • Set global properties for the Deployment project
  • Configure the Deployment project using the visual
    editors
  • Compile the Deployment project and test the
    installer
  • Distribute the installer

5
Configuring a Project for Deployment
  • Visual Studio .NET supports two default
    configurations
  • Debug configuration is used for debugging
  • Program Debug Database (.pdb) file is created for
    debugging
  • Program is not optimized
  • Release configuration is used for distribution
  • DEBUG constant is not defined
  • Debug information is not generated
  • Program is optimized for performance
  • Custom configurations are also possible

6
Configuring an Application
  • The Configuration Manager lists all of the
    projects in a solution and is used to configure
    them
  • Configuration column is used to specify the
    desired configuration
  • Check the item in the Build column to build the
    project

7
Configuration Manager (Illustration)
8
Types of Deployment Projects
  • Setup Project creates an installer for removable
    media
  • CD or DVD for example
  • Web Setup Project builds an installer for
    Web-based deployment
  • Merge Module Projects are used to deploy Class
    Library projects
  • Cab Project used to create cabinet files
  • Cabinet files are similar to Zip files
  • They are not used much anymore

9
Add New Project Dialog box
Setup project
10
Multi-project Solutions
  • Until now, a solution has had a single project
  • Here we work with a Setup project and Windows
    application project in the same solution

11
Multi-project Solutions (Illustration)
  • The Solution Explorer displays all projects

12
Characteristics of Deployment Projects
  • Deployment projects do not contain namespace
    references
  • Deployment projects do not contain forms
  • Deployment projects do not contain code
  • Deployment projects are created and configured
    using different visual editors
  • It's just about all WYSIWYG

13
Properties of a Deployment Project
  • Many properties are set using the Projects
    Property pages. Others are set using the
    Properties window
  • Output file name contains the name of the
    installer
  • Package files list box defines how files will be
    deployed
  • Compression list box defines whether the
    installer is optimized for speed or size

14
Deployment Project (Property Pages)
15
General Deployment Project Properties (1)
  • Author and Manufacturer properties contain a
    company name
  • Description contains a free form description
  • DetectNewerInstalledVersion, if True causes the
    installer to prompt the user if a newer version
    is already installed
  • Localization creates custom installers for
    different languages
  • ManufacturerUrl property contains the companys
    URI

16
General Deployment Project Properties (2)
  • ProductName appears as the component description
    in the Add/Remove programs dialog box
  • RemovePreviousVersions property controls whether
    older versions will be removed
  • Version contains the version number of the
    installer
  • This is the version of the installer itself
    rather than the version of the deployed project

17
General Deployment Properties (Illustration)
18
Configuring a Deployment Project (Introduction)
  • Six Deployment Project Editors configure a
    Deployment project
  • In general, you need not write any code

19
Deployment Editors
  • File System Editor defines which files are
    installed on the target computer
  • File Types Editor associates files extensions
    with an application
  • User Interface Editor configures the dialog boxes
    the user sees when they run the installer
  • Launch Conditions Editor specifies target system
    requirements
  • Custom Actions Editor allows custom dialogs to be
    created
  • Registry Editor allows the installer to read and
    write Registry values

20
The File System Editor (Purpose)
  • It is used to define the layout file system
    layout on the target computer
  • Application Folder represents the files copied to
    the target computer
  • Define the items that will appear on the Start
    menu
  • Users Programs Menu folder
  • Add items to the target computers desktop
  • Users Desktop folder

21
The File System Editor (Illustration)
22
Adding Items to the Target File System
  • The Application folder contains four types of
    project items
  • Folders represent folders that will be created on
    the target computer
  • Project Outputs represents the distributable
    executable application(s) that will be copied to
    folders
  • Files are just other files to be deployed with
    the application
  • Data files, tutorial files, etc.
  • Assembly items is used to specify additional
    assembles needed by the application

23
Adding a Project Output
  • Five primary types of project outputs
  • Primary output the .exe and .dll files produced
    a result of compiling a project
  • It is possible to deploy multiple primary outputs
  • Localized resources Satellite assemblies for
    localized resource files
  • Debug Symbols Deploys the debugging information
  • Content Files Help files, data files, tutorial
    files, etc.
  • Source Files Deploys the source code for the
    application
  • We won't discuss documentation files and XML
    Serialization Assemblies

24
Add Project Output Group Dialog Box
25
Configuring the Start Menu and Desktop
  • Add items to the Users Programs Menu folder in
    the File System Editor to configure the Start
    menu
  • It is possible to create sub folders and deploy
    items to those sub folders
  • Add items to the Users Desktop folder to add
    outputs to the users desktop

26
Deploying Support Files
  • Using the File System Editor, create folders and
    sub folders
  • Add files to those sub folders

27
Creating File Associations
  • File associations bind file extensions to
    applications
  • Double-click a file in Windows Explorer and the
    application loads
  • An application may have multiple file
    associations
  • Two or more file extensions may be associated
    with the same application
  • Use care not to overwrite existing file
    associations (.doc, .xls, etc.)

28
Creating File Associations (Steps)
  • Use the File Types Editor to associate a file
    type with an executable file
  • Optionally, associate the file type with an icon
  • Icon appears in Windows Explorer
  • Modify the application, as necessary, to read to
    read and process the file when the application
    starts

29
The File Types Editor
  • Use to create file associations
  • A File Type (extension) has the following
    properties
  • Command property specifies the executable file
    that will be launched when the action is invoked
  • Description property value appears in Windows
    Explorer
  • Extensions property contains the file extension
  • Separate multiple file extensions with a
    semicolon ()
  • Icon property contains the associated icon

30
File Types Editor
31
Reading Command Line Arguments (1)
  • The Microsoft.VisualBasic.Command function gets
    command line arguments
  • Arguments are returned as a string
  • Remove the quotation marks surrounding the
    string, if necessary
  • pstrCommandArgs Microsoft.VisualBasic.Command()
  • pstrCommandArgs pstrCommandArgs.Remove(0, 1)
  • pstrCommandArgs pstrCommandArgs.Remove( _
  • pstrCommandArgs.Length 1, 1)

32
Reading Command Line Arguments (2)
  • In C, we read command line arguments
  • http//msdn.microsoft.com/en-us/library/cb20e19t(v
    VS.80).aspx

33
Custom Installer Dialog Boxes
  • An installer consists of multiple dialog boxes
    filled out by the user
  • The User Interface Editor is used to configure
    the dialog boxes when the user runs the installer
  • Add existing predefined dialog boxes to the
    installer
  • Configure the order in which those dialog boxes
    appear

34
Default Dialog boxes
  • By default, the User Interface Editor includes
    five dialog boxes
  • Welcome dialog box displays a welcome message
  • Installation Folder lets the user select the
    installation folder
  • Confirm Installation is the final chance to
    continue or abort the installation
  • Progress dialog box displays the relative
    completion
  • Finished dialog box indicates that the
    installation is complete

35
Custom Dialog Boxes (1)
  • Three RadioButtons dialog boxes
  • One contains 2 buttons, another 3, and another 4
  • Three CheckBoxes dialog boxes display between 1
    and 4 check boxes
  • Customer Information gets customer name and
    organization
  • Three TextBoxes dialog boxes display between 1
    and 4 text boxes
  • License Agreement dialog box displays a license
    agreement

36
Custom Dialog Boxes (2)
  • Read Me dialog box displays a multiline text box
    containing an informational message
  • Register dialog box allows the user to register
    online
  • Splash dialog box displays an introductory splash
    screen

37
The User Interface Editor
38
Adding a Dialog
39
License Agreement Dialog Box
  • License agreement is an RTF file
  • RTF file containing the license file must be
    added to the Deployment project
  • In the Properties window for the License
    agreement, select the project item containing the
    license file

40
Checkboxes Dialog Box
  • BannerBitmap contains the image appearing in the
    banner section
  • BannerText contains the text appearing in the
    banner area
  • CheckBox1Value indicates whether the checkbox is
    checked or not
  • CheckBox1Visible indicates whether the check box
    is visible
  • CheckBox1Property contains the name to be tested
    in a condition
  • Additional properties of the same name but
    different number are used to set the remaining
    three check boxes

41
Conditional Deployment (Introduction)
  • There are two ways to conditionally deploy files
  • In the Properties window of the File System
    Editor, deployable elements have a property named
    Condition
  • Use it to build a condition. If the condition is
    true, the file or other element will be deployed
    to the target computer. If the condition is
    False, the file will not be deployed
  • Launch conditions provide the means to test for
    the existence of a file for the installation to
    succeed
  • Test for Internet Explorer or a particular
    operating system version, for example

42
Creating a Launch Condition
  • Launch Conditions test the following types of
    conditions before deployment can succeed
  • Test whether a file or program exists and
    optionally, the version of that program
  • Test the version of the operating system
  • Test whether the .NET Framework is installed
  • Test the amount of physical memory installed on
    the computer

43
Launch Condition Properties
  • MsiNetAssemblySupport Used to determine if .NET
    is installed on the target computer
  • Version9X Used to determine if the OS version
    on the target is Windows 95, 98 or Windows ME
  • VersionNT Used to determine if the OS version
    on the target is Windows NT, Windows 2000 or
    Windows XP
  • PhysicalMemory returns the amount of physical
    memory installed in the target computer

44
Launch Condition Editor
45
File Launch Conditions
  • FileName contains the name of a file that must be
    installed on the target computer
  • MinDate and MaxDate control the minimum and
    maximum file dates
  • Folder property controls where the installer
    searches for file names
  • Depth project controls number of directory levels
    to search
  • MinVersion and MaxVersion controls minimum and
    maximum version number for files

46
Compiling the Installer
  • Compile the same way as any project would be
    compiled
  • Output files differ however
  • .msi file contains the deployment files
  • InstMsiA.exe and InstMsiW.exe read and process
    the .msi file
  • Setup.Exe program runs the installer
  • Setup.Ini file is read by the Setup.Exe program

47
Testing the Installer
  • There are Two ways to test the installer
  • From inside of Visual Studio .NET
  • Use to install or uninstall the software
  • Run Setup.Exe directly
  • The project will be installed just as the user
    will see it
Write a Comment
User Comments (0)
About PowerShow.com