Qt Installer Framework: how to specify the desktop icon



  • I've started working with the Qt Installer Framework and find it useful except for the numerous undocumented features (e.g., setting the wizard subTitle or the existence of the DesktopDir variable) but one thing I haven't been able to figure out by code inspection is when you create a desktop shortcut how can you specify the icon?

    I can create the shortcut just fine with

    component.addOperation("CreateShortcut",td,dd);
    

    where td is the executable path and dd is the link (but note: I haven't been able to make the installer operation

     boolean performOperation(string name, stringlist arguments)
    

    work)

    however I haven't been able to figure out how to set the desktop shortcut icon.

    There must be a way because in the downloaded Qt Installer Framework installation the desktop shortcut icon isn't generic but is specified. I've tried looking at the code and in createshortcutoperation.cpp is the code

    const QString iconId = takeArgument(QString::fromLatin1("iconId="), &args);
    
    const QString iconPath = takeArgument(QString::fromLatin1("iconPath="), &args);
    
    const QString workingDir = takeArgument(QString::fromLatin1("workingDirectory="), &args);
    

    so I unsuccessfully tried

    component.addOperation("CreateShortcut",td,dd,"iconPath="+iconPath);
    

    where iconPath is the path to the icon.

    Does anyone know how Qt specifies their desktop shortcut icon?



  • Close. Just had to add the working directory and get admin rights.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.