Microsoft Corporation
December 1999
Summary: This article lists the basic steps involved in creating, configuring, and building a Microsoft Windows Installer package (.msi) file with Microsoft Visual Studio Installer. (14 printed pages)
Click to download the VFP_VSI.exe sample file.
Microsoft® Visual Studio® Installer is a graphical tool that simplifies the creation of application setup programs for distribution to single user or enterprise-wide desktops. Setups created with the Visual Studio Installer provide advanced capabilities such as centralized distribution for maintenance and updates, application self-repair, and powerful installation rollback facilities.
Visual Studio Installer setups are based on the new Microsoft Windows® installer technology. The Windows installer reduces the total cost of ownership (TCO) for customers by enabling them to efficiently install and configure applications. The Windows installer is part of the Windows 2000 and Zero Administration Windows (ZAW) efforts to reduce the overall cost of deploying, using, and managing desktop computers.
For more information on the Visual Studio Installer, visit the Visual Studio Web site, http://msdn.microsoft.com/vstudio/downloads/vsi/default.asp. In addition, you can read the Visual Studio Installer documentation.
This tutorial lists the basic steps involved in creating, configuring, and building a Microsoft Windows Installer package (.msi) file with Microsoft Visual Studio Installer. An .msi file is a storage file containing the instructions and data required to install an application.
This tutorial will show how to author an .msi file to configure the installation of a Visual FoxPro® application. It will also show how to launch the .msi file and install the application.
To author and launch an .msi file with Visual Studio Installer, complete these tasks:
For the purposes of this demo, the Visual FoxPro Application Wizard was used to create an application called VFPVSIDemo. The application was then built into an EXE, called VFPVSIDemo.exe.
The data used by the application is in a folder named Data. This folder is a subfolder of the main application folder.
Make a note of the directory in the Location textbox. This is where the application installer file you create will be located. You can change the location for your project if you like.
Figure 1. Creating a new Visual Studio Installer project
Visual Studio Installer creates your installer project. The Project Explorer displays your installer project hierarchy. You can expand the Target Machine node to start setting up the configuration of your installed product on the target machine.
Figure 2. Empty Visual Studio Installer project
For more detailed information about creating installer projects, see Creating and Opening Installer Projects.
The File System editor in Visual Studio Installer gives you a way to configure your application files on the target machine while you add them to the installer project.
The File System editor displays the file(s) you added in the folder you selected. The files are also listed in the installer project Files node in the Project Explorer.
Figure 3. Files added to the installer project
This places a shortcut to the file VFPVSIDemo.exe on the user’s Start menu.
See the following topics for more detailed information about working with files in an installer project:
For information about: | See: |
The Visual Studio Installer File System editor | File System Editor |
Adding files to an installer project | Adding Files to an Installer Project |
Adding, moving, or deleting different kinds of files in an installer project and managing the file structure of installer components | Managing Components, Files, and Folders in an Installer Project |
Setting file properties | File Properties |
In the previous step, you added the application files to the installer project. In this step, you will add the data files, which reside in a different directory.
Figure 4. Data files added to the installer project
The Project Properties dialog box appears. You can view or change the project properties in the Project Properties dialog box.
For information about the different project properties and how to modify them, see Project Properties Dialog Box.
With the Visual Studio Installer Registry editor, you can specify registry values and keys in the target machine system.
The Registry editor appears.
See the following topics for more detailed information about manipulating the target machine registry:
For information about: | See: |
Adding and deleting registry keys and values, as well as setting registry values | Manipulating the Target Machine Registry |
The Visual Studio Installer Registry editor | Registry Editor |
Setting properties for registry entries | Registry Properties |
With the Visual Studio Installer Associations editor, you can specify how the target machine operating system will install and register your document types, MIME types, COM objects, and type libraries.
The Associations editor appears.
See the following topics for more detailed information about working in the Associations editor:
For information about: | See: |
Working with document types, extensions, verbs, MIME types, COM objects, and type libraries | Setting File, MIME, COM Object, and Type Library Associations |
The Visual Studio Installer Associations editor | Associations Editor |
Configuring properties for document types, file extensions, verbs, COM objects, and type libraries | Visual Studio Installer Object Properties |
With the Visual Studio Installer User Interface editor, you can customize the installation run-time display. Specifically, you can specify and customize dialogs that are displayed during the installation process.
The User Interface editor appears.
See the following topics for more detailed information about installation user interface dialogs:
For information about: | See: |
Available user interface dialogs | Installation User Interface Dialogs |
The Visual Studio Installer User Interface editor | User Interface Editor |
Adding dialogs to the installer project | Adding Installation Dialogs |
Deleting dialogs from the installer project | Deleting Installation Dialogs |
Customizing available dialogs | Customizing Installation Dialogs |
Working with dialog properties | User Interface Dialog Properties |
A merge module (.msm file) is a single package that includes all files, resources, registry entries, and setup logic to install a shared component. Visual FoxPro applications should always include the following merge modules:
The files MSVCRT.MSM and OLEAUT32.MSM ship with Visual Studio Installer. You can find these and other merge modules in the directory c:\Program Files\Microsoft Visual Studio\Common\Tools\VSInst\BuildRes.
Note The files contained in MSVCRT.MSM and OLEAUT32.MSM are automatically installed by Windows 2000. Therefore you do not need to add these merge modules to the Installer project if you know the application will only be installed on Windows 2000.
Save the file VFP6RUN.MSM (available from the sample download at the top of this article) to the directory with the other merge modules.
The VFP6RUN.MSM merge module installs and properly registers the Visual FoxPro 6.0 run-time libraries. Refer to Using Microsoft Visual Studio Installer for Distributing Visual FoxPro 6.0 Applications for a reference guide to other available merge modules that ship with Visual Studio Installer.
After you configure all elements of an application’s installation in your installer project, you must build the project into an installer package (.msi) file. You can then distribute the .msi file to users who want to install your application.
—or—
Note For information about these options, see the Build Tab (Project Properties Dialog Box) topic.
You should see the message Solution Update Succeeded in the Status Bar if the project built successfully. If errors occurred, you should see them in the Task List.
For more information, see Building an Installer Package (.msi) File.
For development and debugging purposes, the best way to launch your installer package (.msi) file is from within the Microsoft development environment.
Figure 5. Opening screen of VFPVSIDemo Setup Wizard
Figure 6. Select Installation Folder step in VFPVSIDemo Setup Wizard
For more information about these Windows installer requirements and launching an installer package file, see Launching an Installer Package File.
Note If you set the Build Type as Installer with Windows Installer Loader in the previous step, you should run SETUP.EXE file to test your setup.
Run the application to confirm the installation succeeded. If you accepted the defaults, the application is installed in the directory C:\Program Files\VFPVSIDemo and the data is installed in C:\Program Files\VFPVSIDemo\Data.
Your application is now ready for distribution. The file VFPVSIDEMO.MSI contains the application and the files in the VFP6RUN.MSM merge module.
Figure 7. Repair or Remove in VFPVSIDemo Setup Wizard