Skip to content

Portable Tool for an Ideal Windows Setup

-fixed import & launch expl

Greedeks809a9f3e00df
diff --git a/.Source/GTweak/Utilities/Helpers/INIManager.cs b/.Source/GTweak/Utilities/Helpers/INIManager.cs
index 246b337b..f7d3e28a 100644
--- a/.Source/GTweak/Utilities/Helpers/INIManager.cs
+++ b/.Source/GTweak/Utilities/Helpers/INIManager.cs
@@ -73,8 +73,11 @@ namespace GTweak.Utilities.Helpers
List<string> result = new List<string>();
foreach (string data in temp)
- result.Add(isGetKey ? data.Substring(0, data.IndexOf("=", StringComparison.InvariantCulture)) : data.Remove(0, data.IndexOf("=", StringComparison.InvariantCulture)).Substring(1));
-
+ {
+ int equalsIndex = data.IndexOf("=", StringComparison.InvariantCulture); if (equalsIndex > 0)
+ result.Add(isGetKey ? data.Substring(0, equalsIndex) : data.Substring(equalsIndex + 1));
+
+ }
return result;
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
index a8828a88..baf282bf 100644
--- a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
@@ -167,11 +167,12 @@ namespace GTweak.Utilities.Tweaks
{
Task.Run(delegate
{
+
foreach (Process process in Process.GetProcesses())
{
try
{
- if (string.Compare(process.MainModule?.FileName, $@"{Environment.GetEnvironmentVariable("WINDIR")}\{"explorer.exe"}", StringComparison.OrdinalIgnoreCase) == 0)
+ if (string.Compare(process.MainModule?.FileName, $@"{Environment.GetEnvironmentVariable("WINDIR")}\{"explorer.exe"}", StringComparison.OrdinalIgnoreCase) == 0 && Process.GetProcessesByName("explorer").Length != 0)
{
process.Kill();
process.Start();
@@ -180,8 +181,7 @@ namespace GTweak.Utilities.Tweaks
catch (Exception ex) { Debug.WriteLine(ex.Message); }
finally
{
- Process[] explorer = Process.GetProcessesByName("explorer");
- if (explorer.Length == 0)
+ if (Process.GetProcessesByName("explorer").Length == 0)
{
launchExplorer.StartInfo.FileName = $@"{Environment.GetEnvironmentVariable("WINDIR")}\explorer.exe";
launchExplorer.StartInfo.Arguments = "/factory,{EFD469A7-7E0A-4517-8B39-45873948DA31}";