Generating a setup, step-by-step


The process of generating the setup depends on the tools you select to create the installation package. In this section we demonstrate the concepts needing consideration for an application deployment with VFP data. The tool we use for the demonstration is InstallShield Express 3.54 full edition (not the limited edition shipping with Visual FoxPro 7/8). They are very similar (see Appendix A, ‚“How To: InstallShield Express, ‚½ for more details on the differences) and because many developers we talked to use the limited edition we decided the experience demonstrated can easily carry over to your projects.

The purpose of this section is not to show you how to use InstallShield Express (again, see Appendix A for this); rather it shows you how to implement concepts necessary to deploy the various components of a single workstation or LAN-based application solution using a professional installer tool.

Step 1 ‚ Organizing your setup

The first step is to organize your setup. This section allows you to define information displayed in the setup steps and the Windows Add/Remove Programs applet. You define the features files are assigned to, determine what setup types display to the user installing the application, and what features install for the setup type.

The general information (see Figure 17 ) you enter into a Windows Installer based installation tool displays in the setup steps. The product name displays on the introductory screen. The product version, package code, and upgrade code determine if the install is a small update, minor update, or major update (see section ‚“Updates, upgrades, and patches ‚½ in Chapter 5, ‚“Windows Installer Inside and Out, ‚½ and ‚“Upgrade installs ‚½ in Chapter 9, ‚“Support and Ch-Ch-Changes ‚½ for complete details). The INSTALLDIR is the default directory presented to the user if the Destination Folder dialog is selected (see section ‚“Customizing the setup steps ‚½ later in this chapter). The user can change this folder. We recommend using the predefined ProgramFilesFolder destination folder as the base for the installation folder to follow Windows standards. Any subfolder under ProgramFilesFolder is fine and defined by your own standards or the standards defined by your customer.


Figure 17. The settings we typically make for the General Information section.

The Summary Information Stream details are stored in the Windows Installer database file (MSI), and are available on the Summary page of the file properties dialog available in the Windows Explorer. The Schema is important because it determines the minimum version of the Windows Installer used to install the package you are creating. You can optionally select to install the Windows Installer engine as part of the build process. The key to selecting the Schema is to understand the operating systems on target computers. Windows Installer 2.0 requires Service Pack 6 on Windows NT. If you do not install the engine and the target computer does not have the proper engine loaded, an error displays and the installation does not run.

The Add/Remove Programs information helps the users get support contacts and defines how the uninstall process operates if the user decides to uninstall the application. Normally our customers know how to get in touch with us if there are problems with the application. This is not always the case so we always fill out this information just in case someone needs it. There are three options to disable the change button, remove button, and repair button. These options depend on your customer ‚ s requirements. We always set these to no so the user can perform all these operations if necessary. Do not confuse the Readme property with the Readme file included as part of the setup. This property defines the Readme text that appears on the Support Information dialog in the Add/Remove applet for the application (see ‚“Uninstalling ‚½ section of Chapter 9, ‚“Support and Ch-Ch-Changes ‚½).

The next step is to determine your features. The features are how you bundle files and the options available during a ‚“custom ‚½ install. InstallShield Express creates the ‚“Always Install ‚½ feature for you automatically. There are no absolutes when it comes to creating features. If you prefer to have all the files installed all the time, you can opt to have the one ‚“Always Install ‚½ feature. We prefer to break down the installation package into physical components to give our users a more flexible installation package. We create features for ActiveX, Runtimes , Application, OLE DB and ODBC, Help, Data, and CrystalReports85Feature. You will see what files we assign to each feature later in this chapter.

The last step to address in this section is the Setup Types (see Figure 18 ). InstallShield Express defaults to Typical, Minimum, and Custom. You can change these or accept the defaults. For this example we changed them to Workstation, Server, and Custom. You can set the keyboard hotkey by including an ‚“& ‚½ in front of the character you want as the hotkey. The reason we change it is to make it more obvious to our users what type of installation is taking place. You can also change the description for each setup type. This displays on the Setup Type dialog so the users can get more information based on the setup type they select.


Figure 18. After creating features, you determine which features install for a specific setup type. You can assign features to more than one setup type and alter the description for each of the setup types.
Table 5. Features are assigned to Setup Types. These are the settings in our example.

Feature

Workstation

Server

Custom

Always Install

X

X

X

ActiveX

X

X

X

Runtimes

X

X

X

Application

‚  

X

X

OLE DB and ODBC

X

‚  

X

Help

‚  

X

X

Data

‚  

X

X

Crystal Reports 85 Runtimes

X

X

X

Chapter 9, ‚“Support and Ch-Ch-Changes, ‚½ discusses upgrade paths in detail in so we do not address them here other than to say they are used for updates or upgrades of your application. For the purposes of this chapter we are going to install a new application for the first time.

Step 2 ‚ Specifying files deployed

Once you determine the features and setup types presented to the users you can determine which files to include in the package. You can individually select files or specify merge modules that include one or more files. Each file is assigned to one or more features. The features you include and how you bundle the features in the setup types determines how you select the files.

Individual files

At this stage of the process you need to understand which files to individually select and which files your installation package requires to be bundled in the various merge modules you plan on leveraging. First, you select the individual files to include in the package.

Table 6. Individual files selected for the installation package example.

Files

Application Feature

Data Feature

Help Feature

Demoapp.exe

X

‚   ‚  

ReadMe.txt

X

‚   ‚  

Customer.dbf

‚  

X

‚  

Customer.cdx

‚  

X

‚  

Demoapp.chm

‚   ‚  

X

To include the files in the package, first select the feature (see Figure 19 ), drill-down through the directories on the source computer until you find the folder. On the destination computer create the desired directory structure. Select the directory where you want the files installed. In the case of the Application feature, we want the application executable and the README.TXT file. Select these files on the source computer and drag them to the destination computer file pane (lower right in InstallShield Express.


Figure 19. Assigning files is accomplished by selecting the feature, and then dragging files from the source computer to the destination computer folders.

You may run into a situation requiring you to set individual properties for files. These properties determine the installation behavior for the individual files. You can determine the operating system they can be installed on, whether the files are never overwritten (during the install), are permanent (not deleted when uninstalled), or are shared (could be used by another application installation and only uninstalled if the application counter is 1). We find the advanced settings (see Figure 20 ) extremely important for data files, INI files, and configuration free tables. We do not want these overwritten because customers have their own settings already configured when we upgrade the application.


Figure 20. Setting file properties is important if you want to control the operating system the file is installed on, or make sure files are not overwritten, never deleted, or deleted only when it is the last application uninstalled.

Merge Modules

The merge modules are selected next. Most of the merge modules on our list (see Table 7 ) are based on the Crystal Reports v8.5 functionality included in the example. Naturally, we include the Visual FoxPro runtimes, the dependencies of the C++ runtimes, and GDI redistribution runtimes. The Microsoft Windows Common Controls merge module is needed for the slider control in the sample application. The rest of the merge modules are included based on dependencies of the other merge modules.

Table 7. The merge modules included in our setup example and the features to which they are assigned.

Merge Module

ActiveX

Runtimes

ODBC and OLE DB

Crystal Reports 85 Runtimes

Crystal Reports ‚ Active Data Driver

‚   ‚   ‚  

X

Crystal Reports ‚ ActiveXViewer Supplement

‚   ‚   ‚  

X

Crystal Reports ‚ Charting

‚   ‚   ‚  

X

Crystal Reports ‚ Charts

‚   ‚   ‚  

X

Crystal Reports ‚ Common ODBC

‚   ‚   ‚  

X

Crystal Reports ‚ Crystal ActiveX Control Common Dependencies

‚   ‚   ‚  

X

Crystal Reports ‚ Direct Access ‚ xBase Support

‚   ‚   ‚  

X

Crystal Reports ‚ Export CSV Format

‚   ‚   ‚  

X

Crystal Reports ‚ Export Excel Format

‚   ‚   ‚  

X

Crystal Reports ‚ Export Text Format

‚   ‚   ‚  

X

Crystal Reports ‚ Export to Application

‚   ‚   ‚  

X

Crystal Reports ‚ Export to MAPI

‚   ‚   ‚  

X

Crystal Reports ‚ Imploder

‚   ‚   ‚  

X

Crystal Reports ‚ Maps ‚ All Non-Grid Data

‚   ‚   ‚  

X

Files

‚   ‚   ‚   ‚  

Crystal Reports ‚ Maps Supplement

‚   ‚   ‚  

X

Crystal Reports ‚ MapX Project and License

‚   ‚   ‚  

X

Crystal Reports ‚ Print Engine Wrapper

‚   ‚   ‚  

X

Crystal Reports ‚ Report Designer Supplement

‚   ‚   ‚  

X

Crystal Reports ‚ SQL Semantics

‚   ‚   ‚  

X

Crystal Reports ‚ User Function Libraries

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Active Data and Crystal Data Object

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ ActiveXViewer

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Crystal ActiveX Control

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Crystal Report API

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Direct Access ‚ Exchange/Outlook

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Engine Access Core

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Export HTML Format

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Export PDF Format

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Export to Disk

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Export XML Format

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ HTML Translation

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Maps

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ ODBC ‚ XML

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Page Ranged Export

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ Report Designer Component

‚   ‚   ‚  

X

Crystal Reports 8.5 ‚ SQL Expressions

‚   ‚   ‚  

X

GDI Plus Redist module (required for all VFP 8 applications)

‚  

X

‚   ‚  

MFC 6.0

X

‚   ‚   ‚  

Microsoft C Runtime Library 6.0

X

X

‚   ‚  

Microsoft C++ Runtime Library 6.0

X

X

‚   ‚  

Microsoft C++ Runtime Library I/O 6.0

X

X

‚   ‚  

Microsoft Component Category Manager Library

X

‚   ‚   ‚  

Microsoft OLE 2.40 for Windows NT and Windows 95

X

‚   ‚   ‚  

Microsoft Visual C++ Runtime Library (required for all VFP 7/8 applications)

‚  

X

‚   ‚  

Microsoft Visual FoxPro 8 HTML Help Support Library

‚  

X

‚   ‚  

Microsoft Visual FoxPro 8 Runtime Libraries (required for all VFP 8 applications)

‚  

X

‚   ‚  

Microsoft Visual FoxPro ODBC Driver

‚   ‚  

X

‚  

Microsoft Visual FoxPro OLE DB Provider

‚   ‚  

X

‚  

Microsoft Windows Common Controls (6.0)

X

‚   ‚   ‚  

The Files and Features step in InstallShield Express is an excellent view for reviewing the individually selected files and the feature they were assigned to during the file selection step.

Step 3 ‚ Configuring the target computer

Configuring the target computer defines settings altered on the computer where the installation is run. It gives you the opportunity to define shortcuts, make or update Windows Registry entries, add ODBC datasource names , update INI entries, create custom file extensions, and create and set DOS environment variables .

We recommend at a minimum to have a shortcut to the application executable (see Figure 21 ). You can place a shortcut on the Windows Start menu, the users Startup folder, or the users Desktop. You can create folders under any of these directories, and then create shortcuts in these new folders. We like to create a folder underneath the Programs folder on the Start menu, and name this folder our company name. Under the company name folder, we create a folder for the application or application suite. Under this folder, we add shortcuts to the application executable, and optional shortcuts for the Help file, ReadMe file, and anything else that makes sense.


Figure 21. Creating shortcuts is important to provide users with access to the application.

Each shortcut has properties you can set. Depending on the operating system, the description displays as a tooltip for the shortcut on the menu. The Target is important to get right. In our example the Target is set to [INSTALLDIR]DEMOAPP.EXE. There are no backslashes and it is important to note INSTALLDIR is a property containing the fully qualified path the user enters or you specify for the installation. Adding a backslash creates a shortcut with two backslashes before the file name. If you include a directory under the provided INSTALLDIR, then include a backslash to separate those folders from the file name. For instance, if you wanted the Help file to go in a folder called Help under the INSTALLDIR you would have [INSTALLDIR]HELP\DEMOAPP.CHM. Visual FoxPro applications only have one icon, which is indexed as icon zero. First, you select the application executable for the Icon File property, and then select zero for the Icon Index property. This adds the application icon to the menu item. These are the minimum settings we recommend. You can change the working directory, add hot keys, arguments, and comments if you have these requirements.

The other section we cover in this setup is the ODBC DSN. In this particular deployment we have the requirement that the data be exposed to the end users so they can create some ad hoc reports using Microsoft Access. We expose this functionality via an ODBC DSN. See the section ‚“ODBC DSN ‚½ for all the details to select an existing DSN and include it in your installation package. It should be noted InstallShield Express (Limited Edition and full edition through 3.54) only allow you to add a DSN by selecting one that exists on your development machine.

Items we do not handle in our setup include the Registry, INI, File Extensions, and Environment Variables. Registry entries are common, but our sample application does not have any specific need for the Registry to be updated (we discussed this earlier in the chapter under the section ‚“Other configuration settings and Registry ‚½). INI files changes are less common these days as developers have migrated to the Windows Registry.

Step 4 ‚ Customizing the setup steps

The step where you customize the setup is very important because it determines which dialogs are included in the installation package, and allows you to configure how each of these steps look and work.

The dialog selection is a simple matter of selecting the dialogs you want to display during the installation. The Splash Bitmap displays when the SETUP.EXE starts. The Install Welcome allows you to display an initial screen noting the product name (defined in the General Information section of the setup, see Figure 22 ). Neither of these dialogs has any installation processing, and are basically just part of the ‚“ dancing chickens ‚½ to keep the user informed as the installation is starting. You can customize the copyright text if you prefer different language on the Install Welcome dialog.


Figure 22. If you do not want the end user to specify where the data is located and it is under the INSTALLDIR, alter the DATABASEDIR property in the General Information and skip the Database Folder dialog.

The License Agreement dialog allows you to display the all-important end user license agreement (EULA). This dialog is only necessary if you want the user to agree to a lengthy legal agreement before proceeding. This is particularly useful for vertical market applications. Custom applications are typically licensed via a contract between you and your client so this step is not as necessary. The ReadMe allows you to provide last minute information to the user who runs the installation. Both the license and ReadMe text files are best created and saved in rich text format (RTF). The RTF format allows for different formatting features (fonts, font sizes, color , bold, italic, underline, etc.) to be incorporated into the text. All word processors allow documents to be saved in RTF format. We recommend using a font close to the font used in the dialogs presented by the setup tool. In the case of InstallShield Express, you can set this font in the General Information settings. Plain ASCII files do not work with these dialogs.

The Customer Information dialog is one of the more important dialogs in this InstallShield Express process. This dialog allows the user to install the application for all users on the target computer via the ‚“Show All Users Option ‚½ property. We recommend setting this to ‚Yes ‚ so your customers have the option to install once for all the users on the target machine. If you do not provide this option and the users have two or more login IDs for the computer, they have to install the application for each user ID that runs the application. Optionally you can require a serial number to be entered by the user. We have not used this functionality in the past, but from the documentation it indicates how you provide a validation DLL and call it to determine if the serial number entered by the user is valid or not.

The Destination Folder dialog allows the user to determine the folder they want as the INSTALLDIR. Optionally you can turn off the option to change the folder. Your customers might determine the folder on the server where the application is going to reside and do not want the end user to change it. We usually allow for the flexibility because it is something we prefer to have in the software we purchase.

The Database Folder dialog allows you to expose a separate folder for the user to select the location of the data. If you have a directory under the INSTALLDIR, we recommend skipping this dialog and using the DATABASEDIR settings defined under the General Information. If you want the data folder to default to a specific folder, set the DATABASEDIR property and enable the Database Folder dialog. You can also disable the change folder if you want to show the user where the data is going to be installed, but not give them the chance to change it.

The Setup Type dialog is important if you want to allow the users to determine the features they want to install. You determine the Setup Types displayed on this dialog at the time you define the Setup Types as you organized your install in the first step of this process. The setups default to Typical, Minimum, and Custom, but we changed this to Workstation, Server, and Custom for this example. You must include the Custom Setup dialog if you expose the Custom setup type. The Custom Setup dialog is handy for system or network administrators to install specific components you do not include in the other two setup types and is the only way these other components can be installed.

The Ready to Install dialog provides the users one last bail out option before the installation proceeds. We like to include this dialog so the users can ask themselves one last time if they really want to go through the installation. If they cancel at this point, no harm is done. If this dialog is bypassed the installation proceeds right after they select the type of install they want.

The Setup Progress dialog is the ‚“dancing chickens ‚½ to show the user something is actually installing. If you do not select this dialog the user does not have an indication the installation is proceeding, except for them recognizing a CD-ROM spinning or the hard drive light flickering . The same is true with the Setup Complete Success dialog. Including this dialog is one way to have the users understand the setup ran to completion, and they are ready to proceed to the next step in the deployment instructions.

Each of the dialogs has a banner available (see Figure 23 ). InstallShield includes different banners for you to select from, or you can create your own. We created our own custom ones to demonstrate how this can be done. Each of the dialogs that support a banner has a property called Banner Bitmap. Select the image file you want to display on the dialog. Each dialog can be different if you choose, but you have to set each dialog individually if you want them different from the default.


Figure 23. You can change the graphic displayed at the top of the installation wizard by changing the Banner Bitmap property.
Note ‚  

The specifications for the banner sizes (see Figure 24 and Figure 25 ) are not necessarily the area you want your graphics located. Each of the banners covers areas where text displays. By extending a graphic over the entire image size , you run the risk of making the text hard to read.


Figure 24. The custom banner for dialogs that display the banner across the top need to be dimensioned 499 pixels wide by 58 pixels high.

Figure 25. The custom banner for dialogs that display the banner on the left side need to be dimensioned 499 pixels wide by 312 pixels high.
On The Web ‚  

There are several examples of banners included in the chapter downloads available from www.Hentzenwerke.com . The examples of banners that run along the top of the dialog are named BANNERTEMPLATE58X499.BMP (blank template for you to start your own banner) and BANNERTOPDF.BMP. The examples of banners that run along the left side are named BANNERTEMPLATE499x312.BMP (blank template) and BANNERLEFTDF.BMP

Billboards are informational images displayed during the install. We prefer not to use billboards because using them changes the look and feel of the installation to the look and feel of an installation performed by the VFP Setup Wizard. It changes the background to blue, and then displays images you want the customers to view during the install. We prefer to communicate via the ReadMe dialog, but the option is up to you. Optionally, you can change the text and messages displayed throughout the installation. Again, we did not find this feature necessary for our installation routines.

Step 5 ‚ Defining setup requirements and actions

This step of the process allows you to determine the requirements of the target machine and to even start the installation. You can define the operating system (which flavor of Windows from 95 to XP, or all), what processors (all, 486, Pentium), how much RAM (8, 16, 32, 64, 128, 256 or any megabytes), specify a minimum resolution, and finally the minimum color depth.

We use the RAM limitation (64MB) on almost all installations. If we are deploying a Visual FoxPro 8 application we eliminate the Windows 95 platform because it is not supported and we are not comfortable enough to seriously consider this a stable platform for our VFP 8 applications. The only time we consider Screen Resolution and Color Depth options is when the customer specifies these in the requirements. We like to develop applications to run on 800x600, but not all customers allow this restriction.

Note ‚  

Gotcha Alert! If you are using the InstallShield Limited Edition that ships with Visual FoxPro 7, and you specify one or more operating systems, your installation package fails to install on Windows XP (Home or Professional). This is not a minimum setting, it is an include/exclude setting. To enable installation of a VFP 7 app on Windows XP, be sure to select ‚“Any OS. ‚½

Step 6 ‚ Building the install package

Now that each step has been processed , you are ready to create the installation package. You have just a couple more decisions to make. The first is determining the media you want to distribute the installation on, and what MSI Engines to include.

There are some common options available for all the installation media options. You can determine which MSI Engine(s) you want to use for the install (see Figure 26 ). You can also distribute the engines for both the Windows NT and Windows 9x platforms, one of the platforms, or skip the engine distribution all together. If you know your customers have the engine you can decrease the size of the distribution by not including them. Our tests show a savings of only 3.4 megabytes between including both engines and not including either engine (see Table 8 ). We never trust that the engine we are using is installed so we always include the engines for all platforms we are deploying.


Figure 26. Each of the media options has properties you can select that determine how the final build is generated and what Windows Installer engine files are included.
Table 8. Build file sizes for sample project.

Compression Settings

With MSI Engines

Without MSI Engines

Compression

36.1 MB

32.7MB

Without Compression

79.1 MB

75.7 MB

All but the WebDeployment options have the ability to create an AUTORUN.INF file. If you include this file on the media (CD-ROM, DVD, or other), the operating system supports it, and the auto-running capability is enabled the installation starts when the media is inserted. Because most machines have this feature enabled, we always include the AUTORUN.INF file so we do not get the support call asking how to start the setup.

The CD-ROM release is the most common since most developers have CD-ROM burners, it is one of the cheapest methods of distribution, and most traditional workstation and LAN installations fit on a single CD-ROM. You have the option of compressing the files if the initial build does not fit on a single 650 MB CD-ROM. We use this option most often.

The Custom option is the only option letting you determine the exact media size without consideration for media specific standards. This is the option you need if you are distributing on a super disk like an Iomega Zip disk. The DVD options are all the same except for the media size. What it boils down to is selecting the option that fits your media.

Once all your options are selected, you can build your install package. First, select the one media option you want to build. Next, press the F7 key or select the Build Build <option> menu item. The menu item caption changes based on the selected media. A lot of text displays in the InstallShield Express Output window (see Figure 27 ). If errors occur during the build you need to review the text to see what is causing the errors to be recorded.


Figure 27. The goal of each build is to get zero errors and warnings. This build has problems so you have to review the output to see exactly what the problems are and fix them.

We have found a couple of common build problems with InstallShield Express. The build fails if you have a copy of Windows Explorer open to a folder in the tree structure that ISE creates during the build. The directories are deleted at the beginning of the build process. If any directory is in use, Windows does not allow the directory tree to be deleted and the build fails. Other errors commonly triggered is selecting the License or ReadMe dialogs and not including the RTF files correctly. A typo typically triggers this error.

Once the build is complete you can test it. The Test Your Build runs the build without installing the files (see Figure 28 ). It gives you a chance to review the dialogs and verify the process works as you expect. You can return to InstallShield Express and alter any of your properties at any step and rebuild and retest. You can repeat this iterative process as often as necessary.


Figure 28. Testing the build allows you to review the selected dialogs to validate the images and text changes you included in the package.

The last step is copying the files to the media you specified. InstallShield Express creates a folder under the folder where the InstallShield project file is located. This folder name is the same as the project you created. The name of the sample project created for this chapter is DeployFoxSample06, so the directory under the project directory is named:

<PROJECT FOLDER>\DEPLOYFOXSAMPLE06\EXPRESS\CD_ROM\DISKIMAGES\DISK1

Copy the files in the DISK1 folder to the CD-ROM and you are ready to install on a clean machine before sending it to your customer to test.




Deploying Visual FoxPro Solutions
Deploying Visual FoxPro Solutions
ISBN: 1930919328
EAN: 2147483647
Year: 2004
Pages: 232

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