Inno Setup-如何在没有单独图标文件的情况下更改卸载程序快捷方式的图标? [英] Inno Setup - How to change the icon of the shortcut of uninstaller without separate icon file?

查看:73
本文介绍了Inno Setup-如何在没有单独图标文件的情况下更改卸载程序快捷方式的图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在开始"菜单中更改卸载程序快捷方式的图标,而无需存储单独的图标文件(到应用程序文件夹)?

我看到以下内容:


免责声明:将卸载程序的快捷方式添加到开始"菜单违反了Windows准则(并且创建开始"菜单组至少违反了Windows 8和更高版本的Windows准则).

Is it possible to change the icon of the uninstaller shortcut in the Start menu without storing a separate icon file (to the app folder)?

I see this: Using Resource Hacker for changing the icon after the build, but I cannot implement it.

My code:

[Icons]
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}

解决方案

An icon of a Windows shell shortcut can be set by an external icon file (what you do not want) or by the file the shortcut points to. So you have to modify the icon of the uninstaller.


You have to modify the uninstaller icon on a compile time.

You cannot do this on install time, as the uninstaller includes its own checksum. If you modify the uninstaller, it with refuse to start, claiming it is corrupted. Unless you find out how to also fix the checksum stored in the uninstaller.


But Inno Setup does not really allow modifying the uninstaller icon on a compile time.

What you can do, is to abuse the SignTool "callback". The command set to SignTool processes even the uninstaller. And it can actually do anything with the uninstaller, not only "sign" it. But it has to "sign" it in any case (Inno Setup explicitly checks that the executable was signed after the "tool" finishes).

You can achieve that by setting SignTool to a batch file (or other script) that will run the actual signtool.exe in the end, but before that, it will modify the icon (e.g. using Resource Hacker command-line).

For an example of such batch file that both modify the uninstaller and signs it, see Microsoft SmartScreen - suspended using Inno Setup installer?

So this is doable, only if you do code signing (what you should anyway). You need a code signing certificate for that.


Disclaimer: Adding a shortcut to an uninstaller to Start menu is against Windows guidelines (and creating Start menu groups is against Windows guidelines for Windows 8 and above at least).

这篇关于Inno Setup-如何在没有单独图标文件的情况下更改卸载程序快捷方式的图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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