Skip to content

Commit 54badca

Browse files
committed
[PE Helper] Add Sysprep Preparator, modify autorun
1 parent 48fe949 commit 54badca

File tree

6 files changed

+35
-16
lines changed

6 files changed

+35
-16
lines changed

DISMTools.vbproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,9 @@
12341234
<None Include="Helpers\extps1\PE_Helper\files\startup\startnet.cmd">
12351235
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
12361236
</None>
1237+
<None Include="Helpers\extps1\PE_Helper\files\SysprepPreparator.zip">
1238+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1239+
</None>
12371240
<None Include="Helpers\extps1\PE_Helper\PE_Helper.ps1">
12381241
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
12391242
</None>

Helpers/extps1/PE_Helper/PE_Helper.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,22 @@ function Start-PEGeneration
256256
Write-Host "HotInstall could not be copied."
257257
}
258258
}
259+
# Detect if Sysprep Preparator is present in the working directory and copy it to the ISO file
260+
if (Test-Path -Path "$((Get-Location).Path)\files\SysprepPreparator.zip" -PathType Leaf) {
261+
Write-Host "Sysprep Preparation Tool has been detected. Adding to ISO file..."
262+
New-Item -Path "$((Get-Location).Path)\ISOTEMP\media\Tools\SysprepPreparator" -ItemType Directory | Out-Null
263+
Expand-Archive -Path "$((Get-Location).Path)\files\SysprepPreparator.zip" -Destination "$((Get-Location).Path)\ISOTEMP\media\Tools\SysprepPreparator" -Force -ErrorAction SilentlyContinue
264+
}
259265
if (Test-Path -Path "$((Get-Location).Path)\tools\MainMenu") {
260266
Write-Host "The main menu has been detected. Adding to ISO file..."
261267
Copy-Item -Path "$((Get-Location).Path)\tools\MainMenu\*.*" -Destination "$((Get-Location).Path)\ISOTEMP\media" -Force -Recurse -Verbose
268+
$autorunContents = @'
269+
270+
[autorun]
271+
open=autorun.exe
272+
icon=autorun.ico
273+
'@
274+
$autoRunContents | Out-File -FilePath "$((Get-Location).Path)\ISOTEMP\media\autorun.inf" -Encoding utf8 -Force
262275
}
263276
Write-Host "The ISO file structure has been successfully created. DISMTools will continue creating the ISO file automatically after 5 seconds."
264277
Start-Sleep -Seconds 5
1.49 MB
Binary file not shown.

Helpers/extps1/PE_Helper/tools/PEHelperMainMenu/MainForm.Designer.vb

Lines changed: 15 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Helpers/extps1/PE_Helper/tools/PEHelperMainMenu/MainForm.vb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,8 @@ Public Class MainForm
7777
"-Executionpolicy Bypass -Command iex " & Quote & Path.Combine(Application.StartupPath, "pxehelpers", "fog", "foghelper_server.ps1") & Quote,
7878
True)
7979
End Sub
80+
81+
Private Sub LinkLabel4_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel4.LinkClicked
82+
RunProcess(Path.Combine(Application.StartupPath, "Tools", "SysprepPreparator", "SysprepPreparator.exe"), RunAsAdmin:=True)
83+
End Sub
8084
End Class
512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)