question

Gabor-7490 avatar image
0 Votes"
Gabor-7490 asked ·

How to manage the settings of UWP apps

Hi colleagues,
how can we manage the settings of UWP apps in an enterprise environment?

Example:
1. An UWP app is installed on 100+ computers for all users.
2. User profiles might already exist, or will be created only later on the computer - when the user logs in for the first time.
3. When user starts the app, SettingX for this app should be set to value Y. (Setting is in the Local Store)

In our case the App is the Microsoft Windows Camera App.

Another interesting question would be: what happens if the user changes this default setting? Are we allow him to do so, or deny?

Usually for traditional Win32 apps we would use either a file or registry values. Or for some apps GPOs.

I miss these kind of control for UWP apps.

Thanks for any help,
Gabor

windows-uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RichardZhang-MSFT avatar image
0 Votes"
RichardZhang-MSFT answered ·

Hello,​

Welcome to our Microsoft Q&A platform!

Accessing the registry in UWP is more difficult. But by comparison, it is more common to use LocalSettings, here is the document.

 Windows.Storage.ApplicationDataContainer localSettings = 
     Windows.Storage.ApplicationData.Current.LocalSettings;
 // set
 localSettings.Values["exampleSetting"] = "Hello Windows";
 // get
 Object value = localSettings.Values["exampleSetting"];

You can store user settings this way (you can also provide a default value when you first read the settings).

Thanks.

· 3 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Richard, thank you for your answer. I'm afraid this is not the proper method for us: we can not change the code of the application (it is created by Microsoft).


We can only create scripts (cmd/vbscript/PowerShell) to manipulate the settings of the camera app.


Or the objects in the above code could be somehow accessed from outside the App?


Thanks, Gabor


0 Votes 0 ·

Hi, Sorry I misunderstood what you meant. But for external applications, you should not try to modify its configuration (if it does not expose related methods). Hasty changes are likely to have an inestimable impact on the application. As far as I know, the Camera app does not provide instructions.

0 Votes 0 ·

Thanks Richard!
This is now straightforward…

0 Votes 0 ·