Skip to content

Commit 03da091

Browse files
authored
Fix: Fixed issue where the Windows version was copied incorrectly (#17294)
1 parent dac0ab4 commit 03da091

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Files.App/ViewModels/Settings/AboutViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33

44
using Microsoft.Win32;
5-
using System.Runtime.InteropServices;
65
using System.Windows.Input;
76
using Windows.ApplicationModel;
87
using Windows.ApplicationModel.DataTransfer;
@@ -170,7 +169,7 @@ public void CopyWindowsVersion()
170169
Clipboard.SetContent(dataPackage);
171170
});
172171
}
173-
172+
174173
public void CopyUserID()
175174
{
176175
SafetyExtensions.IgnoreExceptions(() =>
@@ -194,9 +193,10 @@ public string GetAppVersion()
194193

195194
public string GetWindowsVersion()
196195
{
197-
return Environment.OSVersion.Version.ToString();
196+
ulong v = ulong.Parse(Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamilyVersion);
197+
return $"{(v >> 48) & 0xFFFF}.{(v >> 32) & 0xFFFF}.{(v >> 16) & 0xFFFF}.{v & 0xFFFF}";
198198
}
199-
199+
200200
public string GetUserID()
201201
{
202202
return GeneralSettingsService.UserId;

0 commit comments

Comments
 (0)