Skip to content

Commit d652191

Browse files
DISMTools 0.7.2 Preview 1 (#303)
* Italian language update (#294) * Italian language update (#296) * Italian language update (#298) * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Update HelpBrowserForm.vb Removed duplicate import --------- Co-authored-by: CodingWonders <[email protected]> * [Help] Update Italian wording * [WebSearch] Begin modularizing web searches * [Fix] Fixed absolute path issues (fixes #300) * Italian language update (#301) * Italian language update * Update MainForm.vb Remove duplicate import --------- Co-authored-by: CodingWonders <[email protected]> * [Fix] Fixed absolute path issues Reapplied * [Themes] New Tinted Color Themes * [Unattended answer file] Update UnattendGen * [InfoSaver] Rework AppX package count procedure * [InfoSaver] Add dark mode detection for HTML report * [PE Helper/HotInstall] DynaLog logging * [Help/Tour] Update Tour with Italian videos * [REL] Update What's New section --------- Co-authored-by: bovirus <[email protected]>
1 parent cc6e7d5 commit d652191

File tree

64 files changed

+1573
-1180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1573
-1180
lines changed

DISMTools.vbproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@
882882
<Compile Include="Utilities\ThemeUtilities\ColorTables\LightModeColorTable.vb" />
883883
<Compile Include="Utilities\ThemeUtilities\Theme.vb" />
884884
<Compile Include="Utilities\ThemeUtilities\ThemeHelper.vb" />
885+
<Compile Include="Utilities\WebSearchUtilities\SearchEngine.vb" />
886+
<Compile Include="Utilities\WebSearchUtilities\SearchEngineHelper.vb" />
885887
<Compile Include="Utilities\WindowHelper.vb" />
886888
<Compile Include="Utilities\WMIHelper.vb" />
887889
<Compile Include="Videos\Video.vb" />

Help/HelpBrowserForm.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Public Class HelpBrowserForm
2020
Case "PTB", "PTG"
2121
TitleMsg = "Tópicos de ajuda do DISMTools"
2222
Case "ITA"
23-
TitleMsg = "Argomenti della guida di DISMTools"
23+
TitleMsg = "Argomenti guida DISMTools"
2424
End Select
2525
Case 1
2626
TitleMsg = "DISMTools Help Topics"
@@ -31,7 +31,7 @@ Public Class HelpBrowserForm
3131
Case 4
3232
TitleMsg = "Tópicos de ajuda do DISMTools"
3333
Case 5
34-
TitleMsg = "Argomenti della guida di DISMTools"
34+
TitleMsg = "Argomenti guida di DISMTools"
3535
End Select
3636
Dim handle As IntPtr = MainForm.GetWindowHandle(Me)
3737
MainForm.EnableDarkTitleBar(handle, CurrentTheme.IsDark)
@@ -102,4 +102,4 @@ Public Class HelpBrowserForm
102102
If MainForm.IsWindowsVersionOrGreater(10, 0, 18362) Then MainForm.EnableDarkTitleBar(handle, CurrentTheme.IsDark)
103103
End If
104104
End Sub
105-
End Class
105+
End Class
3.98 KB
Binary file not shown.

Helpers/extps1/PE_Helper/tools/HotInstall/Installer/ApplicationEvents.vb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
Partial Friend Class MyApplication
1010

1111
Public Sub CatchEmAll(sender As Object, e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
12+
DynaLog.LogMessage("Unhandled exception occurred. Gotta catch'em all !")
13+
DynaLog.LogMessage("Exception information:")
14+
DynaLog.LogMessage("- Message: " & e.Exception.Message)
15+
DynaLog.LogMessage("- Code (HRESULT): " & Hex(e.Exception.HResult))
1216
' Gotta catch 'em all !
1317
Installer.MainForm.LogErrorMessage(e.Exception, InstallationStage.InstallerStage.Miscellaneous)
1418
Installer.MainForm.ChangePage(WizardPage.Page.FailurePage, True)

Helpers/extps1/PE_Helper/tools/HotInstall/Installer/DSC/DiskSpaceChecker.vb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ Public Class DiskSpaceChecker
1818
If DriveObjects Is Nothing Then
1919
Throw New Exception("A null-valued object collection has been passed for the drive report")
2020
End If
21+
DynaLog.LogMessage("Count of obtained disks: " & DriveObjects.Count)
2122
reportContents &= "Amount of local disks and partitions in the host system: " & DriveObjects.Count & CrLf & CrLf
2223
If DriveObjects.Count > 0 Then
24+
DynaLog.LogMessage("Saving obtained disks to report...")
2325
For Each DriveObject As ManagementObject In DriveObjects
2426
reportContents &= "Information for Disk " & GetObjectValue(DriveObject, "DiskIndex") & ", Partition " & (GetObjectValue(DriveObject, "Index") + 1) & CrLf &
2527
"- Drive total size: " & GetObjectValue(DriveObject, "Size") & " bytes (~" & Converters.BytesToReadableSize(GetObjectValue(DriveObject, "Size")) & ")" & CrLf &
@@ -40,14 +42,21 @@ Public Class DiskSpaceChecker
4042
Throw New Exception("No fixed drives have been passed")
4143
End If
4244

45+
DynaLog.LogMessage("Comparing spaces of images and drives...")
46+
DynaLog.LogMessage("- Count of images: " & ImageNames.Count)
47+
DynaLog.LogMessage("- Count of drives: " & Drives.Count)
48+
4349
reportContents &= "Comparison of sizes:" & CrLf & CrLf
4450

51+
DynaLog.LogMessage("Comparing spaces for drives...")
4552
For Each Drive As ManagementObject In Drives
4653
reportContents &= "- Disk, with volume label " & Quote & GetObjectValue(Drive, "VolumeName") & Quote & " (" & GetObjectValue(Drive, "DeviceID") & "):" & CrLf
4754
For Each ImageSize In ImageSizes
4855
If GetObjectValue(Drive, "Size") > ImageSize Then
56+
DynaLog.LogMessage("This image can be installed here.")
4957
reportContents &= " - " & Quote & ImageNames(ImageSizes.IndexOf(ImageSize)) & Quote & " (index " & ImageSizes.IndexOf(ImageSize) + 1 & ") can be installed on this disk because there is enough free space." & CrLf
5058
Else
59+
DynaLog.LogMessage("This image cannot be installed here.")
5160
reportContents &= " - " & Quote & ImageNames(ImageSizes.IndexOf(ImageSize)) & Quote & " (index " & ImageSizes.IndexOf(ImageSize) + 1 & ") cannot be installed on this disk because there is not enough free space." & CrLf
5261
End If
5362
Next
@@ -59,13 +68,17 @@ Public Class DiskSpaceChecker
5968
#End Region
6069

6170
Function GetDirectorySize(DirectoryName As String, ExcludedFile As String) As Long
71+
DynaLog.LogMessage("Getting the size of provided directory...")
72+
DynaLog.LogMessage("- Directory: " & DirectoryName)
73+
DynaLog.LogMessage("- File to exclude: " & ExcludedFile)
6274
Dim DirectorySize As Long = 0
6375
If Directory.Exists(DirectoryName) Then
6476
For Each FileInDir In Directory.GetFiles(DirectoryName, "*", SearchOption.AllDirectories)
6577
If Path.GetFileName(FileInDir).Equals(ExcludedFile, StringComparison.OrdinalIgnoreCase) Then Continue For
6678
DirectorySize += New FileInfo(FileInDir).Length
6779
Next
6880
End If
81+
DynaLog.LogMessage("Reported size: " & DirectorySize & " bytes")
6982
Return DirectorySize
7083
End Function
7184

@@ -76,9 +89,15 @@ Public Class DiskSpaceChecker
7689
End Sub
7790

7891
Sub ListFreeSpace(FreeSpace As Long, SpaceToCompare As Long, Optional SystemDriveMO As ManagementObject = Nothing)
92+
DynaLog.LogMessage("Listing free space in drive...")
93+
DynaLog.LogMessage("- Free space: " & FreeSpace)
94+
DynaLog.LogMessage("- Referenced space: " & SpaceToCompare)
7995
If SystemDriveMO IsNot Nothing Then
96+
DynaLog.LogMessage("System drive management object is something. We select the drive")
8097
reportContents &= "The system drive is mounted to " & GetObjectValue(SystemDriveMO, "DeviceID") & CrLf & CrLf
8198
End If
99+
100+
DynaLog.LogMessage("Saving information to report...")
82101
reportContents &= "Disc image files will be copied to the system drive shown above:" & CrLf &
83102
"- The total size of the disc image files is " & SpaceToCompare & " bytes (~" & Converters.BytesToReadableSize(SpaceToCompare) & ")" & CrLf &
84103
"- The free space on this drive is " & FreeSpace & " bytes (~" & Converters.BytesToReadableSize(FreeSpace) & ")" & CrLf & CrLf
@@ -96,6 +115,8 @@ Public Class DiskSpaceChecker
96115
End Sub
97116

98117
Sub SaveReport(Location As String)
118+
DynaLog.LogMessage("Saving DSC report...")
119+
DynaLog.LogMessage("- Destination: " & Location)
99120
Try
100121
File.WriteAllText(Location, reportContents, System.Text.Encoding.UTF8)
101122
Catch ex As Exception
@@ -104,29 +125,39 @@ Public Class DiskSpaceChecker
104125
End Sub
105126

106127
Sub GenerateDSCReport()
128+
DynaLog.LogMessage("Generating Disk Space Checker report...")
129+
DynaLog.LogMessage("Getting System Drives...")
107130
Dim SystemDrives As ManagementObjectCollection = GetResultsFromManagementQuery("SELECT * FROM Win32_LogicalDisk WHERE DriveType = 3") ' DriveType = 3 --> Local Disk
108131
If SystemDrives IsNot Nothing AndAlso SystemDrives.Count > 0 Then
132+
DynaLog.LogMessage("System drives were obtained. Listing...")
109133
' List the disks with a management query
110134
ListObtainedDisks(GetResultsFromManagementQuery("SELECT * FROM Win32_DiskPartition"))
111135

112136
' Get System Drive
137+
DynaLog.LogMessage("Getting System Boot Drive...")
113138
Dim SystemBootDrive As ManagementObjectCollection = GetResultsFromManagementQuery("SELECT * FROM Win32_LogicalDisk WHERE DriveType = 3 AND DeviceID LIKE " & Quote & Environment.GetEnvironmentVariable("HOMEDRIVE") & Quote)
114139
If SystemBootDrive IsNot Nothing Then
140+
DynaLog.LogMessage("Getting image file sizes and free spaces...")
115141
' We have grabbed the system boot drive
116142
progressMessage = GetValueFromLanguageData("DiskSpaceChecker.DSC_GetSizeOfImageFiles")
117143
BackgroundWorker1.ReportProgress(10)
118144
Dim FolderSize As Long = GetDirectorySize(sourcePath, "")
119145
' Get the free space of the system boot drive, since we'll copy the files there
120146
Dim FreeSpaceOnSystemDrive As Long = GetObjectValue(SystemBootDrive(0), "FreeSpace")
121147
ListFreeSpace(FreeSpaceOnSystemDrive, FolderSize, SystemBootDrive(0))
148+
DynaLog.LogMessage("Free space on system drive: " & FreeSpaceOnSystemDrive & " bytes")
149+
DynaLog.LogMessage("Folder Size: " & FolderSize & " bytes")
122150
If FreeSpaceOnSystemDrive < FolderSize Then
151+
DynaLog.LogMessage("Free space is lower than folder size.")
123152
Throw New Exception("There is not enough space to copy the disc image files to the system drive. Please free up some space and try again.")
124153
End If
125154
' Get information about the installation image and compare the expanded sizes of all indexes with the total space of all fixed drives
126155
progressMessage = GetValueFromLanguageData("DiskSpaceChecker.DSC_GetImageFileInfo")
127156
BackgroundWorker1.ReportProgress(40)
157+
DynaLog.LogMessage("Getting image information...")
128158
Dim imgInfoCollection As DismImageInfoCollection = GetImageInformation(Path.Combine(sourcePath, "sources", "install.wim"))
129159
If imgInfoCollection IsNot Nothing Then
160+
DynaLog.LogMessage("Getting image names and sizes...")
130161
progressMessage = GetValueFromLanguageData("DiskSpaceChecker.DSC_GetImageNamesAndSizes")
131162
BackgroundWorker1.ReportProgress(60)
132163
' Grab the image names and expanded sizes
@@ -138,6 +169,7 @@ Public Class DiskSpaceChecker
138169
Next
139170
progressMessage = GetValueFromLanguageData("DiskSpaceChecker.DSC_CompareSizes")
140171
BackgroundWorker1.ReportProgress(80)
172+
DynaLog.LogMessage("Comparing spaces...")
141173
ListSpaceComparison(ImageNames, ImageSizes, SystemDrives)
142174
End If
143175
End If
@@ -147,15 +179,19 @@ Public Class DiskSpaceChecker
147179
End Sub
148180

149181
Function GetImageInformation(ImagePath As String) As DismImageInfoCollection
182+
DynaLog.LogMessage("Getting Windows image information...")
183+
DynaLog.LogMessage("- Image Path: " & ImagePath)
150184
Dim imgInfoCollection As DismImageInfoCollection = Nothing
151185
Try
152186
If ImagePath <> "" AndAlso File.Exists(ImagePath) Then
187+
DynaLog.LogMessage("Preparing to initialize API and get image info")
153188
DismApi.Initialize(DismLogLevel.LogErrors)
154189
imgInfoCollection = DismApi.GetImageInfo(Path.Combine(sourcePath, "sources", "install.wim"))
155190
End If
156191
Catch ex As Exception
157192
Throw ex
158193
Finally
194+
DynaLog.LogMessage("Shutting down API...")
159195
Try
160196
DismApi.Shutdown()
161197
Catch ex As Exception

Helpers/extps1/PE_Helper/tools/HotInstall/Installer/HotInstall.vbproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@
123123
<DependentUpon>Settings.settings</DependentUpon>
124124
<DesignTimeSharedInput>True</DesignTimeSharedInput>
125125
</Compile>
126+
<Compile Include="Util\BuildGetter.vb" />
126127
<Compile Include="Util\Casters.vb" />
127128
<Compile Include="Util\Converters.vb" />
128129
<Compile Include="Util\DriverHelper.vb" />
130+
<Compile Include="Util\DynaLog.vb" />
129131
<Compile Include="Util\LanguageFileParser.vb" />
130132
<Compile Include="Util\NativeMethods.vb" />
131133
<Compile Include="Util\Utilities.vb" />

0 commit comments

Comments
 (0)