2011-08-03 58 views
4

我無法在網絡上找到任何答案...VS2010集可執行數據

在Visual Studio 2010中C++快,我怎麼設置可執行文件的數據,如EXE版本,構建,圖標等?

此外,Visual Studio編譯器是否將私有數據添加到可執行文件,如IP或mac地址?

回答

3

在Visual Studio 2010中C++快遞,我該如何設置,如exe文件版本數據,建立

你沒有說是否要使用管理非託管 C++。對於非託管 C++(例如MFC),您需要create a version.rc file。您可能需要使用resource editor來幫助您使用.rc文件。

對於管理 C++(即,CLR(.NET)C++項目),編輯或創建的AssemblyInfo.cpp文件。

這裏是一個示例AssemblyInfo.cpp入手:

#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)]; 

並在Visual Studio編譯器私有數據的可執行文件添加諸如IP或MAC地址?

不,你從哪裏聽到的?

+0

我使用的是標準的Windows庫,所以我需要一個version.rc的權利? –

+0

你可能是指win32。是的,'version.rc'。 –

+0

無法找到關於version.rc文件的大量文檔,但至少您指出了我正確的方向!好,詳細的答案!非常感謝 –

0

非快速路線是右鍵單擊該項目並選擇屬性。在「應用程序」選項卡上,「組件信息」按鈕允許您指定版本號。該圖標也是從「應用程序」選項卡指定的。

我沒有使用Express版本,所以我不知道這些功能是否存在。如果是這樣,我希望他們在同一個地方。