Skip to content

Commit

Permalink
Merge pull request #22 from CodingWonders/dt_rel_0.3
Browse files Browse the repository at this point in the history
DISMTools 0.3 Update 1
  • Loading branch information
CodingWonders authored Aug 5, 2023
2 parents 340581d + 2df9b7d commit 04f8628
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 32 deletions.
Binary file modified Installer/Output/dt_setup.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions MainForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ Public Class MainForm
Else
For Each arg In args
If arg.StartsWith("/setup", StringComparison.OrdinalIgnoreCase) Then
SplashScreen.Hide()
PrgSetup.ShowDialog()
ElseIf arg.StartsWith("/load", StringComparison.OrdinalIgnoreCase) Then
If File.Exists(arg.Replace("/load=", "").Trim()) And Directory.Exists(Path.GetDirectoryName(arg.Replace("/load=", "").Trim())) Then
Expand Down Expand Up @@ -318,6 +319,7 @@ Public Class MainForm
Else
'GenerateDTSettings()
'LoadDTSettings(1)
SplashScreen.Hide()
PrgSetup.ShowDialog()
LoadDTSettings(1)
End If
Expand Down Expand Up @@ -3669,6 +3671,7 @@ Public Class MainForm
End If
Else
' Show setup window
SplashScreen.Hide()
PrgSetup.ShowDialog()
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.3.0.2375")>
<Assembly: AssemblyFileVersion("0.3.0.2375")>
<Assembly: AssemblyVersion("0.3.0.2381")>
<Assembly: AssemblyFileVersion("0.3.0.2381")>
53 changes: 27 additions & 26 deletions Panels/DoWork/ProgressPanel.vb
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ Public Class ProgressPanel

Sub RunOps(opNum As Integer)
If DismProgram = "" Then DismProgram = MainForm.DismExe
If Not File.Exists(DismProgram) Then DismProgram = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DismVersionChecker = FileVersionInfo.GetVersionInfo(DismProgram)
CurrentPB.Value = 0
PkgErrorText.RichTextBox1.Clear()
Expand Down Expand Up @@ -787,7 +788,7 @@ Public Class ProgressPanel
"- Source image file: " & ApplicationSourceImg & CrLf & _
"- Index to apply: " & ApplicationIndex & CrLf & _
"- Target directory: " & ApplicationDestDir & CrLf)
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -903,7 +904,7 @@ Public Class ProgressPanel
"- Source directory: " & CaptureSourceDir & CrLf &
"- Destination image: " & CaptureDestinationImage & CrLf &
"- Captured image name: " & CaptureName & CrLf)
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -1040,7 +1041,7 @@ Public Class ProgressPanel
LogView.AppendText(CrLf & "Saving changes..." & CrLf & "Options:" & CrLf &
"- Mount directory: " & MountDir)

DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -1142,7 +1143,7 @@ Public Class ProgressPanel
End Select
LogView.AppendText(CrLf & _
"- " & imgIndexDeletionNames(x) & "...")
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs = "/logpath=" & Quote & Application.StartupPath & "\logs\" & GetCurrentDateAndTime(Now) & Quote & " /english /delete-image /imagefile=" & Quote & imgIndexDeletionSourceImg & Quote & " /name=" & Quote & imgIndexDeletionNames(x) & Quote
If imgIndexDeletionIntCheck Then
CommandArgs &= " /checkintegrity"
Expand Down Expand Up @@ -1218,7 +1219,7 @@ Public Class ProgressPanel
"- Image file: " & SourceImg & CrLf &
"- Image index: " & ImgIndex & CrLf &
"- Mount point: " & MountDir)
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -1357,7 +1358,7 @@ Public Class ProgressPanel
LogView.AppendText(CrLf & "- Unmount operation: Commit")
' Commit the image and unmount it
Try
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand All @@ -1375,7 +1376,7 @@ Public Class ProgressPanel
If DISMProc.ExitCode = Decimal.ToInt32(-1052638964) Then
LogView.AppendText(CrLf & CrLf & "Saving changes to the image has failed. Discarding changes...")
' It mostly came from a read-only source. Discard changes
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -1420,7 +1421,7 @@ Public Class ProgressPanel
End If
Else
Try
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -1578,7 +1579,7 @@ Public Class ProgressPanel
LogView.AppendText(CrLf & CrLf &
"Processing " & pkgCount & " packages..." & CrLf)
If pkgAdditionOp = 0 Then
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /add-package /packagepath=" & Quote & pkgSource & Quote
If pkgIgnoreApplicabilityChecks Then
CommandArgs &= " /ignorecheck"
Expand Down Expand Up @@ -1680,7 +1681,7 @@ Public Class ProgressPanel
End Try
If Not pkgIsApplicable Or pkgIsInstalled Then Continue For
LogView.AppendText(CrLf & "Processing package...")
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /add-package /packagepath=" & Quote & pkgs(x) & Quote
If pkgIgnoreApplicabilityChecks Then
CommandArgs &= " /ignorecheck"
Expand Down Expand Up @@ -1817,7 +1818,7 @@ Public Class ProgressPanel
End Try
If pkgIsReadyForRemoval Then
LogView.AppendText(CrLf & "Processing package removal...")
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /remove-package /packagename=" & pkgRemovalNames(x)
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
Expand Down Expand Up @@ -1899,7 +1900,7 @@ Public Class ProgressPanel
End Try
If pkgIsReadyForRemoval Then
LogView.AppendText(CrLf & "Processing package removal...")
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /remove-package /packagepath=" & pkgRemovalFiles(x)
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
Expand Down Expand Up @@ -2011,7 +2012,7 @@ Public Class ProgressPanel
Thread.Sleep(500)
LogView.AppendText(CrLf & "Total number of features to enable: " & featEnablementCount)
' Get command ready
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case Language
Case 0
Select Case My.Computer.Info.InstalledUICulture.ThreeLetterWindowsLanguageName
Expand Down Expand Up @@ -2151,7 +2152,7 @@ Public Class ProgressPanel
Thread.Sleep(500)
LogView.AppendText(CrLf & "Total number of features to disable: " & featDisablementCount)
' Get command ready
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case Language
Case 0
Select Case My.Computer.Info.InstalledUICulture.ThreeLetterWindowsLanguageName
Expand Down Expand Up @@ -2260,7 +2261,7 @@ Public Class ProgressPanel
allTasks.Text = "Limpiando la imagen..."
End Select
' Initialize command
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /cleanup-image"
Select Case CleanupTask
Case 0
Expand Down Expand Up @@ -2438,7 +2439,7 @@ Public Class ProgressPanel
"- Provisioning package: " & Quote & ppkgAdditionPackagePath & Quote & CrLf & _
"- Catalog file: " & If(ppkgAdditionCatalogPath = "", "none specified", Quote & ppkgAdditionCatalogPath & Quote) & CrLf & _
"- Commit image after adding provisioning package? " & If(ppkgAdditionCommit, "Yes", "No"))
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /add-provisioningpackage /packagepath=" & Quote & ppkgAdditionPackagePath & Quote & If(ppkgAdditionCatalogPath <> "" And File.Exists(ppkgAdditionCatalogPath), " /catalogpath=" & Quote & ppkgAdditionCatalogPath & Quote, "")
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
Expand Down Expand Up @@ -2563,7 +2564,7 @@ Public Class ProgressPanel
ScanAppxPackage(False, appxAdditionPackages(x))
End If
' Initialize command
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /add-provisionedappxpackage "
If File.GetAttributes(appxAdditionPackages(x)) = FileAttributes.Directory Then
CommandArgs &= "/folderpath=" & Quote & appxAdditionPackages(x) & Quote
Expand Down Expand Up @@ -2757,7 +2758,7 @@ Public Class ProgressPanel
' Initialize command. Its syntax is simple, so don't spend too much time determining options
LogView.AppendText(CrLf & CrLf & _
"Processing package...")
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /remove-provisionedappxpackage /packagename=" & appxRemovalPackages(x)
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
Expand Down Expand Up @@ -2886,7 +2887,7 @@ Public Class ProgressPanel
CommandArgs &= " /source=" & Quote & capAdditionSource & Quote
End If
If capAdditionLimitWUAccess And OnlineMgmt Then CommandArgs &= " /limitaccess"
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
DISMProc.WaitForExit()
Expand Down Expand Up @@ -3010,7 +3011,7 @@ Public Class ProgressPanel
Finally
DismApi.Shutdown()
End Try
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /remove-capability /capabilityname=" & capRemovalIds(x)
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
Expand Down Expand Up @@ -3141,7 +3142,7 @@ Public Class ProgressPanel
LogView.AppendText(CrLf & CrLf & _
"The driver package currently about to be processed is a folder, so information about it can't be obtained. Proceeding anyway...")
End If
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /add-driver /driver=" & Quote & drvAdditionPkgs(x) & Quote
If drvAdditionForceUnsigned Then
CommandArgs &= " /forceunsigned"
Expand Down Expand Up @@ -3301,7 +3302,7 @@ Public Class ProgressPanel
Finally
DismApi.Shutdown()
End Try
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & Quote & MountDir & Quote) & " /remove-driver /driver=" & Quote & drvRemovalPkgs(x) & Quote
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
Expand Down Expand Up @@ -3348,7 +3349,7 @@ Public Class ProgressPanel
currentTask.Text = "Setting the amount of days an uninstall can happen..."
LogView.AppendText(CrLf & "Setting the amount of days an uninstall can happen..." & CrLf &
"Number of days: " & osUninstDayCount)
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
CommandArgs = "/logpath=" & Quote & Application.StartupPath & "\logs\" & GetCurrentDateAndTime(Now) & Quote & " /english /online /set-osuninstallwindow /value:" & osUninstDayCount
DISMProc.StartInfo.Arguments = CommandArgs
DISMProc.Start()
Expand Down Expand Up @@ -3393,7 +3394,7 @@ Public Class ProgressPanel
End If

' Run commands
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -3458,7 +3459,7 @@ Public Class ProgressPanel
"- Destination image file: " & imgWimDestination & CrLf)

' Run commands
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down Expand Up @@ -3523,7 +3524,7 @@ Public Class ProgressPanel
LogView.AppendText(CrLf & "- Commit source index? No")
End If
' Run commands
DISMProc.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\system32\dism.exe"
DISMProc.StartInfo.FileName = DismProgram
Select Case DismVersionChecker.ProductMajorPart
Case 6
Select Case DismVersionChecker.ProductMinorPart
Expand Down
4 changes: 2 additions & 2 deletions Updater/DISMTools-UCS/update-bin/stable.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Version]
LatestVer = 0.3.0.2375
ReleaseTag = v0.3_stable
LatestVer = 0.3.0.2381
ReleaseTag = v0.3_upd1

[Options]
MigrateSettings = False
Binary file modified Updater/DISMTools-UCS/update-bin/update.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions Updater/DISMTools-UCS/verinfo/stable.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Version]
LatestVer = 0.3.0.2375
ReleaseTag = v0.3_stable
LatestVer = 0.3.0.2381
ReleaseTag = v0.3_upd1

[Options]
MigrateSettings = False

0 comments on commit 04f8628

Please sign in to comment.