共享的快捷方式/图标 [英] Shared Shortcuts/Icons

查看:131
本文介绍了共享的快捷方式/图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些共享文件的创新设置.使用"Sharedfile"标志,a可以确保仅在不再使用它们时将其卸载.

I have several inno setups with shared files. With the 'Sharedfile' flag a can make sure that the they only get uninstalled if they're no longer used.

但是,这对于快捷方式或图标不起作用,因为它们以inno方式指向这些文件而被调用.即使没有卸载目标文件,快捷方式也总是会被删除.

However this is not working for shortcuts or icons as they are called in inno pointing to those files. shortcuts are always getting removed even if the target file is not getting uninstalled.

那么我有什么想念的吗?快捷方式的标记?

So is there something i'm missing? a flag for shortcuts?

还是您在代码中如何防止这种情况的起点?

or do you have some starting point on how to prevent this in code?

非常感谢

推荐答案

非常感谢TLama,这似乎行得通:

Thanks alot TLama this seems to be working:

我防止使用"uninsneveruninstall"标志卸载分片图标.
然后在pascal中,如果不手动删除快捷方式或文件夹,请检查文件是否仍然存在:

I prevent my shard icons from being uninstalled with the 'uninsneveruninstall' flag.
Then in pascal, check if the file still exists if not manually delete the shortcut or folder:

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
    begin
        if CurUninstallStep = usPostUninstall then
            begin
                if (not(FileExists(ExpandConstant('{app}\executable1.exe')))) then DelTree(ExpandConstant('{group}\myfolder'), True, True, True);
                if (not(FileExists(ExpandConstant('{app}\executable2.exe')))) then DeleteFile(ExpandConstant('{group}\myShortcut.lnk');
            end;
    end;

我个人认为,默认情况下,inno安装程序应该执行此操作,检查是否已对安装的快捷方式目标进行引用计数,并将此值用于快捷方式.

Personally i think that inno setup should do this by default, checking if the installed shortcuts target is reference counted and use this value for the shortcut.

但是无论如何,非常感谢大家,祝你有美好的一天.

But anyhow thank you all very much and have a nice day.

这篇关于共享的快捷方式/图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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