【问题标题】:How to set the "comment" shortcut property with InstallScript如何使用 InstallScript 设置“注释”快捷方式属性
【发布时间】:2014-08-20 11:45:56
【问题描述】:

我正在使用 InstallShield 2014 pro'。我正在尝试在安装结束时创建快捷方式,并在“注释”属性中使用特定值(当您将鼠标悬停在快捷方式图标上方时显示的文本)。 如果我通过快捷方式视图创建快捷方式,我可以在“描述”字段中写任何我想要的文本,我的目标就实现了。但!我无法在其中插入“智能”文本,这意味着如果我希望评论显示“[ProductName] version [ProductVersion]”,则无法做到这一点。这就是为什么我决定使用 InstallScript 创建快捷方式,并尝试手动设置它的属性(我还必须使用 installshield 创建卸载快捷方式,因为在 InstallScript MSI 项目中没有其他选择)。 到目前为止,一切正常,并且创建了快捷方式,但我不知道如何使用 SetShortcutProperty 函数设置此特定属性,我使用示例代码检查它是否有效,但它一直失败。我怀疑这是因为我不确定属性名称是什么,我为此字段尝试了不同的名称,但没有成功(似乎“描述”应该有效,但没有......)。 这是我的代码:

  szName=IFX_PRODUCT_NAME;
  szRunComment=szName + " " + IFX_PRODUCT_VERSION;
  if (SetShortcutProperty(FOLDER_DESKTOP, szName, "Description", szRunComment) < 0) then
        MessageBox("SetShortcutProperty failed", SEVERE);
    else
        SprintfBox(INFORMATION, "SetShortcutProperty", "%s configured successfully.", szName);
    endif;

【问题讨论】:

    标签: properties installshield shortcut installscript


    【解决方案1】:

    InstallShield User Guide 2013 说(第 11 页):
    ...You can use this function in your InstallScript code to set Windows Shell properties for a shortcut. The function lets you prevent end users from pinning a shortcut to the Windows 8 Start screen, prevent end users from pinning a shortcut to the taskbar or Start menu on Windows 7 or later systems, or prevent a shortcut on the Start menu from being highlighted as newly installed on Windows 7 or later systems. You can also use this function to specify additional Shell properties that are defined in propkey.h, which is part of the Windows SDK....
    所以,我认为,您需要参考 propkey.h 来找出您的确切属性如果确实存在,需要使用。

    附:由于长 cmets 的限制,作为答案回答。

    【讨论】:

    • 我确实参考了 propkey.h,并尝试了所有类似于我需要的字段 - 但没有成功。不过感谢您的回复。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-27
    • 2014-06-04
    • 2018-01-07
    • 2023-01-02
    • 1970-01-01
    • 2015-03-26
    相关资源
    最近更新 更多