使用命令行实用程序如何修改exe文件的资源(文件说明,图标等)? [英] How can I edit an exe's resources (File Description, Icon, etc.) using a command line utility?

查看:718
本文介绍了使用命令行实用程序如何修改exe文件的资源(文件说明,图标等)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

始末: 我创建了一个奇特的.NET程序,该程序由Visual Studio安装程序(VSI)创建一个安装程序。该VSI创建两个文件(setup.exe并MyProgramSetup.msi)。我理解被需要的原因,这两个文件,​​但是,我只想一个可执行安装程序分发给用户。我不想让他们看到2个文件,并在它们之间进行选择。

为了做到这一点,我已经合并了2个文件到使用IEx标志preSS(如本回答看到一个自解压压缩文件:的合并MSI和EXE )。这工作得很好,但是,被创建的自解压压缩包有一个丑陋的图标和混乱的文件信息(文件描述为的Win32 Cabinet自解压与后43个空格)。

我需要用我的自定义更换图标,改变一些像说明文件属性中,公司,等等。我想有这种自动完成作为构建步骤,以便有一个程序,它是一个命令行/控制台工具将是巨大的。

我已经搜索了一会儿现在只能找到一个程序,它不正是我想要的(ResourceTuner控制台:的 http://www.heaventools.com/command-line_resource_editor.htm ),但它的成本一只胳膊和一条腿,我的预算为$ 0

有谁知道一个更好的方式来达到我想要的,或者知道一个程序,可以替换可执行文件的资源,而无需使用图形界面的?

顺便说一句,我也尝试过SiComponents资源生成器3,它甚至无法打开可执行文件,它的ResEdit刚刚崩溃,当我执行命令:

  resedit.exe -convert修改Resources.rcMyProgramSetup.exe
 

解决方案

如果您打开可执行文件的Visual Studio可以对其进行编辑。我不知道是否有一种方法在命令行做到这一点,虽然。

有一个体面的 $ C $的CProject文章的交易带图标(包括保存成exe文件)。

公司名称,描述,等等,都是版本资源的一部分。另外 $ C $的CProject文章覆盖更新版本的资源,虽然我还没有看,一个深入。

The whole story: I have created a fancy .NET program which has an installer created by the Visual Studio Installer (VSI). The VSI creates 2 files (setup.exe and MyProgramSetup.msi). I understand the reasons for both files being needed, however, I only want to distribute a SINGLE executable installer to users. I do not want them to see 2 files and have to choose between them.

In order to do this I have merged the 2 files into a self-extracting archive using IExpress (as seen in this answer: Merge msi and exe). This works well, however, the self-extracting archive that gets created has an ugly icon and confusing file info (the File Description is "Win32 Cabinet Self-Extractor" with 43 blank spaces after it).

I need to replace the icon with my custom one and change some of the file properties like "Description", "Company", etc. I would like to have this automatically done as a build step so having a program which is a command line/console utility would be great.

I've searched for a while now and can only find one program which does exactly what I want (ResourceTuner Console: http://www.heaventools.com/command-line_resource_editor.htm) but it costs an arm and a leg and my budget is $0.

Does anyone know a better way to achieve what I want, or know of a program which can replace an executable's resources without having to use a GUI?

By the way, I have also tried SiComponents' Resource Builder 3 which can't even open the executable, and ResEdit which just crashes when I execute the command:

resedit.exe -convert "Modified Resources.rc" "MyProgramSetup.exe"

解决方案

Visual Studio can edit them if you open the executable file. I'm not sure if there's a way to do it from the command line, though.

There is a decent CodeProject article that deals with icons (including saving them into exe files).

Company name, description, etc., are part of the Version resource. Another CodeProject article covers updating the Version resource, though I haven't looked at that one in depth.

这篇关于使用命令行实用程序如何修改exe文件的资源(文件说明,图标等)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆