Skip to content

Commit

Permalink
Dependency Update, Bugfix for detecting Builds that are below 17704
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterStrick committed Feb 12, 2024
1 parent 6f38c66 commit 8d14119
Show file tree
Hide file tree
Showing 9 changed files with 400 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231115000" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231219000" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="WinUIEx" Version="2.3.3" />
</ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions vivetool-gui/AboutAndSettings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

424 changes: 278 additions & 146 deletions vivetool-gui/AboutAndSettings.resx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vivetool-gui/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.WinForms" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2210.55" newVersion="1.0.2210.55" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2277.86" newVersion="1.0.2277.86" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.Core" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2210.55" newVersion="1.0.2210.55" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2277.86" newVersion="1.0.2277.86" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
Expand Down
9 changes: 8 additions & 1 deletion vivetool-gui/GUI.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vivetool-gui/GUI.resx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
<data name="__DBG_SentryCrashTest_DivideBy0.Text" xml:space="preserve">
<value>[Sentry] Divide by 0 - Crash Test</value>
</data>
<data name="__DBG_CustomDebug.Text" xml:space="preserve">
<value>Custom Debug</value>
</data>
<data name="__DBG_MainBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>735, 1</value>
</data>
Expand Down Expand Up @@ -2438,6 +2441,12 @@
<data name="&gt;&gt;FluentTheme.Type" xml:space="preserve">
<value>Telerik.WinControls.Themes.FluentTheme, Telerik.WinControls.Themes.Fluent, Version=2021.3.1109.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e</value>
</data>
<data name="&gt;&gt;__DBG_CustomDebug.Name" xml:space="preserve">
<value>__DBG_CustomDebug</value>
</data>
<data name="&gt;&gt;__DBG_CustomDebug.Type" xml:space="preserve">
<value>Telerik.WinControls.UI.RadMenuItem, Telerik.WinControls.UI, Version=2021.3.1109.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>GUI</value>
</data>
Expand Down
161 changes: 83 additions & 78 deletions vivetool-gui/GUI.vb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ Public Class GUI
Private Sub __DBG_RDDL_Build_SelectedIndexTest_Click(sender As Object, e As EventArgs) Handles __DBG_RDDL_Build_SelectedIndexTest.Click
RDDL_Build.SelectedIndex = -1
End Sub

Private Sub __DBG_CustomDebug_Click(sender As Object, e As EventArgs) Handles __DBG_CustomDebug.Click
Dim Build = "17643.1000"

If CInt(Build) >= 17704 Then
MsgBox($"Got {CInt(Build)}, is higher than 17704")
Else
MsgBox($"Got {CInt(Build)}, {My.Resources.Error_SelectBuild17704OrHigherToUseGrouping}")
End If
End Sub
#End Region

''' <summary>
Expand Down Expand Up @@ -682,14 +692,6 @@ Public Class GUI
''' <param name="e">Default EventArgs</param>
Private Sub BGW_PopulateGridView_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BGW_PopulateGridView.DoWork
If Not BGW_PopulateGridView.CancellationPending Then
'If RDDL_Build.Text = "features" Then
' Invoke(Sub()
' MsgBox("Do not load the ""features"" Item inside the Drop Down, this would otherwise create a crash.", MsgBoxStyle.Critical, "debug")
' RDDL_Build.SelectedIndex = -1
' End Sub)
' Return
'End If

' Debug
Diagnostics.Debug.WriteLine("Loading Build " & RDDL_Build.Text)

Expand Down Expand Up @@ -720,94 +722,97 @@ Public Class GUI
Dim path As String = IO.Path.GetTempPath & "loadedList.txt"
WebClient.DownloadFile("https://raw.githubusercontent.com/riverar/mach2/master/" & RDDL_Build.SelectedItem.Tag.ToString & ".txt", path)

' Fix for _arm64 Feature Lists
' Fix for _arm64 Feature Lists and Builds that end in .1xxx
Dim tmpBuild As String = RDDL_Build.Text
Dim Build As Integer

' Continue if Feature List is normal
If IsNumeric(RDDL_Build.Text) Then
Build = CInt(RDDL_Build.Text)
Else
' Remove the /features/*/amd64|arm64 part
Dim tempBuild = RDDL_Build.Text.Split(CChar("/"))(3)
' Remove .1xxx if it exists, example .1001
If tmpBuild.Contains(".") Then
tmpBuild = tmpBuild.Split(CChar("."))(0)
End If

' Remove everything past the _ Part to get a normal Build Number
Build = CInt(tempBuild.Split(CChar("_"))(0))
' Remove _XXXX if it exists, example _arm64
If tmpBuild.Contains("_") Then
tmpBuild = tmpBuild.Split(CChar("_"))(0)
End If

' Convert the now Split String to an Integer
Build = CInt(tmpBuild)

' For each line add a grid view entry
For Each Line In IO.File.ReadAllLines(path)
' Check Line Stage, used for Grouping
Try
If Build >= 17704 Then
If Line = "## Unknown:" Then
LineStage = My.Resources.Generic_Modifiable
ElseIf Line = "## Always Enabled:" Then
LineStage = My.Resources.Generic_AlwaysEnabled
ElseIf Line = "## Enabled By Default:" Then
LineStage = My.Resources.Generic_EnabledByDefault
ElseIf Line = "## Disabled By Default:" Then
LineStage = My.Resources.Generic_DisabledByDefault
ElseIf Line = "## Always Disabled:" Then
LineStage = My.Resources.Generic_AlwaysDisabled
' Check Line Stage, used for Grouping
Try
If Build >= 17704 Then
If Line = "## Unknown:" Then
LineStage = My.Resources.Generic_Modifiable
ElseIf Line = "## Always Enabled:" Then
LineStage = My.Resources.Generic_AlwaysEnabled
ElseIf Line = "## Enabled By Default:" Then
LineStage = My.Resources.Generic_EnabledByDefault
ElseIf Line = "## Disabled By Default:" Then
LineStage = My.Resources.Generic_DisabledByDefault
ElseIf Line = "## Always Disabled:" Then
LineStage = My.Resources.Generic_AlwaysDisabled
End If
Else
LineStage = My.Resources.Error_SelectBuild17704OrHigherToUseGrouping
End If
Else
LineStage = My.Resources.Error_SelectBuild17704OrHigherToUseGrouping
End If
Catch ex As Exception
LineStage = My.Resources.Error_Error
End Try
Catch ex As Exception
LineStage = My.Resources.Error_Error
End Try

' Split the Line at the :
Dim Str As String() = Line.Split(CChar(":"))
' Split the Line at the :
Dim Str As String() = Line.Split(CChar(":"))

' Remove any Spaces from the first Str Array (Feature Name) and second Str Array (Feature ID)
Str = Str.Select(Function(s) s.Trim).ToArray()
' Remove any Spaces from the first Str Array (Feature Name) and second Str Array (Feature ID)
Str = Str.Select(Function(s) s.Trim).ToArray()

' If the Line is not empty, continue
If Line IsNot "" AndAlso Not Line.Contains("#") Then
' Get the Feature Enabled State from the currently processing line.
' RtlFeatureManager.QueryFeatureConfiguration will return Enabled, Disabled or throw a NullReferenceException for Default
Try
Dim State As String = ViVe_API.Feature.Query(CUInt(Str(1)))
Dim Image = Nothing
' If the Line is not empty, continue
If Line IsNot "" AndAlso Not Line.Contains("#") Then
' Get the Feature Enabled State from the currently processing line.
' RtlFeatureManager.QueryFeatureConfiguration will return Enabled, Disabled or throw a NullReferenceException for Default
Try
Dim State As String = ViVe_API.Feature.Query(CUInt(Str(1)))
Dim Image = Nothing

If HasInternetConnection AndAlso DatabaseFunctions.HasDBAvailable AndAlso Not DatabaseFunctions.TableDoesNotExist Then
Dim rows As DataRow() = DatabaseFunctions.Build_DT.Select(String.Format("FeatureName = '{0}'", Str(0)))
If rows.Length >= 1 Then Image = CommentsImg
End If
If HasInternetConnection AndAlso DatabaseFunctions.HasDBAvailable AndAlso Not DatabaseFunctions.TableDoesNotExist Then
Dim rows As DataRow() = DatabaseFunctions.Build_DT.Select(String.Format("FeatureName = '{0}'", Str(0)))
If rows.Length >= 1 Then Image = CommentsImg
End If

Invoke(Sub() RGV_MainGridView.Rows.Add(Str(0), Str(1), State, LineStage, Image))
Catch ex As Exception
Invoke(Sub() RGV_MainGridView.Rows.Add(Str(0), Str(1), My.Resources.Generic_Default, LineStage))
End Try
End If
Next
Invoke(Sub() RGV_MainGridView.Rows.Add(Str(0), Str(1), State, LineStage, Image))
Catch ex As Exception
Invoke(Sub() RGV_MainGridView.Rows.Add(Str(0), Str(1), My.Resources.Generic_Default, LineStage))
End Try
End If
Next

' Move to the first row, remove the selection and change the Status Label to Done.
Invoke(Sub()
RGV_MainGridView.CurrentRow = RGV_MainGridView.Rows.Item(0)
RGV_MainGridView.CurrentRow = Nothing
RLE_StatusLabel.Text = My.Resources.Generic_Done
End Sub)
' Move to the first row, remove the selection and change the Status Label to Done.
Invoke(Sub()
RGV_MainGridView.CurrentRow = RGV_MainGridView.Rows.Item(0)
RGV_MainGridView.CurrentRow = Nothing
RLE_StatusLabel.Text = My.Resources.Generic_Done
End Sub)

' Delete Feature List from %TEMP%
IO.File.Delete(path)
' Delete Feature List from %TEMP%
IO.File.Delete(path)

' Enable Grouping
Dim LineGroup As New Data.GroupDescriptor()
LineGroup.GroupNames.Add("FeatureInfo", ComponentModel.ListSortDirection.Ascending)
Invoke(Sub() RGV_MainGridView.GroupDescriptors.Add(LineGroup))
' Enable Grouping
Dim LineGroup As New Data.GroupDescriptor()
LineGroup.GroupNames.Add("FeatureInfo", ComponentModel.ListSortDirection.Ascending)
Invoke(Sub() RGV_MainGridView.GroupDescriptors.Add(LineGroup))

' Enable Animations and selection
Invoke(Sub()
AnimatedPropertySetting.AnimationsEnabled = True
RGV_MainGridView.SelectionMode = GridViewSelectionMode.FullRowSelect
End Sub)
' Enable Animations and selection
Invoke(Sub()
AnimatedPropertySetting.AnimationsEnabled = True
RGV_MainGridView.SelectionMode = GridViewSelectionMode.FullRowSelect
End Sub)

' Make the Search Row Visible
Invoke(Sub() RGV_MainGridView.MasterView.TableSearchRow.IsVisible = True)
Else
Return
' Make the Search Row Visible
Invoke(Sub() RGV_MainGridView.MasterView.TableSearchRow.IsVisible = True)
Else
Return
End If
End Sub

Expand Down
Loading

0 comments on commit 8d14119

Please # to comment.