Does anyone know how to add an argument to a shortcut created by QT IFW? I need the exe it launches to be passed an argument.
Here's what works (with no argument):
component.addOperation( "CreateShortcut",
"@TargetDir@/MyApp.exe",
"@StartMenuDir@/@[email protected]",
"workingDirectory=@TargetDir@",
"iconPath=@TargetDir@/MyApp.exe",
"iconId=0");
I want the exe to get something like -c
passed to it. I've tried a few approaches, but am not having any luck.
Qt Installer framework documentation is very poor, but you can read in operations the following:
"CreateShortcut" filename linkname [arguments]
Creates a shortcut from the file specified by filename to linkname. On Windows, this creates a .lnk file which can have arguments. On Unix, this creates a symbolic link.
So do it in that way:
component.addOperation("CreateShortcut", "@TargetDir@/Appname.exe", "@DesktopDir@/Appname.lnk", "-param");
Result in lnk target element:
C:\YourAppDirectory\Appname.exe -param
EDIT: Your case works as well for me:
component.addOperation( "CreateShortcut","@TargetDir@/Appname.exe","@StartMenuDir@/@[email protected]", "-param", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Appname.exe","iconId=0");
with -param
as the last argument too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With