Skip to content

Commit

Permalink
Fix a couple hardcoded %WINDIR% paths
Browse files Browse the repository at this point in the history
It's possible, albeit uncommon, for the drive letter and/or Windows folder
name to differ for users. For example, someone who upgraded from
Windows 2000 may have the path D:\WINNT\system32.

Signed-off-by: Isabella <kawapure@gmail.com>
  • Loading branch information
kawapure committed Jul 5, 2024
1 parent 5cfd3c5 commit ca7fe7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ManagedShell.Common/Helpers/IconHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private static string translateIconExceptions(string filename)
{
if (filename.EndsWith(".settingcontent-ms"))
{
return "C:\\Windows\\ImmersiveControlPanel\\SystemSettings.exe";
return Environment.GetEnvironmentVariable("WINDIR") + "\\ImmersiveControlPanel\\SystemSettings.exe";
}

return filename;
Expand Down
2 changes: 1 addition & 1 deletion src/ManagedShell.Common/Helpers/ShellHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public static void ShowOpenWithDialog(string fileName)
owProc.StartInfo.UseShellExecute = true;
owProc.StartInfo.FileName = Environment.GetEnvironmentVariable("WINDIR") + @"\system32\rundll32.exe";
owProc.StartInfo.Arguments =
@"C:\WINDOWS\system32\shell32.dll,OpenAs_RunDLL " + fileName;
Environment.GetEnvironmentVariable("WINDIR") + @"\system32\shell32.dll,OpenAs_RunDLL " + fileName;
owProc.Start();
}

Expand Down

0 comments on commit ca7fe7c

Please sign in to comment.