在Inno Setup安装过程中重命名/替换ShortCut [英] Renaming/replacing ShortCut During Inno Setup Installation

查看:223
本文介绍了在Inno Setup安装过程中重命名/替换ShortCut的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[InstallDelete]部分允许删除文件,但不能删除图标(唯一支持的类型是文件,我希望它也支持图标).

The [InstallDelete] Section enables files to be deleted but does not enable icons to be deleted (the only Type supported is files, I was hoping it also supported icons).

我需要更改与正在安装的程序相关联的快捷方式.我可以通过在[图标]部分添加适当的参数来添加新的快捷方式(例如维护"),但是找不到删除旧的快捷方式(例如修复")的方法.

I need to change the shortcuts that are associated the programs being installed. I can add a new shortcut (e.g. 'Maintenance') by adding the appropriate parameters to the [Icons] section but have not found a way of removing the old shortcut (e.g. 'Repair').

没有人知道如何在不深入注册表的情况下实现这一点-我对Pascal脚本的使用非常熟悉(但当然不是专家).

Has anyone got any ideas how this can be acheived without delving into the Registry - I am familiar (but certainly not an expert) in the use of Pascal Scripting.

推荐答案

图标"又名快捷方式只是位于某处的.lnk文件-例如在桌面上-指向其他文件-例如Program.exe-在{app}目录中.

"Icon" aka Shortcut is just .lnk file placed somewhere - e.g. on your Desktop - pointing to other file - e.g. Program.exe - in {app} directory.

如果在[Icons]部分中创建了这样的图标",则在卸载过程中会自动将其删除(除非设置了uninsneveruninstall标志).

If you create such "icon" in [Icons] section it is automatically deleted during uninstall (unless the uninsneveruninstall Flag is set).

如果您要删除某些图标",则只需从目标文件夹(例如桌面)中删除.lnk文件. 您可以在[InstallDelete][UninstallDelete]中或以编程方式在[Code]部分中进行此操作:

If you have some "icon" which you want to delete then simply delete the .lnk file from destination folder (e.g. Desktop). You can do that in [InstallDelete] or [UninstallDelete] or programatically in [Code] section:

[InstallDelete]
Type: files; Name: "{commondesktop}\My Program.lnk"

其中"{commondesktop}\My Program.lnk"是要删除的图标的路径\名称(实际上是.lnk文件的名称).

where "{commondesktop}\My Program.lnk" is the path\name of the icon (actually the name of the .lnk file) to delete.

这篇关于在Inno Setup安装过程中重命名/替换ShortCut的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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