Professional Documents
Culture Documents
Microsoft Visual FoxPro 6
Microsoft Visual FoxPro 6
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:
1. Open Visual Studio Installer and create an installer project as part of a Visual Studio solution. 2. Add files to the installer project and configure file properties. 3. If desired, configure the project properties. 4. If desired, establish how to modify the target machine system registry when your product is installed and configure registry properties. 5. 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. 6. If desired, control and customize the installation dialogs presented when your users run the installer package file to install, repair, or uninstall your product. 7. Add merge modules to the project. 8. Build the installer package file. 9. Test the installer package file. 10. Distribute the application.
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. 1. 2. 3. 4. 5. 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. 6. 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 7. In the File System editor, select Users Start Menu. 8. In the Name column, right-click and select Create Shortcut. 9. In the Shortcut Properties dialog, select VFPVSIDemo.exe and choose OK. 10. Right-click the shortcut and choose Rename. Rename the shortcut VFPVSIDemo. This places a shortcut to the file VFPVSIDemo.exe on the users Start menu. See the following topics for more detailed information about working with files in an installer project: For information about: The Visual Studio Installer File System editor 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 Setting file properties See: File System Editor Adding Files to an Installer Project Managing Components, Files, and Folders in an Installer Project File 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. 1. In the Project Explorer, expand the Target Machine node under your installer project. 2. Double-click Associations in the Target Machine node. The Associations editor appears. See the following topics for more detailed information about working in the Associations editor: For information about: Working with document types, extensions, verbs, MIME types, COM objects, and type libraries The Visual Studio Installer Associations editor Configuring properties for document types, file extensions, verbs, COM objects, and type libraries See: Setting File, MIME, COM Object, and Type Library Associations Associations Editor Visual Studio Installer Object Properties
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.
1. Choose Add Merge Module(s) from the Project menu. 2. In the Browse for Merge Module dialog highlight the file VFP6RUN.MSM and choose Open. The VFP6RUN.MSM merge module installs and properly registers the Visual FoxPro 6.0 runtime 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.
Installer with Windows Installer Loader Note For information about these options, see the Build Tab (Project Properties Dialog Box) topic.
3. With the installer project selected in the Project Explorer, select Build from the Build menu. 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.
Figure 5. Opening screen of VFPVSIDemo Setup Wizard 4. 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 5. In the Confirm Installation step, select Next to begin the installation. 6. When the installation is complete, select Close to exit the VFPVSIDemo Setup Wizard. 7. Choose VFPVSIDemo from the Start menu to launch the application. 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.
1. 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\. 2. To launch the installer, double-click the file VFPVSIDemo.msi. 3. Open the VFPVSIDemo Setup Wizard. Choose Repair VFPVSIDemo to reinstall the application. Choose Remove VFPVSIDemo to uninstall the application. Then choose Finish.