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)
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/tools/vsi11/default.aspx. In addition, you can read the Visual Studio Installer documentation.
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:
The data used by the application is in a folder named Data. This folder is a subfolder of the main application folder.
See the following topics for more detailed information about working with files in an installer project:
For information about the different project properties and how to modify them, see Project Properties Dialog Box.
See the following topics for more detailed information about manipulating the target machine registry:
See the following topics for more detailed information about working in the Associations editor:
See the following topics for more detailed information about installation user interface dialogs:
For more information, see Building an Installer Package (.msi) File.
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/tools/vsi11/default.aspx. In addition, you can read the Visual Studio Installer documentation.
Tutorial
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:
- Open Visual Studio Installer and create an installer project as part of a Visual Studio solution.
- Add files to the installer project and configure file properties.
- If desired, configure the project properties.
- If desired, establish how to modify the target machine system registry when your product is installed and configure registry properties.
- If desired, establish how the target machine operating system will handle your installed document types, MIME types, COM objects, and type libraries, and configure properties for each of these objects.
- If desired, control and customize the installation dialogs presented when your users run the installer package file to install, repair, or uninstall your product.
- Add merge modules to the project.
- Build the installer package file.
- Test the installer package file.
- Distribute the application.
Create an Application to Distribute
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.
Step 1: Open Visual Studio Installer
- Click Start, and select Programs.
- From the Programs menu, select Microsoft Visual Studio 6.0, and then select Microsoft Visual Studio 6.0 Enterprise Tools.
- From the Microsoft Visual Studio 6.0 Enterprise Tools menu, click Visual Studio Installer.
- The Microsoft Development Environment launches, and you can create a new installer project from the New tab in the New Project dialog box.
- Create an empty installer project by highlighting the Empty Installer icon.
- Enter VFPVSIDemo as the name of the project. 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.
- Choose Open.
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.Step 2a: Add Application Files to the Installer Project
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.- In the Project Explorer, expand the Target Machine node.
- Double-click File System in the Target Machine node.
- In the File System editor, right-click Application Folder.
- Select Add File(s) from the context menu.
- In the Browse for Files dialog box, navigate to the directory that contains the application. Select the files you want to add. In this case, choose the file VFPVSIDemo.exe.
- Click Open.
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 - In the File System editor, select User’s Start Menu.
- In the Name column, right-click and select Create Shortcut.
- In the Shortcut Properties dialog, select VFPVSIDemo.exe and choose OK.
- Right-click the shortcut and choose Rename. Rename the shortcut VFPVSIDemo.
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 |
Step 2b: Add Data Files to the Installer Project
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.- In the File System editor, right-click Application Folder.
- Select Add Folder from the context menu.
- Change the name of the new folder to Data.
- In the File System editor, right-click Data.
- Select Add File(s) from the context menu.
- In the Browse for Files dialog box, navigate to the directory that contains the application. Select the files you want to add. In this case, choose each of the data files.
- Click Open.
Figure 4. Data files added to the installer project
Step 3: (Optional) Configure Project Properties
- Select the VFPVSIDemo project in the Project Explorer window.
- At the end of the Project menu, select the VFPVSIDemo Properties option.
For information about the different project properties and how to modify them, see Project Properties Dialog Box.
Step 4: (Optional) Modify the Target Machine System Registry
With the Visual Studio Installer Registry editor, you can specify registry values and keys in the target machine system.- In the Project Explorer, expand the Target Machine node under your installer project.
- Double-click Registry in the Target Machine node.
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 |
Step 5: (Optional) Establish Document and MIME Type and COM Object Associations
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.- In the Project Explorer, expand the Target Machine node under your installer project.
- Double-click Associations in the Target Machine node.
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 |
Step 6: (Optional) Customize the Installation Run-Time Dialog Boxes
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.- Open the solution containing your Visual Studio Installer project.
- In the Project Explorer, expand the Target Machine node under your installer project.
- Double-click User Interface in the Target Machine node.
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 |
Step 7: Add Merge Modules
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:- VFP6RUN.MSM
- MSVCRT.MSM
- OLEAUT32.MSM
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.
- Choose Add Merge Module(s) from the Project menu.
- In the Browse for Merge Module dialog highlight the file VFP6RUN.MSM and choose Open.
Step 8: Build an Installer Package (.msi) File
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.- In the Project Explorer, select your installer project.
- Make sure the Build type project property (on the Build tab of the Project Properties dialog box) is set to either:
- Installer
- Installer with Windows Installer Loader
Note For information about these options, see the Build Tab (Project Properties Dialog Box) topic.
- With the installer project selected in the Project Explorer, select Build from the Build menu.
For more information, see Building an Installer Package (.msi) File.
Step 9: Test the 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.- In the Project Explorer window, right-click the VFPVSIDemo project.
- Select Launch Installer from the context menu.
- Select Next on the opening screen of the VFPVSIDemo Setup Wizard.
Figure 5. Opening screen of VFPVSIDemo Setup Wizard
- In the Select Installation Folder step, you can choose to install the application in the default directory or change the directory.
Figure 6. Select Installation Folder step in VFPVSIDemo Setup Wizard
- In the Confirm Installation step, select Next to begin the installation.
- When the installation is complete, select Close to exit the VFPVSIDemo Setup Wizard.
- Choose VFPVSIDemo from the Start menu to launch the application.
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.
Step 10: Distribute the Application
Your application is now ready for distribution. The file VFPVSIDEMO.MSI contains the application and the files in the VFP6RUN.MSM merge module.- Locate the VFPVSIDemo.msi file. If you accepted the default Location when you created the project, it will be in a directory such as Visual Studio Projects\VFPVSIDemo\Output\DISK_1\.
- To launch the installer, double-click the file VFPVSIDemo.msi.
- Open the VFPVSIDemo Setup Wizard. Choose Repair VFPVSIDemo to reinstall the application. Choose Remove VFPVSIDemo to uninstall the application. Then choose Finish.
Figure 7. Repair or Remove in VFPVSIDemo Setup Wizard
0 komentar:
Posting Komentar