cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
GeoBro
Level 3

ISWiShortcut: Cant use string table entry to define DisplayName

I'm using the automation layer to modify an InstallShield script project and have found that calling shortcut.DisplayName = doesn't work.

The documentation tells me that my entry will be used and translated but
instead, IS14 creates another string table entry (say...ID_STRING3) and uses as the DisplayName.

And that's only in English. All other languages use the folder name as the DisplayName.

Has anyone else seen this?

Thanks,
George
Labels (1)
0 Kudos
(3) Replies
hidenori
Level 17

The ISWiShorcut.DisplayName write-property is designed to set a string to the value for the string identifier that has already been set to this property. If it does not use a string identifier, it will assign a new string identifier. If you want to set a string for a different language, you need to change the active language before setting the DisplayName property.

pProject.ActiveLanguage = "1041"
pShortcut.DisplayName = "JapaneseText"
0 Kudos
GeoBro
Level 3

Thanks but how then do I assign a string table entry to a newly created ISWiShortcut object?

If understand your response correctly, this will not work:

ISWiShortcut shortcut = pFolder.AddShortcut("MyApp");
shortcut.DisplayName = "";


Is there another way?
0 Kudos
hidenori
Level 17

The ISWiShortcut.DisplayName write-property assigns an unique string table identifier internally when you set a string for the first time. You cannot assign a different string identifier through the automation. It will update the value of the string table entry that has been automatically assigned, the next time you set a different string.

If you want to set the value of the IDS_MYAPPNAME string table entry to your shortcut's display name, you can look up the string table value from the ISWiStringEntries collection.

Set pStringEntry = pProject.ISWiStringEntries("IDS_MYAPPNAME") 
if pStringEntry Is Not Nothing Then
pShortcut.DisplayName = pStringEntry.Value;
EndIf


Also, I submit the feature request work order #IOC-000071851 so that you will be able to assign a string table indentifier for the shortcut's display name property through the automation.
0 Kudos