Unsolved Qt Installer Framework. How to create shortcut on the Windows desktop?
-
My code:
Component.prototype.createOperations = function() { component.createOperations(); if (systemInfo.productType === "windows") { component.addOperation("CreateShortcut", "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "iconPath=@TargetDir@/icn_constructor.ICO"); } }
But sometimes i see this:
I guess this is because the icon was not in the @TargetDir@ when the shortcut was created. How to fix that? -
Looks fine to me.
The only differences I have with the code I am using is:
a "workingDirectory" is also declared and the icon is already part of the exe and therefore loaded from the exe. -
component.addOperation("CreateShortcut", "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "workingDirectory=@TargetDir@");
-
That is apparently another possiblity.
I have a duplication then withcomponent.addOperation("CreateShortcut", "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Constructor.exe");
for your case
-
Sometimes, it works. But somtimes i need to refresh the desktop to see app icons. Maybe it's beacouse I need to create 3 icons, not just one?