1

The PackageManager class is only usable from full desktop apps - it's usage directly from WinRT app (even to get a list of apps installed for current user) results in UnauthorizedAccessException.

I was hoping that with new Brokered Components introduced by Microsoft in Windows 8.1 Update 1 it would be possible to circumvent this and actually use the class (right now, it's only possible to use it directly from desktop applications).

To my surprise, it didn't work and I simply got the dreaded UnauthorizedAccessException again. I thought the brokered compoment is supposed to run in a separate process outside of any App Container and therefore, I shouldn't be facing any limitations. I even tried to execute a console app to take care of my PackageManager needs from the brokered component as a separate process, but this, too, failed with the same exception.

I can't think of a way to provide you with a simple code reproducing the exception - to create a brokered component and use it from the WinRT app, I followed the series about brokered components from Harry Pierson.

Could someone comment on why is this happening?

Nikola Anusev
  • 6,940
  • 1
  • 30
  • 46
  • ask this Microsoft why they don't allow this. We can't answer this. – magicandre1981 Jul 21 '14 at 04:25
  • @magicandre1981 I've actually already contacted Harry Pierson and pointed him to this question. I was hoping that with the question being online and publicly accessible, I will get more people to see it and possibly, even answer it. As soon as I'll have some update, I will post it here. – Nikola Anusev Jul 21 '14 at 20:44

1 Answers1

0

According to the documentation, this class requires admin privileges. So it seems that WinRT and Store apps are sandboxed too tight and can't elevate themselves even if started from admin premises. In contrary, hello-world console app can operate with PackageManager freely if launched under admin.

Yury Schkatula
  • 5,291
  • 2
  • 18
  • 42