How to deploy visual c ++ using xcopy

Source: Internet
Author: User
Tags winsxs folder

How to deploy visual c ++ using xcopy

Source: http://msdn2.microsoft.com/zh-cn/library/ms235291%28VS.80%29.aspx

 

This topic describes how to deploy an application by copying an application file from one computer to another. This technology is useful for debugging applications on other computers. For the background of this deployment scheme, see the deployment scheme example.

Deploy visual c ++ library dll as a shared assembly

The Visual C ++ component package can be used to deploy the release versions of all visual C ++ libraries. This package has three versions (x86, x64, and IA64) that can be used on windows of the corresponding version. This package only installs the released version of the Visual C ++ library. The debug version can be deployed either as a private assembly or by using the debug version of the Visual C ++ merge module. How to Use: use the "installation and deployment project" described in the installation and deployment project to package the debugging version of the merged module and the debugging version of the application. You can also use Windows Installer (msiexec.exe) to install the merging module. For more information, see How to: prepare a test machine to run a debug executable.

To deploy the Visual C ++ library using the Visual C ++ component package, perform the following steps:

Procedure
  1. Create a folder structure on the development computer to make it consistent with the folder structure that will be used on the target computer. In this example, create a/bin folder and copy myapplication.exe to it. Create a/bin/mylibrary folder and copy mylibrary. DLL to it.

  2. Copy the folder to the target computer.

  3. Copy the Visual C ++ component package (vcredist_x86.exe) from % progdir %/Microsoft Visual Studio 8/SDK/V2.0/bootstrapper/packages/vcredist_x86/vcredist_x86.exe to the target computer

    Note:

    For applications generated in Visual C ++ quick release, we recommend that you re-release the Visual C ++ library using the Visual C ++ component package (vcredist_x86.exe. Visual c ++ quick release does not install this package, but you can use Microsoft Visual C ++ 2005 redistributable package (x86) (Microsoft Visual C ++ 2005 component package (x86) to download it.

  4. Run vcredist_x86.exe on the target computer. This will install all visual C ++ libraries as shared assembly. On the list-based bound target computer (Windows XP Home Edition, Windows XP Professional, Windows Server 2003) that supports applications to their dependencies, these libraries will be installed in the winsxs folder. These libraries are installed in the winsxs and system32 folders on computers that do not support similar binding (Windows 98, Windows 98 Second edition, Windows Millennium Edition, and Windows 2000.

    Note:

    To deploy a 64-bit application to a 64-bit operating system, use vcredist_x64.exe or vcredist_ia64.exe. These package packages can also be downloaded from Microsoft Visual C ++ 2005 reusable package (x64) and Microsoft Visual C ++ 2005 reusable package (IA64)

    Note:

    Vcredist _ *. EXE only installs the released version of Visual C ++ DLL. The debug version should only be deployed as a private assembly. For more information, see the next process.

  5. Your application can run.

Deploy visual c ++ library dll as a private assembly

In this solution, you only need to copy a folder from the development computer to the target computer and install the related Assembly as a private parallel assembly to deploy the application. To deploy the Visual C ++ library as a private assembly, perform the following steps:

Procedure
  1. Create a folder structure on the development computer to make it consistent with the folder structure that will be used on the target computer. In this example, create a/bin folder and copy myapplication.exe to it. Create a/bin/mylibrary folder and copy mylibrary. DLL to it.

  2. Copy Microsoft. vc80.crt and Microsoft. vc80.mfc from % progdir %/Microsoft Visual Studio 8/VC/redist/x86 to/bin and/bin/mylibrary on the development computer.

    Note:

    During installation, Visual C ++ does not create % progdir %/Microsoft Visual Studio 8/VC/redist/on the development computer /. To re-release the Visual C ++ library for applications generated using Visual C ++, use the Visual C ++ re-release package (vcredist _ *. EXE ). For more information, see the previous section "Deploying visual c ++ library dll as a shared assembly.

    Note:

    To deploy a 64-bit application to a 64-bit operating system, use/VC/redist/amd64 or/VC/redist/IA64.

  3. Copy the/bin folder to the target computer. There is no need for further preparation on the target computers that support configuration-based binding (Windows XP Home Edition, Windows XP Professional, and Windows Server 2003. On computers that do not support similar binding (Windows 98, Windows 98 Second edition, Windows Millennium Edition, and Windows 2000), the path must contain Microsoft. vc80.crt and Microsoft. vc80.mfc.

    Note:

    For application debugging, use the debug DLL in/VC/redist/debug_nonredist. However, remote debugging may fail for applications that deploy the debug version of the Visual C ++ library as a private assembly. For more information, see prepare a test computer for running debugging executable files.

    Note:

    To perform remote debugging on the target computer, you must copy all the debug DLL files or install the debug DLL according to the steps in the test computer on which you prepare the debug executable file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.