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

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

问题描述

整个故事
我创建了一个花哨的.NET程序,它具有由Visual Studio安装程序(VSI)创建的安装程序。 VSI创建2个文件(setup.exe和MyProgramSetup.msi)。我了解这两个文件的原因,但是,我只想分发一个SINGLE可执行安装程序给用户。我不希望他们看到2个文件,并且必须在它们之间进行选择。

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.

为了做到这一点,我将这两个文件合并到一个自解压缩的存档中,使用IExpress (如本答案所示:合并msi和exe )。这样做很好,然而,创建的自解压缩存档有一个丑陋的图标和令人困惑的文件信息(文件描述是Win32 Cabinet Self-Extractor,后面有43个空格)。

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.

我已经搜索了一段时间,只能找到一个完全正确的程序(ResourceTuner控制台: http://www.heaventools.com/command-line_resource_editor.htm )但是它花费了一个手臂和一条腿,我的预算是$ 0。

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.

有没有人知道一个更好的方式来实现我想要的,或者知道一个可以替代可执行程序的资源,而不必使用GUI?

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?

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

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可以对它们进行编辑。我不知道有没有办法从命令行这样做。

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.

有一个体面的 CodeProject文章处理图标(包括将其保存到exe文件中)。

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

公司名称,描述等是版本资源的一部分。另一个 CodeProject文章涵盖了更新版本资源,虽然我没有看那一个深入。

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天全站免登陆