Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

read/write registery key file in uwp

Tags:

registry

uwp

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 uwp apps run in a sandbox. I'cant find any source about that topic for uwp.

Can someone approve that my plan is realisable for a uwp app?

like image 595
Briefkasten Avatar asked Jan 09 '16 13:01

Briefkasten


People also ask

Can UWP apps access registry?

You can't access registry within pure UWP platform directly. However, you can read registry values from a Win32 runFullTrust background process launched from a UWP application, and you can write values in registry from an "elevated" Win32 application launched from that runFullTrust process.

What is a UWP file?

January 2022) Universal Windows Platform (UWP) apps (formerly Windows Store apps and Metro-style apps) are applications that can be used across all compatible Microsoft Windows devices, including personal computers (PCs), tablets, smartphones, Xbox One, Microsoft HoloLens, and Internet of Things.


1 Answers

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

like image 137
Jackie Avatar answered Oct 22 '22 03:10

Jackie