Skip to content

Commit

Permalink
DISMTools 0.5 Preview 2 (#106)
Browse files Browse the repository at this point in the history
* Update assembly information

* Update System information files

* Added image export capabilities, and fixed some coloring and progress panel disposal issues

* Add translations to image export dialog

* Update rounding

* Add auto clean-up option and task

* Select the file we want to point to in File Explorer

* Add possible fix to freezing issue

* Don't show update recommendation on nightly versions of DT

* Add better exception handling

* Add basic computer information to error in case of an internal error

* Show more information when downloading from App Installer packages

* Fixed exception

* Update What's New section
  • Loading branch information
CodingWonders committed Mar 16, 2024
1 parent e9daa70 commit dd222d5
Show file tree
Hide file tree
Showing 32 changed files with 2,872 additions and 133 deletions.
88 changes: 88 additions & 0 deletions ApplicationEvents.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Imports Microsoft.Win32
Imports Microsoft.VisualBasic.ControlChars
Imports System.Management

Namespace My
' Los siguientes eventos están disponibles para MyApplication:
'
' Inicio: se desencadena cuando se inicia la aplicación, antes de que se cree el formulario de inicio.
' Apagado: generado después de cerrar todos los formularios de la aplicación. Este evento no se genera si la aplicación termina de forma anómala.
' UnhandledException: generado si la aplicación detecta una excepción no controlada.
' StartupNextInstance: se desencadena cuando se inicia una aplicación de instancia única y la aplicación ya está activa.
' NetworkAvailabilityChanged: se desencadena cuando la conexión de red está conectada o desconectada.
Partial Friend Class MyApplication

Private Sub Start(sender As Object, e As EventArgs) Handles Me.Startup
AddHandler Microsoft.Win32.SystemEvents.UserPreferenceChanged, AddressOf SysEvts_UserPreferenceChanged
AddHandler Microsoft.Win32.SystemEvents.DisplaySettingsChanging, AddressOf SysEvts_DisplaySettingsChanging
AddHandler Microsoft.Win32.SystemEvents.DisplaySettingsChanged, AddressOf SysEvts_DisplaySettingsChanged
End Sub

Private Sub CatchEmAll(sender As Object, e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
ExceptionForm.ErrorText.Text = e.Exception.ToString() & CrLf & CrLf &
"Error Message: " & e.Exception.Message & CrLf & CrLf &
"Error Code (HRESULT): " & e.Exception.HResult
Try
' Get basic information about the system. This does not include any personally identifiable information (PII) or
' serial numbers that can identify the computer this program is run on
Dim CS_Searcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT Manufacturer, Model FROM Win32_ComputerSystem")
Dim BIOS_Searcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT Name, Description, SMBIOSBIOSVersion FROM Win32_BIOS")
Dim Proc_Searcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT Name, Caption, Manufacturer, Family FROM Win32_Processor")
Dim CS_Results As ManagementObjectCollection = CS_Searcher.Get()
Dim BIOS_Results As ManagementObjectCollection = BIOS_Searcher.Get()
Dim Proc_Results As ManagementObjectCollection = Proc_Searcher.Get()
ExceptionForm.ErrorText.AppendText(CrLf & CrLf &
"Machine information:" & CrLf)
For Each CS_Result As ManagementObject In CS_Results
ExceptionForm.ErrorText.AppendText(" - Computer manufacturer: " & CS_Result("Manufacturer") & CrLf &
" - Computer model: " & CS_Result("Model") & CrLf)
Next
For Each BIOS_Result As ManagementObject In BIOS_Results
ExceptionForm.ErrorText.AppendText(" - BIOS name/description: " & BIOS_Result("Name") & " " & BIOS_Result("Description") & CrLf &
" - System Management BIOS (SMBIOS) version: " & BIOS_Result("SMBIOSBIOSVersion") & CrLf & CrLf)
Next
ExceptionForm.ErrorText.AppendText("Operating system information:" & CrLf &
" - OS name: " & My.Computer.Info.OSFullName & CrLf &
" - OS version: " & My.Computer.Info.OSVersion & CrLf &
" - OS Platform: " & My.Computer.Info.OSPlatform & CrLf &
" - Is a 64-bit system? " & If(Environment.Is64BitOperatingSystem, "Yes", "No") & CrLf & CrLf &
"Processor information:" & CrLf)
For Each Proc_Result As ManagementObject In Proc_Results
ExceptionForm.ErrorText.AppendText(" - Processor name: " & Proc_Result("Name") & CrLf &
" - Processor caption: " & Proc_Result("Caption") & CrLf &
" - Processor manufacturer: " & Proc_Result("Manufacturer") & CrLf &
" - Processor family (WMI type): " & Proc_Result("Family") & CrLf &
" NOTE: refer to the following website to get the exact family type of your processor:" & CrLf &
" https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-processor" & CrLf & CrLf)
Next
ExceptionForm.ErrorText.AppendText("This information is gathered to help isolate the issue to a specific hardware or software configuration. " &
"No information that can be used to identify the user or the exact system is gathered." & CrLf & CrLf &
"If you don't want to send this information to the developers, paste the text that was copied to the clipboard in a text editor, remove this information, and copy the new text again.")
Catch ex As Exception
' Could not get basic machine information
End Try
ExceptionForm.ShowDialog()
If ExceptionForm.DialogResult = DialogResult.OK Then
e.ExitApplication = False
ElseIf ExceptionForm.DialogResult = DialogResult.Cancel Then
e.ExitApplication = True
End If
End Sub

Private Sub SysEvts_UserPreferenceChanged(sender As Object, e As Microsoft.Win32.UserPreferenceChangedEventArgs)
' Do nothing
End Sub

Private Sub SysEvts_DisplaySettingsChanged(sender As Object, e As EventArgs)
' Do nothing
End Sub

Private Sub SysEvts_DisplaySettingsChanging(sender As Object, e As EventArgs)
' Do nothing
End Sub

End Class


End Namespace

Expand Down
20 changes: 20 additions & 0 deletions DISMTools.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<Compile Include="Actions\Validation\Actions.Validation.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="ApplicationEvents.vb" />
<Compile Include="Elements\AppxPackage.vb" />
<Compile Include="Elements\Recents.vb" />
<Compile Include="Help\HelpBrowserForm.Designer.vb">
Expand Down Expand Up @@ -191,6 +192,12 @@
<Compile Include="Panels\DoWork\ProgressPanel.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Panels\Exceptions\ExceptionForm.Designer.vb">
<DependentUpon>ExceptionForm.vb</DependentUpon>
</Compile>
<Compile Include="Panels\Exceptions\ExceptionForm.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Panels\Exe_Ops\BGProcs\BGProcsAdvSettings.Designer.vb">
<DependentUpon>BGProcsAdvSettings.vb</DependentUpon>
</Compile>
Expand Down Expand Up @@ -443,6 +450,12 @@
<Compile Include="Panels\Img_Ops\ImgCapture.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Panels\Img_Ops\ImgExport.Designer.vb">
<DependentUpon>ImgExport.vb</DependentUpon>
</Compile>
<Compile Include="Panels\Img_Ops\ImgExport.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Panels\Img_Ops\ImgIndexDelete.Designer.vb">
<DependentUpon>ImgIndexDelete.vb</DependentUpon>
</Compile>
Expand Down Expand Up @@ -712,6 +725,9 @@
<EmbeddedResource Include="Panels\DoWork\ProgressPanel.resx">
<DependentUpon>ProgressPanel.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Panels\Exceptions\ExceptionForm.resx">
<DependentUpon>ExceptionForm.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Panels\Exe_Ops\BGProcs\BGProcsAdvSettings.resx">
<DependentUpon>BGProcsAdvSettings.vb</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -838,6 +854,9 @@
<EmbeddedResource Include="Panels\Img_Ops\ImgCapture.resx">
<DependentUpon>ImgCapture.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Panels\Img_Ops\ImgExport.resx">
<DependentUpon>ImgExport.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Panels\Img_Ops\ImgIndexDelete.resx">
<DependentUpon>ImgIndexDelete.vb</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -1238,6 +1257,7 @@
<None Include="Resources\color_schemes\CS_Ops_Green.png" />
<None Include="Resources\color_schemes\CS_ProgressPanel_Blue.png" />
<None Include="Resources\color_schemes\CS_ProgressPanel_Green.png" />
<None Include="Resources\error_32px.png" />
<Content Include="ThemeVS2012\Resources\Dockindicator_PaneDiamond_Hotspot.png" />
<Content Include="ThemeVS2012\Resources\DockIndicator_PaneDiamond_HotspotIndex.png" />
<Content Include="ThemeVS2012\Resources\MaskArrowBottom.png" />
Expand Down
Binary file modified Installer/Output/dt_setup.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions Installer/dt.iss
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ Root: HKCU; Subkey: "Software\DISMTools\Preview\Startup"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\DISMTools\Preview\Startup"; ValueType: dword; ValueName: "CheckForUpdates"; ValueData: 1; Flags: uninsdeletevalue createvalueifdoesntexist
Root: HKCU; Subkey: "Software\DISMTools\Preview\Startup"; ValueType: dword; ValueName: "RemountImages"; ValueData: 1; Flags: uninsdeletevalue createvalueifdoesntexist

Root: HKCU; Subkey: "Software\DISMTools\Preview\Shutdown"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\DISMTools\Preview\Shutdown"; ValueType: dword; ValueName: "AutoCleanMounts"; ValueData: 0; Flags: uninsdeletevalue createvalueifdoesntexist

Root: HKCU; Subkey: "Software\DISMTools\Preview\WndParams"; Flags: uninsdeletekey createvalueifdoesntexist

Root: HKCU; Subkey: "Software\DISMTools\Preview\InfoSaver"; Flags: uninsdeletekey createvalueifdoesntexist
Expand Down
24 changes: 12 additions & 12 deletions MainForm.Designer.vb

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

12 changes: 12 additions & 0 deletions MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@
JCQkJEQxb97/AOrW4M1DfY/XAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>249, 17</value>
</metadata>
<metadata name="StatusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>356, 17</value>
</metadata>
<data name="Button24.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAABINJREFUWEft
Expand Down Expand Up @@ -812,6 +818,12 @@
<metadata name="ToolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>727, 17</value>
</metadata>
<metadata name="prjTreeStatus.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<metadata name="ToolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>727, 17</value>
</metadata>
<data name="RefreshViewTSB.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
Expand Down

0 comments on commit dd222d5

Please sign in to comment.