Access to Windows Registry causes build error on macOS and Unity Cloud Build

0 votes
asked Jan 18 in Issue by harald-reingruber (120 points)

This line in the dpi property of MaterialUIScaler

m_Dpi = Mathf.Round(1.445f * float.Parse(Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey("Windows NT").OpenSubKey("CurrentVersion").OpenSubKey("FontDPI").GetValue("LogPixels").ToString()));

causes the following Error:

Player export failed. Reason: UnauthorizedAccessException: Access to the path "/UNITY_PATH/Unity/Unity-2017_2_0f3/" is denied.

for the Unity Cloud Build. We see a similar issue when Building for Windows on macOS machines.

Do you know a clean solution for that?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Welcome to MaterialUI support! Ask us anything :)