开发者

VS2010 set executable data

I couldn't find any answers on the net...

In Visual Studio 2010 C++ Express, how do I set the executable data such as exe version, build, icon,开发者_高级运维 etc?

Also, does the Visual studio compiler adds private data to the executable such as IP or mac address?


In Visual Studio 2010 C++ Express, how do I set data such as exe version, build

You did not say whether you are using managed or unmanaged C++.

For unmanaged C++ (e.g., MFC), you need to create a version.rc file. You may want to use a resource editor to help you with the .rc file.

For managed C++ (i.e., a CLR (.NET) C++ project), edit or create the AssemblyInfo.cpp file.

Here is a sample AssemblyInfo.cpp to start with:

#include "stdafx.h"

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("foo")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("Microsoft")];
[assembly:AssemblyProductAttribute("foo")];
[assembly:AssemblyCopyrightAttribute("Copyright (c) Microsoft 2011")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly:AssemblyVersionAttribute("1.0.*")];

[assembly:ComVisible(false)];

[assembly:CLSCompliantAttribute(true)];

[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

does the Visual studio compiler add private data to the executable such as IP or mac address?

No. Where did you hear that?


The non-Express route is to right-click on the project and choose Properties. On the Application tab, the Assembly Information button lets you specify version number. The icon is also specified from the Application tab.

I've not used the Express edition, so I don't know if those features are present. If so, I expect them to be in the same place.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜