使用 Resource Hacker 在构建后更改图标
在第二个问题中有一条评论说使用
ResHacker.exe -addoverwrite "Project.exe", "Project.exe", "ProgramIcon.ico", ICONGROUP, MAINICON, 0
我也尝试使用 -modify
而不是 -addoverwrite
ResHacker.exe -modify "Project.exe", "Project.exe", "ProgramIcon.ico", ICONGROUP, MAINICON, 0
但结果是相同的。
图标已更改:如果我右键单击 exe 文件并检查属性,我会看到图标已更改,但在 Windows 资源管理器中我仍然看到旧图标。
如果我使用 Resource Hacker 打开它(因此不将其用作命令行工具,而是用作普通 GUI 工具),我会在“打开文件”对话框中看到正确的图标。
有人能提出解决方案吗?我正在尝试在 Delphi 后期构建事件中使用它。
This question is written in several places (like here and here).
In the second question there is a comment that says to use
ResHacker.exe -addoverwrite "Project.exe", "Project.exe", "ProgramIcon.ico", ICONGROUP, MAINICON, 0
I also tried using -modify
instead of -addoverwrite
ResHacker.exe -modify "Project.exe", "Project.exe", "ProgramIcon.ico", ICONGROUP, MAINICON, 0
but the result is the same.
The icon is changed: if I right click on the exe file and check the properties I see that the icon has been changed, but in Windows Explorer I still see the old icon.
If I open it with Resource Hacker (so not using it as command line tool, but as normal GUI tool) I see the correct icon in the "Open file" dialog.
Can anybody suggest a solution? I am trying to use this in a Delphi post build event.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我怀疑您正在看到资源管理器图标缓存中的图标。
I suspect that you are seeing the icon from explorer's icon cache.
大卫是对的,资源管理器的图标缓存需要更新。
在
ResHacker
命令之后将以下命令添加到批处理文件中:(
ie4unit
是内置命令)无需重新启动
资源管理器。
David's right, Explorer's icon cache needs updating.
Add the following command to your batch file after your
ResHacker
command:(
ie4unit
is a built-in command)No need to restart
explorer
.