如何更改可执行文件的属性? (视窗)

发布于 2024-07-25 06:18:18 字数 287 浏览 4 评论 0原文

当我创建 .exe 时,我可以右键单击它并转到“属性”->“详细信息”。 然后我得到一个列表,例如:

文件描述 |  
  类型 |   应用 
  文件版本 |  
  产品名称 |  
  产品版本 | 
  版权所有 |  
  尺寸|   18.0 KB 
  修改日期 |   2009 年 6 月 16 日 晚上 8:23 
  语言 | 
  

我如何更改这些属性? (顺便说一句,有没有办法改变图标?)

When I create a .exe, I can right click it and go to properties->details. Then I get a list like:

File Description | 
Type             | Application
File Version     | 
Product Name     | 
Product Version  |
Copyright        | 
Size             | 18.0 KB
Date Modified    | 6/16/2009 8:23 PM
Language         |

How do I change these properties? (And on a side note, is there a way to change the icon?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

如痴如狂 2024-08-01 06:18:19

如果您使用的是 C/Win32,您可以将类似的内容添加到封装在 *.rc(资源)文件中的项目中:

VS_VERSION_INFO VERSIONINFO
 FILEVERSION    0,0,0,2
 PRODUCTVERSION 0,0,0,2
 FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
 FILEFLAGS 0x1L
 #else
 FILEFLAGS 0x0L
 #endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
{
    BLOCK "StringFileInfo"
    { 
        BLOCK "040904b0"
        {
            VALUE "Comments",         "comment\0"
            VALUE "CompanyName",      "comment\0"
            VALUE "FileDescription",  "base file\0"
            VALUE "FileVersion",      "0.0.0.2 TP\0"
            VALUE "InternalName",     "testTP\0"
            VALUE "LegalCopyright",   "none\0"
            VALUE "OriginalFilename", "test.exe\0"
            VALUE "ProductName",      "test\0"
            VALUE "ProductVersion",   "0.0.0.2 TP\0"
        } 
    }
    BLOCK "VarFileInfo"
    {
        VALUE "Translation", 0x409, 1200
    }
}

If you are using C/Win32 you can add something like this to your project encapsulated in a *.rc (resource) file:

VS_VERSION_INFO VERSIONINFO
 FILEVERSION    0,0,0,2
 PRODUCTVERSION 0,0,0,2
 FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
 FILEFLAGS 0x1L
 #else
 FILEFLAGS 0x0L
 #endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
{
    BLOCK "StringFileInfo"
    { 
        BLOCK "040904b0"
        {
            VALUE "Comments",         "comment\0"
            VALUE "CompanyName",      "comment\0"
            VALUE "FileDescription",  "base file\0"
            VALUE "FileVersion",      "0.0.0.2 TP\0"
            VALUE "InternalName",     "testTP\0"
            VALUE "LegalCopyright",   "none\0"
            VALUE "OriginalFilename", "test.exe\0"
            VALUE "ProductName",      "test\0"
            VALUE "ProductVersion",   "0.0.0.2 TP\0"
        } 
    }
    BLOCK "VarFileInfo"
    {
        VALUE "Translation", 0x409, 1200
    }
}
樱花落人离去 2024-08-01 06:18:19

如果您想更改已编译的可执行文件上的 FileDescription 或任何其他版本资源字符串,rcedit (一个小的开放-源工具)很容易做到这一点:

$ rcedit MyApp.exe --set-version-string FileDescription "My Awesome App"

If you want to change the FileDescription or any other version resource string on a compiled executable, rcedit (a small open-source tool) does it pretty easily:

$ rcedit MyApp.exe --set-version-string FileDescription "My Awesome App"
如日中天 2024-08-01 06:18:19

如果您使用 Visual Studio,则非常简单:

  • 右键单击项目中的“资源文件”文件夹,
  • 单击“添加”,然后单击“资源”,
  • 从弹出对话框中选择“版本”,

然后双击该文件将其打开在 Visual Studio 中,您将获得一个方便的编辑器来更改值。

然后您的值会自动链接到 EXE。

Very easy if you are using visual studio:

  • Right click on the 'Resource Files' folder in the project
  • Click 'Add' then 'Resource'
  • Choose 'Version' from the pop-up dialog

You can then double click on the file to open it in Visual Studio, and you get a handy editor to change the values.

Your values are then automatically linked in to the EXE.

绮筵 2024-08-01 06:18:19

这是简单的文件版本信息资源。 对于已经存在的文件,您可以使用任何资源编辑器编辑此信息(例如 Resource Hacker,它已过时,但仍然好的)。 您也可以通过这种方式更改图标。

如果您创建自己的应用程序,则设置它取决于您使用的工具。 例如,在 Visual Studio 中,您必须查看项目属性。

This is simple file version info resource. For already existent files you can edit this information with any resource editor (for example Resource Hacker, it is outdated but still good). You can change icon this way too.

If you create your own application, then setting it depends on tool you are using. For example in Visual Studio you must look into project properties.

初见终念 2024-08-01 06:18:19

对于 .NET,请搜索“设置程序集属性”以获取有关可用属性的信息。 然后你可以像这样使用属性......

using System.Reflection;  // Needed to get to the attributes.

[assembly:AssemblyTitle("My File Description")]
[etc.]

For .NET, google for "setting assembly attributes" for information on what attributes are available. You then use the attributes like so ...

using System.Reflection;  // Needed to get to the attributes.

[assembly:AssemblyTitle("My File Description")]
[etc.]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文