Udostępnij za pośrednictwem


How to: Create a Windows Installer for a 64-bit Platform

The deployment tools in Visual Studio allow you to create installers for 64-bit applications and components. The TargetPlatform Property of a deployment project determines whether an installer will target a 32-bit or a specific 64-bit platform. The target platforms are x86 for 32-bit platforms, x64 for computers supporting the AMD64 and EM64T instruction sets, and Itanium for the 64-bit Itanium processor.

In addition, three special folders are available in the File System editor: for 64-bit applications, Common Files (64-bit), Program Files (64-bit), and System (64-bit) are the native folders; Common Files, Program Files, and System are the Windows on Windows folders.

In general, 32- and 64-bit Microsoft Installer (MSI) packages are treated in the same way except for how Windows Installer treats folder variables such as [Program Files] and [System Folder], and how it writes components into the registry or GAC. When you create a 32- or 64-bit MSI package, the processor architecture is noted in the .NET Framework assembly's strong name identity when it is installed in the GAC. You can also create setup projects for 64-bit computers from 32-bit computers.

64-bit MSI packages can support both 32- and 64-bit DLLs or EXEs to perform custom actions; however, 32-bit MSI packages cannot support 64-bit DLLs or EXEs to perform custom actions.

Whenever you add a file or assembly to a merge module project, it is scanned to determine whether it is a 32- or 64-bit target platform. This is done in order to ensure that your 64-bit merge modules do not contain a mix of 32- and 64-bit code. If the merge module contains a 32-bit file, Visual Studio will notify you with a message and will not add the file. If you add a managed assembly marked as 32-bit only, you will get build warnings, but the file or assembly will be included in the target installation.

To distribute a .NET Framework application both to 32- and 64-bit platforms, build two MSI packages, one targeted at a 32-bit and the other a 64-bit computer. The user can install the 32-bit setup project package and it will most likely run as a 64-bit application, only the 64-bit setup project will install to the "Program Files64" directory.

To distribute an MSI package, but not allow installation on 64-bit computers, add a new launch condition set to "NOT VersionNT64."

Note

Creating 64-bit MSI packages is not available in Visual Studio Express Edition.

Note

If you target an AMD Athlon64 or Opteron computer for the MSI package, you must have Windows Installer 3.0 or later installed.

Note

If a setup project targeting x86 includes a file from a 64-bit folder, that file will not be included in the MSI package, even if the installation is on a 64-bit computer.

To create an installer for a 64-bit platform

  1. Open a deployment project. For more information, see How to: Create or Add Deployment Projects.

  2. In the Solution Explorer, select the deployment project.

  3. In the Properties window, select the TargetPlatform property.

  4. Choose either Itanium for an Intel Itanium 64-bit platform, or x64 for any other 64-bit platform (such as AMD64 and EM64T instruction sets).

    At installation time, an error will be raised and installation will be halted if the target computer is not compatible with the specified platform.

To install files to the Common Files, Program Files, or System folder on a 64-bit platform

  1. In the Solution Explorer, select the deployment project.

  2. In the Properties window, make sure that the TargetPlatform property is set to either x64 or Itanium.

  3. On the View menu, point to Editor, and then click File System.

  4. In the File System editor, select the File System on Target Machine node.

  5. On the Action menu, choose Add Special Folder, and then choose Common Files (64-bit), Program Files (64-bit), or System (64-bit).

  6. Add the desired files to the new folder. For more information, see How to: Add and Remove Files in the File System Editor.

See Also

Tasks

How to: Create or Add Deployment Projects

How to: Add and Remove Files in the File System Editor

How to: Add Merge Modules to a Deployment Project

Reference

TargetPlatform Property

Concepts

Deploying 64-bit Applications

64-bit Applications

Other Resources

Deployment Tasks and Walkthroughs