Skip to content

Commit

Permalink
Last changes for DISMTools 0.5 (#132)
Browse files Browse the repository at this point in the history
* DISMTools Nightly Installer

* Update assembly information and nightly installer links

* DISMTools Nightly Installer

* Fixed buggy representation of bytes for capability information

* DISMTools Nightly Installer

* Added possible command-line fix for AppX package addition with license files

* DISMTools Nightly Installer

* Update README.md

Updated OS installer resource

* DISMTools Nightly Installer

* Fixed issue when appending entire drives

* DISMTools Nightly Installer

* Update Help documentation contents to reflect version 0.5

* DISMTools Nightly Installer

* DISMTools Help Documentation updates (2024/06/14)

* DISMTools Nightly Installer

* Do not show empty DocTitle string after clicking external links

* DISMTools Nightly Installer

* Fixed DocTitle issue (Part 2)

* DISMTools Nightly Installer

* DISMTools Help Documentation updates (2024/06/15)

* DISMTools Nightly Installer

* Added detections for remaining background process tasks to avoid DISM API errors on WinPE images

* DISMTools Nightly Installer

* Added localization to API error dialog

* DISMTools Nightly Installer

* Refined version detection for /Region argument of AppX package addition

* DISMTools Nightly Installer

* DISMTools Help Documentation updates (2024/06/20)

* DISMTools Nightly Installer

* Update READMEs

* Replace "Server vNext" with "Server 2025"

* DISMTools Nightly Installer

* Display error codes in Hex

* DISMTools Nightly Installer

* Update link colors to reflect 0.5 color scheme

* DISMTools Nightly Installer

* Updated What's New section

* DISMTools Nightly Installer

---------

Co-authored-by: CodingWonders <[email protected]>
  • Loading branch information
CodingWonders and CodingWonders authored Jun 23, 2024
1 parent 602aea9 commit 4478fdc
Show file tree
Hide file tree
Showing 82 changed files with 2,056 additions and 128 deletions.
2 changes: 1 addition & 1 deletion ApplicationEvents.vb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Namespace My
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
"Error Code (HRESULT): " & Hex(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
Expand Down
8 changes: 7 additions & 1 deletion Help/HelpBrowserForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Public Class HelpBrowserForm

Dim TitleMsg As String = ""
Dim CurrentSite As String = ""
Dim DocTitle As String = ""

Private Sub HelpBrowserForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Select Case MainForm.Language
Expand Down Expand Up @@ -39,7 +40,12 @@ Public Class HelpBrowserForm
Process.Start(e.Url.AbsoluteUri)
WebBrowser1.Navigate(CurrentSite)
End If
Text = WebBrowser1.DocumentTitle & " - " & TitleMsg
If WebBrowser1.DocumentTitle = "" Then
Text = DocTitle & " - " & TitleMsg
Else
Text = WebBrowser1.DocumentTitle & " - " & TitleMsg
If e.Url.AbsoluteUri.StartsWith("file:///") Then DocTitle = WebBrowser1.DocumentTitle
End If
CurrentSite = e.Url.AbsoluteUri
End Sub

Expand Down
1 change: 1 addition & 0 deletions Helpers/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ We can provide a short description of all scripts in this directory:
| `extbatch\options.bat` | (Functionality _to be added_) Options script that configures the Command Console |
| `extps1\extappx.ps1` | The Extended AppX package getter script, which is run when managing online installations |
| `extps1\mImgMgr.ps1` | The CLI version of the mounted image manager, which lets you manage your mounted Windows images |
| `extps1\PE_Helper\PE_Helper.ps1` | The DISMTools Preinstallation Environment (PE) Helper |

This list of scripts will be updated as we add new scripts in this directory.

Expand Down
Binary file modified Installer/Nightly/dt_setup.exe
Binary file not shown.
20 changes: 10 additions & 10 deletions MainForm.Designer.vb

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

114 changes: 94 additions & 20 deletions MainForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Public Class MainForm
Public isSqlServerDTProj As Boolean

' Set branch name and codenames
Public dtBranch As String = "dt_preview"
Public dtBranch As String = "dt_preview_relcndid"
Public dt_codeName As String = "DTV"

' Arrays and other variables used on background processes
Expand Down Expand Up @@ -2382,13 +2382,27 @@ Public Class MainForm
ImgBW.ReportProgress(99)
If PendingTasks(0) Then GetImagePackages(True, OnlineMode)
If PendingTasks(1) Then GetImageFeatures(True, OnlineMode)
If PendingTasks(2) Then GetImageAppxPackages(True, OnlineMode)
If PendingTasks(3) Then GetImageCapabilities(True, OnlineMode)
If PendingTasks(2) Then
If imgEdition Is Nothing Then imgEdition = ""
If IsWindows8OrHigher(MountDir & "\Windows\system32\ntoskrnl.exe") Then
If Not imgEdition.Equals("WindowsPE", StringComparison.OrdinalIgnoreCase) And Not (imgInstType.Contains("Nano") Or imgInstType.Contains("Core")) Then
GetImageAppxPackages(True, OnlineMode)
End If
End If
End If
If PendingTasks(3) Then
If imgEdition Is Nothing Then imgEdition = ""
If IsWindows10OrHigher(MountDir & "\Windows\system32\ntoskrnl.exe") And Not imgEdition.Equals("WindowsPE", StringComparison.OrdinalIgnoreCase) Then
If Not imgEdition.Equals("WindowsPE", StringComparison.OrdinalIgnoreCase) And Not imgInstType.Contains("Nano") Then
GetImageCapabilities(True, OnlineMode)
End If
End If
End If
If PendingTasks(4) Then GetImageDrivers(True, OnlineMode)
End If
DeleteTempFiles()
If UseApi And session IsNot Nothing Then
DismApi.CloseSession(session)
DeleteTempFiles()
If UseApi And session IsNot Nothing Then
DismApi.CloseSession(session)
End If
End If
End Sub

Expand Down Expand Up @@ -3633,18 +3647,70 @@ Public Class MainForm
Return False
End Function

Public Event APIExceptionThrown(errorEx As Exception)
Public Event APIExceptionThrown(errorEx As Exception, windowTitle As String)

Private Sub APIExceptionHandler(errorEx As Exception) Handles Me.APIExceptionThrown
MsgBox(errorEx.Message, vbOKOnly + vbExclamation, "API error")
Private Sub APIExceptionHandler(errorEx As Exception, windowTitle As String) Handles Me.APIExceptionThrown
MsgBox(errorEx.Message, vbOKOnly + vbExclamation, windowTitle)
End Sub

Sub ThrowAPIException(APIException As DismException)
Dim errorEx As New Exception("An error occurred while getting information with the DISM API. Consider reading the message below for more information:" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"This does not indicate a program error, but it implies that you will not be able to perform some operations unless the issue is resolved." & CrLf & CrLf &
"Error code: " & Hex(APIException.HResult), APIException)
RaiseEvent APIExceptionThrown(errorEx)
Dim errorMsg As String = ""
Dim wndTitle As String = ""
Select Case Language
Case 0
Select Case My.Computer.Info.InstalledUICulture.ThreeLetterWindowsLanguageName
Case "ENU", "ENG"
wndTitle = "API error"
errorMsg = "An error occurred while getting information with the DISM API. Consider reading the message below for more information:" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"This does not indicate a program error, but it implies that you will not be able to perform some operations unless the issue is resolved." & CrLf & CrLf &
"Error code: " & Hex(APIException.HResult)
Case "ESN"
wndTitle = "Error de la API"
errorMsg = "Se produjo un error al obtener información con la API de DISM. Considere leer el mensaje de abajo para más información:" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"Esto no indica un error del programa, pero implica que no podrá realizar algunas operaciones a menos que el error sea resuelto." & CrLf & CrLf &
"Código de error: " & Hex(APIException.HResult)
Case "FRA"
wndTitle = "Erreur API"
errorMsg = "Une erreur s'est produite lors de l'obtention d'informations avec l'API DISM. Veuillez lire le message ci-dessous pour plus d'informations :" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"Ceci n'indique pas une erreur de programme, mais implique que vous ne pourrez pas effectuer certaines opérations tant que le problème n'aura pas été résolu." & CrLf & CrLf &
"Code d'erreur : " & Hex(APIException.HResult)
Case "PTB"
wndTitle = "Erro da API"
errorMsg = "Ocorreu um erro ao obter informações com a API DISM. Considere ler a mensagem abaixo para obter mais informações:" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"Isto não indica um erro de programa, mas implica que não poderá efetuar algumas operações a menos que o problema seja resolvido." & CrLf & CrLf &
"Código de erro: " & Hex(APIException.HResult)
End Select
Case 1
wndTitle = "API error"
errorMsg = "An error occurred while getting information with the DISM API. Consider reading the message below for more information:" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"This does not indicate a program error, but it implies that you will not be able to perform some operations unless the issue is resolved." & CrLf & CrLf &
"Error code: " & Hex(APIException.HResult)
Case 2
wndTitle = "Error de la API"
errorMsg = "Se produjo un error al obtener información con la API de DISM. Considere leer el mensaje de abajo para más información:" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"Esto no indica un error del programa, pero implica que no podrá realizar algunas operaciones a menos que el error sea resuelto." & CrLf & CrLf &
"Código de error: " & Hex(APIException.HResult)
Case 3
wndTitle = "Erreur API"
errorMsg = "Une erreur s'est produite lors de l'obtention d'informations avec l'API DISM. Veuillez lire le message ci-dessous pour plus d'informations :" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"Ceci n'indique pas une erreur de programme, mais implique que vous ne pourrez pas effectuer certaines opérations tant que le problème n'aura pas été résolu." & CrLf & CrLf &
"Code d'erreur : " & Hex(APIException.HResult)
Case 4
wndTitle = "Erro da API"
errorMsg = "Ocorreu um erro ao obter informações com a API DISM. Considere ler a mensagem abaixo para obter mais informações:" & CrLf & CrLf &
APIException.Message & CrLf & CrLf &
"Isto não indica um erro de programa, mas implica que não poderá efetuar algumas operações a menos que o problema seja resolvido." & CrLf & CrLf &
"Código de erro: " & Hex(APIException.HResult)
End Select
Dim errorEx As New Exception(errorMsg, APIException)
RaiseEvent APIExceptionThrown(errorEx, wndTitle)
End Sub

''' <summary>
Expand Down Expand Up @@ -17003,7 +17069,11 @@ Public Class MainForm
Cursor = Cursors.Arrow
Exit Sub
Else
LinkLabel12.LinkColor = Color.FromArgb(0, 151, 251)
If BackColor = Color.FromArgb(48, 48, 48) Then
LinkLabel12.LinkColor = Color.FromArgb(0, 251, 99)
Else
LinkLabel12.LinkColor = Color.FromArgb(0, 123, 48)
End If
End If
End Sub

Expand All @@ -17012,7 +17082,11 @@ Public Class MainForm
Cursor = Cursors.Arrow
Exit Sub
Else
LinkLabel13.LinkColor = Color.FromArgb(0, 151, 251)
If BackColor = Color.FromArgb(48, 48, 48) Then
LinkLabel13.LinkColor = Color.FromArgb(0, 251, 99)
Else
LinkLabel13.LinkColor = Color.FromArgb(0, 123, 48)
End If
End If
End Sub

Expand Down Expand Up @@ -17129,7 +17203,7 @@ Public Class MainForm
Cursor = Cursors.Arrow
Exit Sub
Else
LinkLabel22.LinkColor = Color.FromArgb(0, 151, 251)
LinkLabel22.LinkColor = Color.FromArgb(0, 123, 48)
End If
End Sub

Expand All @@ -17150,7 +17224,7 @@ Public Class MainForm
Cursor = Cursors.Arrow
Exit Sub
Else
LinkLabel23.LinkColor = Color.FromArgb(0, 151, 251)
LinkLabel23.LinkColor = Color.FromArgb(0, 123, 48)
End If
End Sub

Expand All @@ -17171,7 +17245,7 @@ Public Class MainForm
Cursor = Cursors.Arrow
Exit Sub
Else
LinkLabel24.LinkColor = Color.FromArgb(0, 151, 251)
LinkLabel24.LinkColor = Color.FromArgb(0, 123, 48)
End If
End Sub

Expand Down
4 changes: 2 additions & 2 deletions My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' mediante el asterisco ('*'), como se muestra a continuación:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("0.5.0.2461")>
<Assembly: AssemblyFileVersion("0.5.0.2461")>
<Assembly: AssemblyVersion("0.5.0.2462")>
<Assembly: AssemblyFileVersion("0.5.0.2462")>
Loading

0 comments on commit 4478fdc

Please sign in to comment.