Skip to content

Portable Tool for an Ideal Windows Setup

add SystemInformer/GPU-Z download support with multi-step POST logic for techpowerup.com & fix custom element popup animation

Greedeks018d5ef3b388
diff --git a/.Source/GTweak/Assets/Images/DownloadApps/GPUz.png b/.Source/GTweak/Assets/Images/DownloadApps/GPUz.png
new file mode 100644
index 00000000..3e214df5
Binary files /dev/null and b/.Source/GTweak/Assets/Images/DownloadApps/GPUz.png differ
diff --git a/.Source/GTweak/Assets/Images/DownloadApps/SystemInfo.png b/.Source/GTweak/Assets/Images/DownloadApps/SystemInfo.png
new file mode 100644
index 00000000..8b916948
Binary files /dev/null and b/.Source/GTweak/Assets/Images/DownloadApps/SystemInfo.png differ
diff --git a/.Source/GTweak/Assets/Images/ImageResources.xaml b/.Source/GTweak/Assets/Images/ImageResources.xaml
index e3186ee3..f2cbc0ca 100644
--- a/.Source/GTweak/Assets/Images/ImageResources.xaml
+++ b/.Source/GTweak/Assets/Images/ImageResources.xaml
@@ -16,10 +16,12 @@
<BitmapImage x:Key="Img_DiskInfo" UriSource="/GTweak;component/Assets/Images/DownloadApps/DiskInfo.png"/>
<BitmapImage x:Key="Img_DiskMark" UriSource="/GTweak;component/Assets/Images/DownloadApps/DiskMark.png"/>
<BitmapImage x:Key="Img_FirstEverTech" UriSource="/GTweak;component/Assets/Images/DownloadApps/FirstEverTech.png"/>
+ <BitmapImage x:Key="Img_GPUz" UriSource="/GTweak;component/Assets/Images/DownloadApps/GPUz.png"/>
<BitmapImage x:Key="Img_Nvidia" UriSource="/GTweak;component/Assets/Images/DownloadApps/Nvidia.png"/>
<BitmapImage x:Key="Img_NvidiaPI" UriSource="/GTweak;component/Assets/Images/DownloadApps/NvidiaPI.png"/>
<BitmapImage x:Key="Img_Occt" UriSource="/GTweak;component/Assets/Images/DownloadApps/Occt.png"/>
<BitmapImage x:Key="Img_Rufus" UriSource="/GTweak;component/Assets/Images/DownloadApps/Rufus.png"/>
+ <BitmapImage x:Key="Img_SystemInfo" UriSource="/GTweak;component/Assets/Images/DownloadApps/SystemInfo.png"/>
<!--#endregion -->
<!--#region PreinstalledApps -->
diff --git a/.Source/GTweak/Assets/UserControls/Card.xaml b/.Source/GTweak/Assets/UserControls/Card.xaml
index 0b8f3848..0fe1cdd4 100644
--- a/.Source/GTweak/Assets/UserControls/Card.xaml
+++ b/.Source/GTweak/Assets/UserControls/Card.xaml
@@ -13,7 +13,8 @@
<TranslateTransform X="3" Y="6" />
</Border.RenderTransform>
</Border>
- <Border x:Name="CardBody" Background="{StaticResource Brush_Background_Card}" CornerRadius="8" Padding="10" MaxWidth="350" HorizontalAlignment="Center" VerticalAlignment="Top" SnapsToDevicePixels="True">
+
+ <Border x:Name="CardBody" Background="{StaticResource Brush_Background_Card}" CornerRadius="8" Padding="10" MaxWidth="350" HorizontalAlignment="Center" VerticalAlignment="Top" SnapsToDevicePixels="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -21,19 +22,21 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal" Grid.Row="0" VerticalAlignment="Center" Margin="0,0,0,8">
- <Border Padding="5,3,10,3" Background="{StaticResource Brush_Background_Labels}" CornerRadius="7">
- <StackPanel Orientation="Horizontal">
- <Image x:Name="CardIcon" Height="24" Width="24"/>
- <TextBlock Margin="5,0,0,0" x:Name="CardTitle" Style="{StaticResource TextDefault}" FontSize="16" Foreground="{StaticResource Brush_Accent}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" MaxWidth="300"/>
- </StackPanel>
- </Border>
- </StackPanel>
+ <Border Padding="5,3,10,3" Background="{StaticResource Brush_Background_Labels}" CornerRadius="7" Grid.Row="0" Margin="0,0,0,8" HorizontalAlignment="Left">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
- <TextBlock Margin="0,0,0,12" Grid.Row="1" x:Name="CardText" FontSize="14" Style="{StaticResource TextDefault}" Foreground="{StaticResource Brush_Highlighted}"/>
+ <Image x:Name="CardIcon" Grid.Column="0" Height="24" Width="24" VerticalAlignment="Center"/>
+ <TextBlock x:Name="CardTitle" Grid.Column="1" Margin="5,0,0,0" Style="{StaticResource TextDefault}" FontSize="16" Foreground="{StaticResource Brush_Accent}" TextWrapping="Wrap" VerticalAlignment="Center"/>
+ </Grid>
+ </Border>
+ <TextBlock Margin="0,0,0,12" Grid.Row="1" x:Name="CardText" FontSize="14" Style="{StaticResource TextDefault}" Foreground="{StaticResource Brush_Highlighted}" TextWrapping="Wrap"/>
- <Grid Grid.Row="2" Margin="0,10,0,0">
+ <Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto"/>
@@ -45,4 +48,4 @@
</Grid>
</Border>
</Grid>
-</UserControl>
+</UserControl>
\ No newline at end of file
diff --git a/.Source/GTweak/Assets/UserControls/ColorPicker.xaml b/.Source/GTweak/Assets/UserControls/ColorPicker.xaml
index 873e0ae0..7e655c6e 100644
--- a/.Source/GTweak/Assets/UserControls/ColorPicker.xaml
+++ b/.Source/GTweak/Assets/UserControls/ColorPicker.xaml
@@ -26,8 +26,8 @@
</Grid>
</ToggleButton>
- <Popup x:Name="ColorPopup" Placement="Bottom" StaysOpen="False" AllowsTransparency="True" Opened="ColorPopup_Opened" Closed="ColorPopup_Closed" VerticalOffset="2">
- <Border x:Name="PopupBorder" Background="{StaticResource Brush_Background_ComboBox}" BorderBrush="{StaticResource Brush_Separator}" BorderThickness="1" CornerRadius="8" Padding="12" Margin="10">
+ <Popup x:Name="ColorPopup" Placement="Bottom" StaysOpen="False" AllowsTransparency="True" Opened="ColorPopup_Opened" Closed="ColorPopup_Closed" VerticalOffset="2" PopupAnimation="Fade">
+ <Border x:Name="PopupBorder" Background="{StaticResource Brush_Background_ComboBox}" BorderBrush="{StaticResource Brush_Separator}" BorderThickness="1" CornerRadius="8" Padding="12" Margin="10" RenderOptions.EdgeMode="Aliased">
<Border.CacheMode>
<BitmapCache RenderAtScale="2" EnableClearType="True"/>
</Border.CacheMode>
diff --git a/.Source/GTweak/Assets/UserControls/ExpandableBox.xaml b/.Source/GTweak/Assets/UserControls/ExpandableBox.xaml
index ac42cc85..066d0986 100644
--- a/.Source/GTweak/Assets/UserControls/ExpandableBox.xaml
+++ b/.Source/GTweak/Assets/UserControls/ExpandableBox.xaml
@@ -12,8 +12,8 @@
<TextBlock Text="{Binding ElementName=Root, Path=Text}" VerticalAlignment="Center" FontSize="14px" FontFamily="{StaticResource Jura}" Foreground="{StaticResource Brush_Highlighted}" Margin="0,0,10,0"/>
</ToggleButton>
- <Popup x:Name="DropdownPopup" Placement="Bottom" StaysOpen="False" AllowsTransparency="True" Opened="Popup_Opened" Closed="Popup_Closed" VerticalOffset="2">
- <Border x:Name="PopupBorder" Background="{StaticResource Brush_Background_ComboBox}" BorderBrush="{StaticResource Brush_Separator}" BorderThickness="1" CornerRadius="8" Padding="12" Margin="10">
+ <Popup x:Name="DropdownPopup" Placement="Bottom" StaysOpen="False" AllowsTransparency="True" Opened="Popup_Opened" Closed="Popup_Closed" VerticalOffset="2" PopupAnimation="Fade">
+ <Border x:Name="PopupBorder" Background="{StaticResource Brush_Background_ComboBox}" BorderBrush="{StaticResource Brush_Separator}" BorderThickness="1" CornerRadius="8" Padding="12" Margin="10" RenderOptions.EdgeMode="Aliased">
<Border.CacheMode>
<BitmapCache RenderAtScale="2" EnableClearType="True"/>
</Border.CacheMode>
diff --git a/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml b/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml
index 3470fd85..bc5e39d2 100644
--- a/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml
+++ b/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml
@@ -156,18 +156,37 @@
<Grid Grid.Column="0">
- <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-2,0,0" FontSize="13px">
+ <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-2,0,0" FontSize="13px">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource TextDefault}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
- <DataTrigger Binding="{Binding Progress,ElementName=root}" Value="0">
+ <DataTrigger Binding="{Binding Progress, ElementName=root}" Value="0">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
- <Run Text="{DynamicResource connecting_ts}"/><Run Text="..."/>
+ <Run Text="{DynamicResource connecting_ts}" /><InlineUIContainer>
+ <Border Width="15">
+ <TextBlock x:Name="DotText" Text="" Style="{StaticResource TextDefault}" FontSize="13px">
+ <TextBlock.Triggers>
+ <EventTrigger RoutedEvent="FrameworkElement.Loaded">
+ <BeginStoryboard>
+ <Storyboard Timeline.DesiredFrameRate="60" RepeatBehavior="Forever" Duration="0:0:1">
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DotText" Storyboard.TargetProperty="Text">
+ <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="" />
+ <DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="." />
+ <DiscreteObjectKeyFrame KeyTime="0:0:0.4" Value=".." />
+ <DiscreteObjectKeyFrame KeyTime="0:0:0.6" Value="..." />
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger>
+ </TextBlock.Triggers>
+ </TextBlock>
+ </Border>
+ </InlineUIContainer>
</TextBlock>
<Grid>
diff --git a/.Source/GTweak/Core/Services/ToolsetDownloadService.cs b/.Source/GTweak/Core/Services/ToolsetDownloadService.cs
index 0ef697e8..2fba3a08 100644
--- a/.Source/GTweak/Core/Services/ToolsetDownloadService.cs
+++ b/.Source/GTweak/Core/Services/ToolsetDownloadService.cs
@@ -159,6 +159,59 @@ namespace GTweak.Core.Services
throw new HttpRequestException();
}
+ if (model.Group.Equals("techpowerup", StringComparison.OrdinalIgnoreCase))
+ {
+ Match idMatch = Regex.Match(await _httpClient.GetStringAsync(model.DownloadPath), @"name=""id""\s+value=""(?<id>\d+)""", RegexOptions.IgnoreCase);
+
+ if (!idMatch.Success)
+ {
+ throw new HttpRequestException();
+ }
+
+ string fileId = idMatch.Groups["id"].Value;
+
+ FormUrlEncodedContent firstStepPayload = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>("id", fileId) });
+
+ using HttpResponseMessage firstResponse = await _httpClient.PostAsync(model.DownloadPath, firstStepPayload);
+ string serverSelectionHtml = await firstResponse.Content.ReadAsStringAsync();
+
+ MatchCollection serverMatches = Regex.Matches(serverSelectionHtml, @"(?is)<button[^>]+?name=""server_id""[^>]+?value=""(?<sid>\d+)""[^>]*>(?<content>.*?)</button>");
+
+ string closestId = null, lowLoadId = null, firstId = null;
+
+ foreach (Match m in serverMatches)
+ {
+ string sid = m.Groups["sid"].Value;
+ string content = m.Groups["content"].Value;
+
+ firstId ??= sid;
+
+ if (content.IndexOf("closest", StringComparison.OrdinalIgnoreCase) >= 0)
+ {
+ closestId = sid;
+ break;
+ }
+
+ if (lowLoadId == null && content.IndexOf("server-load low", StringComparison.OrdinalIgnoreCase) >= 0)
+ {
+ lowLoadId = sid;
+ }
+ }
+
+ FormUrlEncodedContent finalPayload = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>("id", fileId), new KeyValuePair<string, string>("server_id", closestId ?? lowLoadId ?? firstId ?? throw new HttpRequestException()) });
+
+ using HttpRequestMessage finalRequest = new HttpRequestMessage(HttpMethod.Post, model.DownloadPath)
+ {
+ Content = finalPayload
+ };
+
+ finalRequest.Headers.Referrer = new Uri(model.DownloadPath);
+
+ using HttpResponseMessage finalResponse = await _httpClient.SendAsync(finalRequest, HttpCompletionOption.ResponseHeadersRead);
+
+ return finalResponse.RequestMessage.RequestUri.ToString();
+ }
+
throw new HttpRequestException();
}
diff --git a/.Source/GTweak/Resources/AppsCatalog.xml b/.Source/GTweak/Resources/AppsCatalog.xml
index 538c0fcc..548212a4 100644
--- a/.Source/GTweak/Resources/AppsCatalog.xml
+++ b/.Source/GTweak/Resources/AppsCatalog.xml
@@ -87,6 +87,17 @@
<FilePattern><![CDATA[(?i)rufus-.*?p\.exe$]]></FilePattern>
</App>
+ <App>
+ <Icon>Img_SystemInfo</Icon>
+ <Name>SystemInformer</Name>
+ <Group>github</Group>
+ <Author>Winsider Seminars &amp; Solutions, Inc</Author>
+ <AuthorIcon>https://github.com/winsiderss.png</AuthorIcon>
+ <Source>https://github.com/winsiderss/systeminformer</Source>
+ <DownloadPath>winsiderss/systeminformer</DownloadPath>
+ <FilePattern><![CDATA[(?i)systeminformer.*bin.*\.zip]]></FilePattern>
+ </App>
+
<App>
<Icon>Img_CPUz</Icon>
<Name>CPU-Z</Name>
@@ -96,6 +107,16 @@
<Source>https://sourceforge.net/projects/cpu-z/</Source>
<DownloadPath>https://sourceforge.net/projects/cpu-z/files/latest/download</DownloadPath>
</App>
+
+ <App>
+ <Icon>Img_GPUz</Icon>
+ <Name>GPU-Z</Name>
+ <Group>techpowerup</Group>
+ <Author>TechPowerUp</Author>
+ <AuthorIcon>techpowerup.com</AuthorIcon>
+ <Source>https://www.techpowerup.com/gpuz/</Source>
+ <DownloadPath>https://www.techpowerup.com/download/techpowerup-gpu-z/</DownloadPath>
+ </App>
<App>
<Icon>Img_DiskInfo</Icon>
diff --git a/Assets/Images/DownloadApps/GPUz.png b/Assets/Images/DownloadApps/GPUz.png
new file mode 100644
index 00000000..3e214df5
Binary files /dev/null and b/Assets/Images/DownloadApps/GPUz.png differ
diff --git a/Assets/Images/DownloadApps/SystemInfo.png b/Assets/Images/DownloadApps/SystemInfo.png
new file mode 100644
index 00000000..8b916948
Binary files /dev/null and b/Assets/Images/DownloadApps/SystemInfo.png differ