read/write registery key file in uwp

前端 未结 2 1373
南方客
南方客 2020-12-19 06:41

I want to create or read a registery file within a uwp app. Then I should be able to add menu item to windows context menu. I\'m aware that this is not possible, because uw

相关标签:
2条回答
  • 2020-12-19 07:18

    I want to create or read a registry file within a uwp app.

    Short answer is accessing to system registry is infeasible for a UWP app.

    Under the UWP app model, each UWP app is isolated by running inside separate AppContainer. The runtime also isolates registry access.

    You can find more information on UPW app model form the Build 2015 Keynote, slides can be found along with the video. https://channel9.msdn.com/Events/Build/2015/2-617

    There’s also a deeper dive into the app model from https://blogs.windows.com/buildingapps/2015/04/30/a-deeper-dive-into-the-universal-windows-platform/

    However, you can try out the Brokered Windows Runtime Components for side-loaded Windows Store apps. Essentially, it allows you UWP app to call Win32 API hosted in a different process, which runs outside of the App container.

    Below is the brokered WinRT component template for VS2015 https://visualstudiogallery.msdn.microsoft.com/d2e9cac0-66a8-464a-a902-55ae765c8e6e?tduid=(c5f2776eb12ea55b8926d0c075062c9d)(256380)(2459594)(TnL5HPStwNw-gN1OuW5VyKxMyOTAH.bK0w)()

    Below is a very good example for creating brokered components for UWP, https://xamltips.wordpress.com/2015/11/13/brokered-component-for-uwp-on-windows-10/

    For more information, see to https://msdn.microsoft.com/en-us/library/windows/apps/dn630195.aspx

    0 讨论(0)
  • 2020-12-19 07:19

    Um, you can put a file, registry.dat into your application bundle. It's a registry hive. It's found by searching for HKLM\Software. Writes to it won't persist between application launches. If you put file paths into it, you can use the same aliases from App-V.

    You should be able to write to HKCU, and it should persist between launches. But, access to this is virtualized, and you are not accessing the real thing. Don't think you are able to do that if you want your software published in the Microsoft Store, but they should allow you to do it. It's mostly intended to allow legacy applications in enterprise to in the virtualized system.

    0 讨论(0)
提交回复
热议问题