Skip to content

Commit 5422ecc

Browse files
committed
[PE Helper] Introducing HotInstall
1 parent b37744b commit 5422ecc

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

DISMTools.vbproj

+3
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,9 @@
12101210
<None Include="Helpers\extps1\PE_Helper\files\DISMTools-PE.zip">
12111211
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
12121212
</None>
1213+
<None Include="Helpers\extps1\PE_Helper\files\HotInstall.zip">
1214+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1215+
</None>
12131216
<None Include="Helpers\extps1\PE_Helper\files\startup\StartInstall.ps1">
12141217
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
12151218
</None>

Helpers/extps1/PE_Helper/PE_Helper.ps1

+21
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,19 @@ function Start-PEGeneration
205205
{
206206
Write-Host "Temporary files haven't been deleted successfully"
207207
}
208+
# Detect if HotInstall is present in the working directory and copy it to the ISO file
209+
if (Test-Path -Path "$((Get-Location).Path)\files\HotInstall.zip" -PathType Leaf) {
210+
Write-Host "HotInstall has been detected. Adding to ISO file to allow installations from full Windows environments..."
211+
Expand-Archive -Path "$((Get-Location).Path)\files\HotInstall.zip" -Destination "$((Get-Location).Path)\ISOTEMP\media" -Force -ErrorAction SilentlyContinue
212+
if ($?)
213+
{
214+
Write-Host "HotInstall has been copied successfully."
215+
}
216+
else
217+
{
218+
Write-Host "HotInstall could not be copied."
219+
}
220+
}
208221
Write-Host "The ISO file structure has been successfully created. DISMTools will continue creating the ISO file automatically after 5 seconds."
209222
Start-Sleep -Seconds 5
210223
Write-Host "Creating ISO file..."
@@ -1447,6 +1460,14 @@ function New-BootFiles
14471460
diskpart /s "X:\files\diskpart\dp_bootassign.dp" | Out-Host
14481461
}
14491462
}
1463+
1464+
if (Test-Path -Path "X:\HotInstall\BcdEntry" -PathType Leaf) {
1465+
Write-Host "Deleting BCD entry..."
1466+
$entryGuid = Get-Content -Path "X:\HotInstall\BcdEntry"
1467+
if ($entryGuid -ne "") {
1468+
bcdedit /delete $entryGuid | Out-Host
1469+
}
1470+
}
14501471
}
14511472
bcdboot "$($drLetter):\Windows" /s "W:" /f ALL
14521473
}
4.97 MB
Binary file not shown.

0 commit comments

Comments
 (0)