Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DISMTools 0.5 Preview 8 (Beta 4) #131

Merged
merged 39 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5afbbf1
DISMTools Nightly Installer
CodingWonders May 25, 2024
3daca3f
Update assembly information
CodingWonders May 25, 2024
069b981
DISMTools Nightly Installer
CodingWonders May 25, 2024
c1b9791
Fix exception in script if no images are mounted
CodingWonders May 25, 2024
f33b033
DISMTools Nightly Installer
CodingWonders May 25, 2024
4337ebb
Initial updater improvements
CodingWonders May 26, 2024
65ff376
DISMTools Nightly Installer
CodingWonders May 26, 2024
3269b0d
Make paths more inclusive
CodingWonders May 26, 2024
5f640f7
DISMTools Nightly Installer
CodingWonders May 26, 2024
40cdd77
Update 7-Zip to version 24.05
CodingWonders May 26, 2024
29fb84f
DISMTools Nightly Installer
CodingWonders May 26, 2024
429a96e
Create temporary directory to remove DISM serviceability warning
CodingWonders May 26, 2024
5727f52
DISMTools Nightly Installer
CodingWonders May 26, 2024
26192e7
Added more checks to determine correct disk
CodingWonders May 27, 2024
fd8c12f
DISMTools Nightly Installer
CodingWonders May 27, 2024
cc9f07c
Show download error and save using correct extension
CodingWonders May 28, 2024
5c0dea3
DISMTools Nightly Installer
CodingWonders May 28, 2024
c54c598
Add story behind this project and another key feature
CodingWonders May 28, 2024
db72a93
DISMTools Nightly Installer
CodingWonders May 28, 2024
2407c5f
Updated 7-Zip to version 24.06
CodingWonders May 30, 2024
293f6ce
DISMTools Nightly Installer
CodingWonders May 30, 2024
e18bbb8
Don't show empty values if no custom properties are selected
CodingWonders May 30, 2024
da77182
DISMTools Nightly Installer
CodingWonders May 30, 2024
eabcbcd
Improve reliability of App Installer package addition
CodingWonders May 31, 2024
c6232fa
DISMTools Nightly Installer
CodingWonders May 31, 2024
cc9741b
Update pagefile location
CodingWonders Jun 1, 2024
f15a96f
DISMTools Nightly Installer
CodingWonders Jun 1, 2024
83c1566
Don't show human-readable size representation if bytes < 1024
CodingWonders Jun 1, 2024
803109d
DISMTools Nightly Installer
CodingWonders Jun 1, 2024
1b89039
Update README.md
CodingWonders Jun 1, 2024
d92d1f5
DISMTools Nightly Installer
CodingWonders Jun 1, 2024
8013bd0
Fix image path issue for DISM commands
CodingWonders Jun 1, 2024
d395414
DISMTools Nightly Installer
CodingWonders Jun 1, 2024
8340e15
Remove remaining $DISMTOOLS.~LS folder
CodingWonders Jun 4, 2024
76f3b68
DISMTools Nightly Installer
CodingWonders Jun 4, 2024
ec125b6
Detect and show DISM API errors
CodingWonders Jun 4, 2024
fbb1f7e
DISMTools Nightly Installer
CodingWonders Jun 4, 2024
c1dce09
Update What's New section and new Update System files
CodingWonders Jun 8, 2024
361e54c
DISMTools Nightly Installer
CodingWonders Jun 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified 7z/amd64/7z.dll
Binary file not shown.
Binary file modified 7z/amd64/7z.exe
Binary file not shown.
Binary file modified 7z/i386/7z.dll
Binary file not shown.
Binary file modified 7z/i386/7z.exe
Binary file not shown.
36 changes: 31 additions & 5 deletions Helpers/extps1/PE_Helper/PE_Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ function Start-OSApplication
} until ($driveLetter -ne "")
}
}
wpeutil createpagefile /path="$($driveLetter):\pagefile.sys" /size=256
wpeutil createpagefile /path="$($driveLetter):\WinPEpge.sys" /size=256
$wimFile = Get-WimIndexes
$serviceableArchitecture = (((Get-CimInstance -Class Win32_Processor | Where-Object { $_.DeviceID -eq "CPU0" }).Architecture) -eq (Get-WindowsImage -ImagePath "$($wimFile.wimPath)" -Index $wimFile.index).Architecture)
Write-Host "Applying Windows image. This can take some time..."
Expand Down Expand Up @@ -1038,8 +1038,28 @@ function Set-Serviceability
[Parameter(Mandatory = $true, Position = 0)] [string] $ImagePath
)
Write-Host "Starting serviceability tests..."
# Bit of a mouthful, but good for PowerShell verbs
dism /image=$ImagePath /is-serviceable
# Follow Panther engine steps (https://github.com/CodingWonders/Panther-Diagram)
Write-Host "Creating temporary directory for serviceability operations..."
$scratchDir = ""
$driveLetter = ""
try
{
$folderPath = $ImagePath.Replace("\", "").Trim()
$driveLetter = $folderPath
if (-not (Test-Path "$folderPath\`$DISMTOOLS.~LS")) { New-Item -Path "$folderPath\`$DISMTOOLS.~LS" -ItemType Directory | Out-Null }
$guidStr = [System.Guid]::NewGuid().Guid
New-Item -Path "$folderPath\`$DISMTOOLS.~LS\PackageTemp\$guidStr" -ItemType Directory | Out-Null
Write-Host "Successfully created the scratch directory."
$scratchDir = "$folderPath\`$DISMTOOLS.~LS\PackageTemp\$guidStr"
# Bit of a mouthful, but good for PowerShell verbs (+ scratch dir support)
dism /image=$ImagePath /scratchdir="$scratchDir" /is-serviceable
}
catch
{
Write-Host "Could not create temporary directory. Continuing without one. Do note that the serviceability tests might fail."
# Bit of a mouthful, but good for PowerShell verbs
dism /image=$ImagePath /is-serviceable
}
if ($?)
{
Write-Host "Serviceability tests have succeeded. The image is valid."
Expand All @@ -1048,6 +1068,12 @@ function Set-Serviceability
{
Write-Host "Serviceability tests have failed. The image is not valid."
}
if (($scratchDir -ne "") -and (Test-Path -Path "$scratchDir"))
{
Write-Host "Removing temporary directory..."
Remove-Item -Path "$scratchDir" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path "$driveLetter\`$DISMTOOLS.~LS" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
}
}

function New-BootFiles
Expand Down Expand Up @@ -1081,7 +1107,7 @@ function New-BootFiles
{
foreach ($disk in $(Get-CimInstance -ClassName Win32_DiskPartition))
{
if ($disk.BootPartition)
if (($disk.DiskIndex -eq $diskId) -and ($disk.BootPartition))
{
$MSRAssign = @'
sel dis #DISKID#
Expand Down Expand Up @@ -1112,7 +1138,7 @@ function New-BootFiles
{
foreach ($disk in $(Get-CimInstance -ClassName Win32_DiskPartition))
{
if ($disk.BootPartition)
if (($disk.DiskIndex -eq $diskId) -and ($disk.BootPartition))
{
$MSRAssign = @'
sel dis #DISKID#
Expand Down
2 changes: 1 addition & 1 deletion Helpers/extps1/mImgMgr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Get-MenuItems
#>
param (
[Parameter(Mandatory = $true, Position = 0)] [int] $selImage,
[Parameter(Mandatory = $true, Position = 1)] [Object[]] $mountedImages
[Parameter(Position = 1)] [Object[]] $mountedImages
)
try
{
Expand Down
Binary file modified Installer/Nightly/dt_setup.exe
Binary file not shown.
24 changes: 24 additions & 0 deletions MainForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3633,6 +3633,20 @@ Public Class MainForm
Return False
End Function

Public Event APIExceptionThrown(errorEx As Exception)

Private Sub APIExceptionHandler(errorEx As Exception) Handles Me.APIExceptionThrown
MsgBox(errorEx.Message, vbOKOnly + vbExclamation, "API error")
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)
End Sub

''' <summary>
''' Gets installed packages in an image and puts them in separate arrays
''' </summary>
Expand Down Expand Up @@ -3664,6 +3678,8 @@ Public Class MainForm
imgPackageRelType = imgPackageRelTypeList.ToArray()
imgPackageInstTime = imgPackageInstTimeList.ToArray()
End Using
Catch ex As DismException
ThrowAPIException(ex)
Finally
DismApi.Shutdown()
End Try
Expand Down Expand Up @@ -3827,6 +3843,8 @@ Public Class MainForm
imgFeatureNames = imgFeatureNameList.ToArray()
imgFeatureState = imgFeatureStateList.ToArray()
End Using
Catch ex As DismException
ThrowAPIException(ex)
Finally
DismApi.Shutdown()
End Try
Expand Down Expand Up @@ -4011,6 +4029,8 @@ Public Class MainForm
imgAppxResourceIds = imgAppxResourceIdList.ToArray()
imgAppxVersions = imgAppxVersionList.ToArray()
End Using
Catch ex As DismException
ThrowAPIException(ex)
Finally
DismApi.Shutdown()
End Try
Expand Down Expand Up @@ -4246,6 +4266,8 @@ Public Class MainForm
imgCapabilityIds = imgCapabilityNameList.ToArray()
imgCapabilityState = imgCapabilityStateList.ToArray()
End Using
Catch ex As DismException
ThrowAPIException(ex)
Finally
DismApi.Shutdown()
End Try
Expand Down Expand Up @@ -4413,6 +4435,8 @@ Public Class MainForm
imgDrvVersions = imgDrvVersionList.ToArray()
imgDrvBootCriticalStatus = imgDrvBootCriticalStatusList.ToArray()
End Using
Catch ex As DismException
ThrowAPIException(ex)
Finally
DismApi.Shutdown()
End Try
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.2452")>
<Assembly: AssemblyFileVersion("0.5.0.2452")>
<Assembly: AssemblyVersion("0.5.0.2461")>
<Assembly: AssemblyFileVersion("0.5.0.2461")>
9 changes: 5 additions & 4 deletions My Project/Resources.Designer.vb

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

18 changes: 12 additions & 6 deletions My Project/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1119,15 +1119,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<data name="WhatsNew" xml:space="preserve">
<value>Bugfixes:

- Fixed some splash screen issues if the program is run on Windows 7/Server 2008 R2 or if the program is run without administrative privileges (thanks liliactr on the My Digital Life forums for spotting)
- Fixed an issue in the CLI version of the mounted image manager that would throw an error at startup if no images were mounted
- If the download or install sizes of capabilities are less than 1024 bytes, the program will no longer show "(~)"
- Fixed a critical issue where all DISM commands would fail for offline installations if the mount directory were a drive (thanks @Xhib-ba for spotting)

New features:

- Existing PowerShell tooling (excluding the PE Helper) has been refactored and cleaned up for increased code readability and quality
- If you were to add multiple installation images to your customized ISO files, the PE helper will now ask you what image to apply
- You can now get who signed a driver when saving installed driver information to a file
- The way custom properties of packages and features are viewed has been improved, better showing the hierarchy of these properties
- The Scintilla.NET library has been updated to version 5.5.1</value>
- The program update system has had some improvements:
- A minimum version threshold has been added to update information files. The currently running version is compared with this threshold to determine if settings should be migrated
- The 7-Zip component has been updated to version 24.06
- The Preinstallation Environment (PE) helper has had some improvements:
- The OS installer now creates a scratch directory on the target drive to avoid any DISM serviceability warnings
- Disk volume checks have been improved to ensure that the correct boot volume is selected when creating boot files
- The App Installer downloader now informs of download errors and saves target files using the extension in the URL
- The custom property viewer can now prompt you to select a property if you haven't done so
- The program can now detect and inform about DISM API errors to you</value>
</data>
<data name="split_img" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\split_img.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
Expand Down
Loading