Skip to content

Commit

Permalink
Refactor application to remove deprecated admin and startup features
Browse files Browse the repository at this point in the history
- Removed all functionalities related to running Blitz as admin and managing startup on boot.
- Updated XAML layout:
  - Eliminated buttons and controls associated with the deprecated features.
  - Adjusted the UI layout to ensure proper alignment after removal.
- Cleaned up C# code:
  - Deleted methods and event handlers related to the deprecated functionalities.
  - Renamed and refactored remaining methods for clarity and professionalism.
  - Improved exception handling with user-friendly error messages.
  - Organized code into regions for better readability.
- Updated language resource handling to ensure consistency.
- Ensured the application remains fully functional without the deprecated features.
  • Loading branch information
Ku-Tadao committed Sep 30, 2024
1 parent f656b5f commit 415cc14
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 495 deletions.
16 changes: 6 additions & 10 deletions Blitz.gg/Troubleshooter/Blitz Troubleshooter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,9 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<UsingTask TaskName="ILRepack" AssemblyFile="$(NuGetPackageRoot)packages\ILRepack.Lib.MSBuild.Task.2.0.32\build\ILRepack.Lib.MSBuild.Task.dll" />
<Import Project="packages\ILRepack.Lib.MSBuild.Task.2.0.34.2\build\ILRepack.Lib.MSBuild.Task.targets" Condition="Exists('packages\ILRepack.Lib.MSBuild.Task.2.0.34.2\build\ILRepack.Lib.MSBuild.Task.targets')" />
<Target Name="AfterBuild">
<ILRepack
Parallel="true"
DebugInfo="true"
OutputFile="$(OutputPath)$(AssemblyName)-merged.exe"
InputAssemblies="$(OutputPath)$(AssemblyName).exe;$(OutputPath)Microsoft.Bcl.AsyncInterfaces.dll;$(OutputPath)Newtonsoft.Json.dll;$(OutputPath)Newtonsoft.Json.Bson.dll;$(OutputPath)System.Buffers.dll;$(OutputPath)System.IO.Compression.ZipFile.dll;$(OutputPath)System.Memory.dll;$(OutputPath)System.Net.Http.Formatting.dll;$(OutputPath)System.Numerics.Vectors.dll;$(OutputPath)System.Runtime.CompilerServices.Unsafe.dll;$(OutputPath)System.Text.Encodings.Web.dll;$(OutputPath)System.Text.Json.dll;$(OutputPath)System.Threading.Tasks.Extensions.dll;$(OutputPath)System.ValueTuple.dll" />
<ILRepack Parallel="true" DebugInfo="true" OutputFile="$(OutputPath)$(AssemblyName)-merged.exe" InputAssemblies="$(OutputPath)$(AssemblyName).exe;$(OutputPath)Microsoft.Bcl.AsyncInterfaces.dll;$(OutputPath)Newtonsoft.Json.dll;$(OutputPath)Newtonsoft.Json.Bson.dll;$(OutputPath)System.Buffers.dll;$(OutputPath)System.IO.Compression.ZipFile.dll;$(OutputPath)System.Memory.dll;$(OutputPath)System.Net.Http.Formatting.dll;$(OutputPath)System.Numerics.Vectors.dll;$(OutputPath)System.Runtime.CompilerServices.Unsafe.dll;$(OutputPath)System.Text.Encodings.Web.dll;$(OutputPath)System.Text.Json.dll;$(OutputPath)System.Threading.Tasks.Extensions.dll;$(OutputPath)System.ValueTuple.dll" />
</Target>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
Expand Down Expand Up @@ -126,8 +122,8 @@
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=8.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Json.8.0.3\lib\net462\System.Text.Json.dll</HintPath>
<Reference Include="System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Json.8.0.4\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
Expand Down Expand Up @@ -248,11 +244,11 @@
<None Include="Todo.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="packages\ILRepack.Lib.MSBuild.Task.2.0.32\build\ILRepack.Lib.MSBuild.Task.targets" Condition="Exists('packages\ILRepack.Lib.MSBuild.Task.2.0.32\build\ILRepack.Lib.MSBuild.Task.targets')" />
<Import Project="packages\ILRepack.Lib.MSBuild.Task.2.0.34.2\build\ILRepack.Lib.MSBuild.Task.targets" Condition="Exists('packages\ILRepack.Lib.MSBuild.Task.2.0.34.2\build\ILRepack.Lib.MSBuild.Task.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\ILRepack.Lib.MSBuild.Task.2.0.32\build\ILRepack.Lib.MSBuild.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\ILRepack.Lib.MSBuild.Task.2.0.32\build\ILRepack.Lib.MSBuild.Task.targets'))" />
<Error Condition="!Exists('packages\ILRepack.Lib.MSBuild.Task.2.0.34.2\build\ILRepack.Lib.MSBuild.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\ILRepack.Lib.MSBuild.Task.2.0.34.2\build\ILRepack.Lib.MSBuild.Task.targets'))" />
</Target>
</Project>
42 changes: 13 additions & 29 deletions Blitz.gg/Troubleshooter/Troubleshooter.xaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Window x:Name="Window1" x:Class="Blitz_Troubleshooter.Troubleshooter"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
ResizeMode="NoResize"
SizeToContent="Width"
Title="" Height="450">
Title="Blitz Troubleshooter" Height="450">
<Window.Resources>
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="#e2e4e9"/>
Expand All @@ -19,46 +19,30 @@
</Style>
</Window.Resources>
<Grid x:Name="Grid">
<Button x:Name="BtnColor" Content="Dark" Height="22" Width="44" Margin="0,10,150,0" HorizontalAlignment="Right" VerticalAlignment="Top" Click="Button_Click_1" Style="{StaticResource ButtonStyle}" />
<Button x:Name="BtnColor" Content="Dark" Height="22" Width="44" Margin="0,10,150,0" HorizontalAlignment="Right" VerticalAlignment="Top" Click="BtnColor_Click" Style="{StaticResource ButtonStyle}" />
<ComboBox Name="CbLang" SelectedValuePath="Tag" Text="Language" IsEditable="True" IsReadOnly="True" Width="130" Margin="0,10,10,0" HorizontalAlignment="Right" VerticalAlignment="Top" SelectionChanged="ComboBox_SelectionChanged">
<ComboBoxItem Tag="en-EN">English</ComboBoxItem>
<ComboBoxItem Tag="de-DE">Deutsch</ComboBoxItem>
<ComboBoxItem Tag="fr-FR">Français</ComboBoxItem>
<ComboBoxItem Tag="pl-PL">Polski</ComboBoxItem>
<ComboBoxItem Tag="pt-PT">Português</ComboBoxItem>
<ComboBoxItem Tag="ru-RU">Русский</ComboBoxItem>
<ComboBoxItem Tag="tr-TR">Turkçe</ComboBoxItem>
<ComboBoxItem Tag="tr-TR">Türkçe</ComboBoxItem>
</ComboBox>
<Image Source="Troubleshooter logo.png" Height="35" Margin="10,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
<StackPanel x:Name="spmain" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="10,60,10,0">
<StackPanel >
<Button x:Name="Btn1" Content="{DynamicResource fixcommon}" Height="27" Margin="0,0,0,5" Click="Button_Click" Style="{StaticResource ButtonStyle}" />
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button x:Name="Btn2" Content="{DynamicResource runasadmin}" Height="27" Click="BtnFixOverlayClick" Style="{StaticResource ButtonStyle}" />
<Button Grid.Column="1" x:Name="Btn3" Content="{DynamicResource unfix}" Padding="5,0,5,0" Margin="3,0,0,0" Height="27" Click="BtnRemoveAdminClick" Style="{StaticResource ButtonStyle}" />
</Grid>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button x:Name="Btn4" Content="{DynamicResource fixboot}" Height="27" Click="BtnFixBootClick" Style="{StaticResource ButtonStyle}" />
<Button Grid.Column="1" x:Name="Btn5" Content="{DynamicResource unfix}" Padding="5,0,5,0" Margin="3,0,0,0" Height="27" Click="BtnRemoveBootFixClick" Style="{StaticResource ButtonStyle}" />
</Grid>
<Button x:Name="Btn6" Content="{DynamicResource clearcache}" Height="27" Margin="0,0,0,5" Click="Button_Click_2" Style="{StaticResource ButtonStyle}" />
<Button x:Name="Btn7" Content="{DynamicResource uninstall}" Height="27" Margin="0,0,0,5" Click="Button_Click_4" Style="{StaticResource ButtonStyle}" />
<Button x:Name="Btn8" Content="{DynamicResource manuallyInstallBlitz}" Height="27" Margin="0,0,0,5" Click="Btn8_Click" Style="{StaticResource ButtonStyle}" />
<StackPanel>
<Button x:Name="Btn1" Content="{DynamicResource fixcommon}" Height="27" Margin="0,0,0,5" Click="BtnFixCommonIssues_Click" Style="{StaticResource ButtonStyle}" />
<Button x:Name="Btn6" Content="{DynamicResource clearcache}" Height="27" Margin="0,0,0,5" Click="BtnClearCache_Click" Style="{StaticResource ButtonStyle}" />
<Button x:Name="Btn7" Content="{DynamicResource uninstall}" Height="27" Margin="0,0,0,5" Click="BtnUninstall_Click" Style="{StaticResource ButtonStyle}" />
<Button x:Name="Btn8" Content="{DynamicResource manuallyInstallBlitz}" Height="27" Margin="0,0,0,5" Click="BtnManualInstall_Click" Style="{StaticResource ButtonStyle}" />
</StackPanel>
<StackPanel Margin="0,50,0,0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Foreground="#e2e4e9" Text="{DynamicResource progressbar}" Margin="0,0,5,0" />
<TextBlock Foreground="#e2e4e9" x:Name="InputText" Text="{DynamicResource waitinginput}" />
</StackPanel>
<ProgressBar x:Name="ProgressBar1" Height="27" />
<ProgressBar x:Name="ProgressBar1" Height="27" />
</StackPanel>
</StackPanel>
<TextBlock x:Name="Labelspeed" HorizontalAlignment="Left" Margin="375,238,0,0" Text="" VerticalAlignment="Top" Foreground="Wheat" />
Expand Down
Loading

0 comments on commit 415cc14

Please sign in to comment.