Windows 无法识别 Qt 维护工具开始菜单快捷方式

问题描述

我正在使用 Qt 安装程序框架为我的应用程序创建在线安装程序。我想为应用程序和维护工具创建 Windows 开始菜单快捷方式,以添加/更新/删除我的应用程序的组件。

C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\<myCompany> 中成功创建了两个快捷方式,但只有应用程序的快捷方式出现在 Windows 开始菜单中(维护工具的快捷方式不会出现,或者如果出现,只会出现很短的一段时间应用程序首次安装后就再也看不到的时间)。

如果我转到 AppData 文件夹并双击这两个快捷方式中的任何一个 - 它们都可以正常打开各自的程序。但是由于某种原因,开始菜单不会显示维护工具快捷方式。

以下是我创建两个快捷方式的安装脚本:

Component.prototype.createOperations = function()
{
    component.createOperations();
    if (systemInfo.productType === "windows") {
        // Add shortcut to start menu.
        component.addOperation("CreateShortcut","@TargetDir@/x64/myApp.exe","@startmenuDir@/myApp.lnk","workingDirectory=@TargetDir@/x64/","iconPath=@TargetDir@/x64/AppIcon.ico","iconId=0","description=Start myApp");
            
        // Add shortcut for maintenance tool.
        component.addOperation("CreateShortcut","@TargetDir@/maintenancetool.exe","@startmenuDir@/myApp Maintenance.lnk","workingDirectory=@TargetDir@","iconPath=@TargetDir@/x64/MaintenanceIcon.ico","description=Update or remove myApp");
    }
}

如果我复制 myApp.lnk 快捷方式并创建一个新快捷方式(通过 Windows 资源管理器),并将目标更改为 maintenancetool.exe - 确实可以工作并出现在 Windows 开始菜单中。所以我想我在上面的安装过程中创建它时一定做错了。

这是安装程序创建的两个快捷方式属性的屏幕截图。他们都说它们是快捷方式,但我也不知道为什么维护工具快捷方式属性比其他快捷方式有更多的选项卡 - 否则,除了目标之外,它们看起来完全相同。

Windows app data shortcut folder screen shot

Qt 安装程序框架:4.0
Qt:5.15.2
编译器:msvc2019 x64

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)