且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

共享的快捷方式/图标

更新时间:2023-01-31 10:17:42

非常感谢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.