Update comment in EnvironmentHelper.cs (#27089)

* Update comment in EnvironmentHelper.cs

* fix typo
This commit is contained in:
Heiko
2023-06-30 11:06:03 +02:00
committed by GitHub
parent cc83e2b3ee
commit 148f1df56c

View File

@@ -68,13 +68,14 @@ namespace PowerLauncher.Helper
} }
/// <summary> /// <summary>
/// This method is used as a function wrapper to do the update twice. We have to do it twice to get correct variable sets if they contain nested variables (e.g. PATH contains %JAVA_HOME%). /// This method is used as a function wrapper to do the update twice. It is called when we receive a special WindowMessage.
/// It is called when we receive a special WindowMessage.
/// </summary> /// </summary>
internal static void UpdateEnvironment() internal static void UpdateEnvironment()
{ {
Stopwatch.Normal("EnvironmentHelper.UpdateEnvironment - Duration cost", () => Stopwatch.Normal("EnvironmentHelper.UpdateEnvironment - Duration cost", () =>
{ {
// We have to do the update twice to get a correct variable set, if some variables reference other variables in their value (e.g. PATH contains %JAVA_HOME%). [https://github.com/microsoft/PowerToys/issues/26864]
// The cause of this is a bug in .Net which reads the variables from the Registry (HKLM/HKCU), but expands the REG_EXPAND_SZ values against the current process environment when reading the Registry value.
ExecuteEnvironmentUpdate(); ExecuteEnvironmentUpdate();
ExecuteEnvironmentUpdate(); ExecuteEnvironmentUpdate();
}); });