Skip to content

Portable Tool for an Ideal Windows Setup

-re & fixed

Greedeksedf9211f7d9c
diff --git a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
index 0e8bdcc1..3d68b473 100644
--- a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
@@ -8,7 +8,6 @@ using System.Diagnostics;
using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;
-using System.Threading.Tasks;
namespace GTweak.Utilities.Tweaks
{
@@ -846,7 +845,7 @@ namespace GTweak.Utilities.Tweaks
}
}
- private async static void ChangeAccessUpdateFolders(bool isDenyAccess)
+ private static void ChangeAccessUpdateFolders(bool isDenyAccess)
{
void SetFullAccess(string path)
{
@@ -856,10 +855,8 @@ namespace GTweak.Utilities.Tweaks
File.SetAccessControl(path, security);
}
- void ChangeStateTask()
+ void ChangeStateTask(string valueState = "/disable")
{
- string valueState = isDenyAccess ? "/disable" : "/enable";
-
TrustedInstaller.CreateProcessAsTrustedInstaller(Settings.PID, "cmd.exe /c schtasks /change " + valueState + " /tn \"\\Microsoft\\Windows\\UpdateOrchestrator\\Report policies\" & " +
"schtasks /change " + valueState + " /tn \"\\Microsoft\\Windows\\UpdateOrchestrator\\Schedule Scan\" & " +
"schtasks /change " + valueState + " /tn \"\\Microsoft\\Windows\\UpdateOrchestrator\\Schedule Scan Static Task\" & " +
@@ -875,7 +872,9 @@ namespace GTweak.Utilities.Tweaks
try
{
- if (isDenyAccess)
+ if (!isDenyAccess)
+ ChangeStateTask("/enable");
+ else
{
SetFullAccess(Settings.PathSystemDisk + @"Windows\SoftwareDistribution\Download");
SetFullAccess(Settings.PathSystemDisk + @"Windows\System32\catroot2");
@@ -890,38 +889,6 @@ namespace GTweak.Utilities.Tweaks
});
ChangeStateTask();
-
-
- await Task.Delay(1000);
-
- Process.Start(new ProcessStartInfo()
- {
- Arguments = @"/c rd /s /q " + WinUpdatePaths["UpdateFolder"] + "/(GTweak UpdateOrchestrator) & " +
- "rd /s /q " + WinUpdatePaths["UpdateFolder"] + "/(GTweak WindowsUpdate)",
- WindowStyle = ProcessWindowStyle.Hidden,
- CreateNoWindow = true,
- FileName = "cmd.exe"
- });
-
-
- await Task.Delay(200);
-
- if (Directory.Exists(WinUpdatePaths["UpdateFolder"] + "\\UpdateOrchestrator"))
- Directory.Move(WinUpdatePaths["UpdateFolder"] + "\\UpdateOrchestrator", WinUpdatePaths["UpdateFolder"] + "\\(GTweak UpdateOrchestrator)");
- if (Directory.Exists(WinUpdatePaths["UpdateFolder"] + "\\WindowsUpdate"))
- Directory.Move(WinUpdatePaths["UpdateFolder"] + "\\WindowsUpdate", WinUpdatePaths["UpdateFolder"] + "\\(GTweak WindowsUpdate)");
- }
- else
- {
-
- if (Directory.Exists(WinUpdatePaths["UpdateFolder"] + "\\(GTweak UpdateOrchestrator)"))
- Directory.Move(WinUpdatePaths["UpdateFolder"] + "\\(GTweak UpdateOrchestrator)", WinUpdatePaths["UpdateFolder"] + "\\UpdateOrchestrator");
- if (Directory.Exists(WinUpdatePaths["UpdateFolder"] + "\\(GTweak WindowsUpdate)"))
- Directory.Move(WinUpdatePaths["UpdateFolder"] + "\\(GTweak WindowsUpdate)", WinUpdatePaths["UpdateFolder"] + "\\WindowsUpdate");
-
- await Task.Delay(500);
-
- ChangeStateTask();
}
}
catch (Exception ex) { Debug.WriteLine(ex); }
diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml b/.Source/GTweak/Windows/LoadingWindow.xaml
index 1f2cf5ab..019cc201 100644
--- a/.Source/GTweak/Windows/LoadingWindow.xaml
+++ b/.Source/GTweak/Windows/LoadingWindow.xaml
@@ -15,7 +15,12 @@
</Window.DataContext>
<Grid>
- <Image Source="{StaticResource DI_Splash}">
+ <Image>
+ <Image.Style>
+ <Style TargetType="Image">
+ <Setter Property="Source" Value="{StaticResource DI_Splash}"/>
+ </Style>
+ </Image.Style>
<Image.Effect>
<DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="0.7" Color="#000000" />
</Image.Effect>
@@ -50,12 +55,8 @@
</Border>
</Border>
-
-
<ProgressBar Width="100" Height="5" Margin="0,20,0,0" IsIndeterminate="True" Style="{StaticResource ProgressBarStyle}"/>
-
<TextBlock x:Name="TextLoad" Text="{DynamicResource text0_load}" Foreground="{StaticResource Color_TetBlock_Inactivity}" FontFamily="{StaticResource Jura}" FontSize="12px" HorizontalAlignment="Center" TextAlignment="Center" FontStretch="Medium" Margin="0,20,0,0"/>
-
</StackPanel>
</Grid>
diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.cs
index 61284d2e..a65121e5 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml.cs
+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs
@@ -31,6 +31,7 @@ namespace GTweak
"Light" => 1,
_ => 2,
};
+
App.ImportTweaksUpdate += delegate { BtnMore.IsChecked = true; };
App.ThemeChanged += delegate { new RebootWindow().ShowDialog(); };
}
diff --git a/.Source/GTweak/Windows/NotificationWindow.xaml.cs b/.Source/GTweak/Windows/NotificationWindow.xaml.cs
index 457cbfd3..053cb8c9 100644
--- a/.Source/GTweak/Windows/NotificationWindow.xaml.cs
+++ b/.Source/GTweak/Windows/NotificationWindow.xaml.cs
@@ -95,13 +95,13 @@ namespace GTweak.Windows
EasingDoubleKeyFrame fromFrame = new EasingDoubleKeyFrame(primaryMonitorArea.Right)
{
KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(0)),
- EasingFunction = new QuadraticEase()
+ EasingFunction = new PowerEase()
};
EasingDoubleKeyFrame toFrame = new EasingDoubleKeyFrame(primaryMonitorArea.Right - Width - 10)
{
KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(200)),
- EasingFunction = new QuadraticEase()
+ EasingFunction = new PowerEase()
};
doubleAnimKeyFrames.KeyFrames.Add(fromFrame);