1

I am parsing AppxManifest.xml and getting the display name. That contains something like
ms-resource:ApplicationTitleWithBranding, ms-resource:AppTitleWithBranding,
ms-resource:AppStoreName.

When I use SHLoadIndirectString function with this display name (in the format of @{PRIFilepath?resource} ), I don't get the localized display name. It returns nothing.

But I get proper response for some apps which contain display name something like ms-resource:///Resources/AppStoreName.

Is there any workaround to get the localized display names ?

I need this to work on both windows8.1 and windows10. It is a desktop app.

Fresher
  • 493
  • 6
  • 18

2 Answers2

3

I just passed 'ms-resource:AppTitleWithBranding' to the function along with the pri file location. That's why I did not get the localized names.

We should not send resource in this format : ms-resource:AppTitleWithBranding. Modify this thing in the below format.

Resource should be in the format:
ms-resource://Package.Id.Name/resources/AppTitleWithBranding

If AppxManifest.xml already contains in the above format, then just pass as it is.

And the final format should be @{PRIFilepath?resource}

Fresher
  • 493
  • 6
  • 18
1

I know a little bit more ms-resource: URI transformations for @{PRIFilepath?resource}:

ms-resource:///xxx  => ms-resource://<PRI-file package name>/xxx
ms-resource://xxx
ms-resource:/xxx    => ms-resource://<PRI-file package name>/xxx
ms-resource:xxx     => ms-resource://<PRI-file package name>/Resources/xxx
ms-resource:xxx/yyy => ms-resource://<PRI-file package name>/xxx/yyy
ms-resource:xxx/yyy => ms-resource://<PRI-file package name>/Resources/xxx/yyy

Note: Be careful, the package name from WinRT database and AppxManifest.xml can be different then the package name from resources.pri.

Mikhail Pilin
  • 121
  • 1
  • 5
  • Regarding, `Be careful, the package name from WinRT database and AppxManifest.xml can be different then the package name from resources.pri.` Is there a way to specifically query `resources.pri`, rather than `AppxManifest.xml`? – Sahil Singh Aug 28 '17 at 06:48
  • Will `SHLoadIndirectString()` work for a resource string of an app which is installed for a different user? Two users on a system may not have the same language. – Sahil Singh Aug 28 '17 at 06:49
  • Win10 sometimes install system applications with GUID packagesName. Why? I don't know. So, package name form `AppxManifest.xml` is different then in WinRT database in this case – Mikhail Pilin Aug 28 '17 at 11:58
  • I have no idea how to change the language in `SHLoadIndirectString` – Mikhail Pilin Aug 28 '17 at 12:07
  • I did a little experiment, for windows calculator I took the resource string given by DisplayName registry value, and passed to `SHLoadIndirectString ()`. I did this for two different users (U1, and U2). U1's language was set to english, U2's language was set to french (FR-fr). When `SHLoadIndirectString()` was run from U1 it returned `Windows Calculator`, and for U2 I got `Calculatrice Windows`. Thus the value returned for the same resource string depends on language setting of current user. – Sahil Singh Aug 29 '17 at 11:10
  • The display name was obtained from `HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\Microsoft.WindowsCalculator_10.1705.1301.0_x64__8wekyb3d8bbwe\DisplayName` – Sahil Singh Aug 29 '17 at 11:12
  • I did another test. I installed a UWP app in U2, and did `SHLoadIndirectString()` to the resource string in DiplayName. I got error in U1, but in U2, it gave me the required string correctly. – Sahil Singh Aug 29 '17 at 13:07