Skip to content

Commit b92c3cf

Browse files
authored
Merge pull request #1367 from msebolt/walkthrough-review-pr2
walkthrough review pr2
2 parents 51c6d7f + 1242ebd commit b92c3cf

4 files changed

+159
-140
lines changed
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Deploy an App By Using the Redistributable Package (C++) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "09/17/2018"
55
ms.technology: ["cpp-ide"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -25,9 +25,9 @@ You must have these components to complete this walkthrough:
2525

2626
### To use the Visual C++ Redistributable Package to deploy an application
2727

28-
1. Create and build an MFC application by following the first three steps in [Walkthrough: Deploying a Visual C++ Application By Using a Setup Project](../ide/deploying-visual-cpp-application-by-using-the-vcpp-redistributable-package.md).
28+
1. Create and build an MFC application by following the steps in [Walkthrough: Deploying a Visual C++ Application By Using a Setup Project](walkthrough-deploying-a-visual-cpp-application-by-using-a-setup-project.md).
2929

30-
2. Create a file, name it setup.bat, and add the following commands to it. Change `MyMFCApplication` to the name of your project.
30+
1. Create a file, name it setup.bat, and add the following commands to it. Change `MyMFCApplication` to the name of your project.
3131

3232
```cmd
3333
@echo off
@@ -36,55 +36,55 @@ You must have these components to complete this walkthrough:
3636
copy MyMFCApplication.exe "C:\Program Files\MyMFCApplication"
3737
```
3838
39-
3. Create a self-extracting setup file:
39+
1. Create a self-extracting setup file:
4040
4141
1. At a command prompt or in the **Run** window, run iexpress.exe.
4242
43-
2. Select **Create new Self Extraction Directive file** and then choose the **Next** button.
43+
1. Select **Create new Self Extraction Directive file** and then choose the **Next** button.
4444
45-
3. Select **Extract files and run an installation command** and then choose **Next**.
45+
1. Select **Extract files and run an installation command** and then choose **Next**.
4646
47-
4. In the text box, enter the name of your MFC application and then choose **Next**.
47+
1. In the text box, enter the name of your MFC application and then choose **Next**.
4848
49-
5. On the **Confirmation prompt** page, select **No Prompt** and then choose **Next**.
49+
1. On the **Confirmation prompt** page, select **No Prompt** and then choose **Next**.
5050
51-
6. On the **License agreement** page, select **Do not display a license** and then choose **Next**.
51+
1. On the **License agreement** page, select **Do not display a license** and then choose **Next**.
5252
53-
7. On the **Packaged files** page, add the following files and then choose **Next**.
53+
1. On the **Packaged files** page, add the following files and then choose **Next**.
5454
5555
- Your MFC application (.exe file).
5656
57-
- vcredist_x86.exe. This file is located in \Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x86\\.
57+
- vcredist_x86.exe. This file is located in \Program Files (x86)\Microsoft Visual Studio \<version>\SDK\Bootstrapper\Packages\. You can also download this file from [Microsoft](https://www.microsoft.com/download/confirmation.aspx?id=5555).
5858
5959
- The setup.bat file that you created in the earlier step.
6060
61-
8. On the **Install Program to Launch** page, in the **Install Program** text box, enter the following command line and then choose **Next**.
61+
1. On the **Install Program to Launch** page, in the **Install Program** text box, enter the following command line and then choose **Next**.
6262
6363
**cmd.exe /c "setup.bat"**
6464
65-
9. On the **Show window** page, select **Default** and then choose **Next**.
65+
1. On the **Show window** page, select **Default** and then choose **Next**.
6666
67-
10. On the **Finished message** page, select **No message** and then choose **Next**.
67+
1. On the **Finished message** page, select **No message** and then choose **Next**.
6868
69-
11. On the **Package Name and Options** page, enter a name for your self-extracting setup file, select the **Store files using Long File Name inside Package** option, and then choose **Next**. The end of the file name must be Setup.exe—for example, MyMFCApplicationSetup.exe.
69+
1. On the **Package Name and Options** page, enter a name for your self-extracting setup file, select the **Store files using Long File Name inside Package** option, and then choose **Next**. The end of the file name must be Setup.exe—for example, *MyMFCApplicationSetup.exe*.
7070
71-
12. On the **Configure restart** page, select **No restart** and then choose **Next**.
71+
1. On the **Configure restart** page, select **No restart** and then choose **Next**.
7272
73-
13. On the **Save Self Extraction Directive** page, select **Save Self Extraction Directive (SED) file** and then choose **Next**.
73+
1. On the **Save Self Extraction Directive** page, select **Save Self Extraction Directive (SED) file** and then choose **Next**.
7474
75-
14. On the **Create package** page, choose **Next**.
75+
1. On the **Create package** page, choose **Next**. Choose **Finish**.
7676
77-
4. Test the self-extracting setup file on the other computer, which does not have the Visual C++ libraries:
77+
1. Test the self-extracting setup file on the other computer, which does not have the Visual C++ libraries:
7878
79-
1. On the other computer, download a copy of the setup file, and then install it by running it and following the steps that it provides.
79+
1. On the other computer, download a copy of the setup file, and then install it by running it and following the steps that it provides. Depending on the options selected, installation might require the **Run as administrator** command.
8080
81-
2. Run the MFC application.
81+
1. Run the MFC application.
8282
8383
The self-extracting setup file installs the MFC application that is in the folder that you specified in step 2. The application runs successfully because the Visual C++ Redistributable Package installer is included in the self-extracting setup file.
8484
8585
> [!IMPORTANT]
86-
> To determine which version of the runtime is installed, the installer checks the registry key \HKLM\SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\\[platform]. If the currently installed version is newer than the version that the installer is attempting to install, the installer returns success without installing the older version and leaves an additional entry on the installed programs page in the Control Panel.
86+
> To determine which version of the runtime is installed, the installer checks the registry key \HKLM\SOFTWARE\Microsoft\VisualStudio\\\<version>\VC\Runtimes\\<platform>. If the currently installed version is newer than the version that the installer is attempting to install, the installer returns success without installing the older version and leaves an additional entry on the installed programs page in the Control Panel.
8787
8888
## See Also
8989
90-
[Deployment Examples](../ide/deployment-examples.md)
90+
[Deployment Examples](deployment-examples.md)<br/>
Lines changed: 65 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiling a C++ Program that Targets the CLR | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "09/17/2018"
55
ms.technology: ["cpp-ide"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -13,66 +13,70 @@ ms.workload: ["cplusplus"]
1313
---
1414
# Walkthrough: Compiling a C++ Program that Targets the CLR in Visual Studio
1515

16-
You can create Visual C++ programs that use .NET classes and compile them by using the Visual Studio Development Environment.
16+
You can create Visual C++ programs that use .NET classes and compile them by using the Visual Studio Development Environment.
17+
18+
For this procedure you can type your own Visual C++ program or use one of the sample programs. The sample program that we use in this procedure creates a text file named textfile.txt and saves it to the project directory.
19+
20+
## Prerequisites
1721

18-
For this procedure you can type your own Visual C++ program or use one of the sample programs. The sample program that we use in this procedure creates a text file named textfile.txt and saves it to the project directory.
19-
20-
## Prerequisites
21-
22-
These topics assume that you understand the fundamentals of the C++ language.
23-
24-
### To create a new project in Visual Studio and add a new source file
25-
26-
1. Create a new project. On the **File** menu, point to **New**, and then click **Project**.
27-
28-
1. From the Visual C++ project types, click **CLR**, and then click **CLR Empty Project**.
29-
30-
1. Type a project name.
31-
32-
By default, the solution that contains the project has the same name as the new project, but you can enter a different name. You can enter a different location for the project if you want.
33-
34-
Click **OK** to create the new project.
35-
36-
1. If Solution Explorer is not visible, click **Solution Explorer** on the **View** menu.
37-
38-
1. Add a new source file to the project:
39-
40-
- Right-click the **Source Files** folder in Solution Explorer, point to **Add** and click **New Item**.
41-
42-
- Click **C++ File (.cpp)** and type a file name and then click **Add**.
43-
44-
The **.cpp** file appears in the **Source Files** folder in Solution Explorer and a tabbed window appears where you type the code you want in that file.
45-
46-
1. Click in the newly created tab in Visual Studio and type a valid Visual C++ program, or copy and paste one of the sample programs.
47-
48-
For example, you can use the [How to: Write a Text File (C++/CLI)](../dotnet/how-to-write-a-text-file-cpp-cli.md) sample program (in the **File Handling and I/O** node of the Programming Guide).
49-
50-
If you use the sample program, notice that you use the `gcnew` keyword instead of `new` when creating a .NET object, and that `gcnew` returns a handle (`^`) rather than a pointer (`*`):
51-
52-
`StreamWriter^ sw = gcnew StreamWriter(fileName);`
53-
54-
For more information on the new Visual C++ syntax, see [Component Extensions for Runtime Platforms](../windows/component-extensions-for-runtime-platforms.md).
55-
56-
1. On the **Build** menu, click **Build Solution**.
57-
58-
The **Output** window displays information about the compilation progress, such as the location of the build log and a message that indicates the build status.
59-
60-
If you make changes and run the program without doing a build, a dialog box might indicate that the project is out of date. Select the checkbox on this dialog before you click **OK** if you want Visual Studio to always use the current versions of files instead of prompting you each time it builds the application.
61-
62-
1. On the **Debug** menu, click **Start without Debugging**.
63-
64-
9. If you used the sample program, when you run the program a command window is displayed that indicates the text file has been created. Press any key to close the command window.
65-
66-
The **textfile.txt** text file is now located in your project directory. You can open this file by using Notepad.
22+
These topics assume that you understand the fundamentals of the C++ language.
23+
24+
### To create a new project in Visual Studio and add a new source file
25+
26+
1. Create a new project. On the **File** menu, point to **New**, and then click **Project**.
27+
28+
1. From the Visual C++ project types, click **CLR**, and then click **CLR Empty Project**.
6729

6830
> [!NOTE]
69-
> Choosing the empty CLR project template automatically set the **/clr** compiler option. To verify this, right-click the project in **Solution Explorer** and clicking **Properties**, and then check the **Common Language Runtime support** option in the **General** node of **Configuration Properties**.
70-
71-
## What's Next
72-
73-
**Previous:** [Walkthrough: Compiling a Native C++ Program on the Command Line](../build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md) &#124; **Next:**[Walkthrough: Compile a C Program on the Command Line](../build/walkthrough-compile-a-c-program-on-the-command-line.md)
74-
75-
## See Also
76-
77-
[C++ Language Reference](../cpp/cpp-language-reference.md)<br>
78-
[Building C/C++ Programs](../build/building-c-cpp-programs.md)
31+
> If the **CLR Empty Project** type is missing (Visual Studio 2017 only), select **Open Visual Studio Installer** in the left pane of the **New Project** dialog box. Install the option located under **Desktop development with C++** in the **Optional** components section, named **C++/CLI Support**.<br/>
32+
33+
1. Type a project name.
34+
35+
By default, the solution that contains the project has the same name as the new project, but you can enter a different name. You can enter a different location for the project if you want.
36+
37+
Click **OK** to create the new project.
38+
39+
1. If **Solution Explorer** is not visible, click **Solution Explorer** on the **View** menu.
40+
41+
1. Add a new source file to the project:
42+
43+
- Right-click the **Source Files** folder in **Solution Explorer**, point to **Add** and click **New Item**.
44+
45+
- Click **C++ File (.cpp)** and type a file name and then click **Add**.
46+
47+
The **.cpp** file appears in the **Source Files** folder in **Solution Explorer** and a tabbed window appears where you type the code you want in that file.
48+
49+
1. Click in the newly created tab in Visual Studio and type a valid Visual C++ program, or copy and paste one of the sample programs.
50+
51+
For example, you can use the [How to: Write a Text File (C++/CLI)](../dotnet/how-to-write-a-text-file-cpp-cli.md) sample program (in the **File Handling and I/O** node of the Programming Guide).
52+
53+
If you use the sample program, notice that you use the `gcnew` keyword instead of `new` when creating a .NET object, and that `gcnew` returns a handle (`^`) rather than a pointer (`*`):
54+
55+
`StreamWriter^ sw = gcnew StreamWriter(fileName);`
56+
57+
For more information on the new Visual C++ syntax, see [Component Extensions for Runtime Platforms](../windows/component-extensions-for-runtime-platforms.md).
58+
59+
1. On the **Build** menu, click **Build Solution**.
60+
61+
The **Output** window displays information about the compilation progress, such as the location of the build log and a message that indicates the build status.
62+
63+
If you make changes and run the program without doing a build, a dialog box might indicate that the project is out of date. Select the checkbox on this dialog before you click **OK** if you want Visual Studio to always use the current versions of files instead of prompting you each time it builds the application.
64+
65+
1. On the **Debug** menu, click **Start without Debugging**.
66+
67+
1. If you used the sample program, when you run the program a command window is displayed that indicates the text file has been created.
68+
69+
The **textfile.txt** text file is now located in your project directory. You can open this file by using Notepad.
70+
71+
> [!NOTE]
72+
> Choosing the empty CLR project template automatically set the `/clr` compiler option. To verify this, right-click the project in **Solution Explorer** and clicking **Properties**, and then check the **Common Language Runtime support** option in the **General** node of **Configuration Properties**.
73+
74+
## What's Next
75+
76+
**Previous:** [Walkthrough: Compiling a Native C++ Program on the Command Line](../build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md)<br/>
77+
**Next:** [Walkthrough: Compile a C Program on the Command Line](../build/walkthrough-compile-a-c-program-on-the-command-line.md)<br/>
78+
79+
## See Also
80+
81+
[C++ Language Reference](../cpp/cpp-language-reference.md)<br/>
82+
[Building C/C++ Programs](../build/building-c-cpp-programs.md)<br/>

0 commit comments

Comments
 (0)