mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PT Run] Improvements on EnvironmentHelper and deletion of old env vars (#13363)
* Improve log message * New method * changes made so far * code cleanup and new method * fix method name * final changes so far * Code cleanup and typo fixes * fix bugs and code cleanup * fix typo * rename Method * fix cast exception * fix type casting * exception handling for testing * Update path var name# * make collections case insensitive * fix spelling * add code to update names * improve comments * exception handling and logging * update comments * final changes * fix typo * Update comments * add summary to IsRunningAsSystem method * update var and fix typos * Update code * add log warning for protected vars * add comment * fix bugs * small change * Update log text * Skipp logging for USERNAME
This commit is contained in:
@@ -109,7 +109,7 @@ namespace PowerLauncher
|
||||
string changeType = Marshal.PtrToStringUni(lparam);
|
||||
if (changeType == EnvironmentChangeType)
|
||||
{
|
||||
Log.Info("Reload environment", typeof(EnvironmentHelper));
|
||||
Log.Info("Reload environment: Updating environment variables for PT Run's process", typeof(EnvironmentHelper));
|
||||
EnvironmentHelper.UpdateEnvironment();
|
||||
handled = true;
|
||||
}
|
||||
@@ -125,6 +125,9 @@ namespace PowerLauncher
|
||||
|
||||
private void OnSourceInitialized(object sender, EventArgs e)
|
||||
{
|
||||
// Initialize protected environment variables before register the WindowMessage
|
||||
EnvironmentHelper.GetProtectedEnvironmentVariables();
|
||||
|
||||
_hwndSource = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
|
||||
_hwndSource.AddHook(ProcessWindowMessages);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user