Audio-Stereo - Complements of KYHI

PreFlight - Check disk space
Shell Config - Disable telemetry
Fixed display driver registration
Fixed vmware script Auto num processor setting could cause system thread exception not handled with Win10 2004.
misc bug fixes
This commit is contained in:
Homes32
2021-04-25 18:12:01 -05:00
parent a1569c5641
commit 57ab6bc473
22 changed files with 246 additions and 163 deletions

View File

@@ -45,12 +45,36 @@ Date=2020-07-12
Echo,"Starting Pre-Flight Check..."
Run,%ScriptFile%,CheckEngine
Run,%ScriptFile%,CheckOutputDir
If,%cb_CheckFreeSpace%,Equal,True,Run,%ScriptFile%,CheckDiskSpace
Run,%ScriptFile%,CheckTools
If,%cb_CheckForSupportedBuildVer%,Equal,True,Run,%ScriptFile%,KnownBuilds
If,%cb_CheckForSupportedBuildVer%,Equal,True,Run,%ScriptFile%,CheckKnownBuilds
Run,%ScriptFile%,CheckWinREVersion
[#CheckOutputDir#]
// ===============================================================================================================================
// Name...........: CheckOutputDir
// Description....: Verify that %OutputDir% is not a root drive (ie. d:\). This will cause issues with creating/cleaning up
// the build environment.
// Syntax.........:
// Parameters.....:
// Return values..:
// Author.........: Homes32
// Remarks........:
// Related........: Called by [Process]
// ===============================================================================================================================
[CheckOutputDir]
System,SetLocal
StrFormat,SPLIT,%OutputDir%,"\",0,%NumSplits%
If,%NumSplits%,Equal,1,Begin
Message,"Error: Setting the OutputDir to the root of a drive is not supported.",Error
Halt,"Error: Setting the OutputDir to the root of a drive is not supported."
End
System,EndLocal
[#CheckEngine#]
// ===============================================================================================================================
// Name...........: CheckEngine
// Description....: Verify that PEBakery is using a supported configuration.
// Syntax.........:
// Parameters.....:
@@ -137,36 +161,38 @@ System,EndLocal
[#CheckTools#]
// ===============================================================================================================================
// Name...........: CheckTools
// Description....: Verify that all tools needed by the project exist in the %Tools% directory.
// Syntax.........:
// Parameters.....:
// Return values..:
// Author.........: Homes32
// Remarks........:
// Related........: [MissingTool], [Process]
// Related........: [ErrMissingTool], [Process]
// ===============================================================================================================================
[CheckTools]
Echo,"Verifying required 3rd party tools are present..."
If,Not,ExistFile,"%Tools%\%HostArch%\7z.exe",Run,%ScriptFile%,MissingTool,7z.exe
If,Not,ExistFile,"%Tools%\%HostArch%\BcastEnvChg.exe",Run,%ScriptFile%,MissingTool,BcastEnvChg.exe
If,Not,ExistFile,"%Tools%\%HostArch%\binmay.exe",Run,%ScriptFile%,MissingTool,binmay.exe
If,Not,ExistFile,"%Tools%\%HostArch%\GetBinaryResource.exe",Run,%ScriptFile%,MissingTool,GetBinaryResource.exe
If,Not,ExistFile,"%Tools%\%HostArch%\GetStringResource.exe",Run,%ScriptFile%,MissingTool,GetStringResource.exe
If,Not,ExistFile,"%Tools%\%HostArch%\GWT.exe",Run,%ScriptFile%,MissingTool,GWT.exe
If,Not,ExistFile,"%Tools%\%HostArch%\hiderun.exe",Run,%ScriptFile%,MissingTool,hiderun.exe
If,Not,ExistFile,"%Tools%\x86\HiveUnload.exe",Run,%ScriptFile%,MissingTool,HiveUnload.exe
If,Not,ExistFile,"%Tools%\x86\innounp.exe",Run,%ScriptFile%,MissingTool,innounp.exe
If,Not,ExistFile,"%Tools%\x86\mkISOfs.exe",Run,%ScriptFile%,MissingTool,mkISOfs.exe
If,Not,ExistFile,"%Tools%\x86\SetACL.exe",Run,%ScriptFile%,MissingTool,SetACL.exe
If,Not,ExistFile,"%Tools%\x86\xml.exe",Run,%ScriptFile%,MissingTool,xml.exe
If,Not,ExistFile,"%Tools%\%HostArch%\7z.exe",Run,%ScriptFile%,ErrMissingTool,7z.exe
If,Not,ExistFile,"%Tools%\%HostArch%\BcastEnvChg.exe",Run,%ScriptFile%,ErrMissingTool,BcastEnvChg.exe
If,Not,ExistFile,"%Tools%\%HostArch%\binmay.exe",Run,%ScriptFile%,ErrMissingTool,binmay.exe
If,Not,ExistFile,"%Tools%\%HostArch%\GetBinaryResource.exe",Run,%ScriptFile%,ErrMissingTool,GetBinaryResource.exe
If,Not,ExistFile,"%Tools%\%HostArch%\GetStringResource.exe",Run,%ScriptFile%,ErrMissingTool,GetStringResource.exe
If,Not,ExistFile,"%Tools%\%HostArch%\GWT.exe",Run,%ScriptFile%,ErrMissingTool,GWT.exe
If,Not,ExistFile,"%Tools%\%HostArch%\hiderun.exe",Run,%ScriptFile%,ErrMissingTool,hiderun.exe
If,Not,ExistFile,"%Tools%\x86\HiveUnload.exe",Run,%ScriptFile%,ErrMissingTool,HiveUnload.exe
If,Not,ExistFile,"%Tools%\x86\innounp.exe",Run,%ScriptFile%,ErrMissingTool,innounp.exe
If,Not,ExistFile,"%Tools%\x86\mkISOfs.exe",Run,%ScriptFile%,ErrMissingTool,mkISOfs.exe
If,Not,ExistFile,"%Tools%\x86\SetACL.exe",Run,%ScriptFile%,ErrMissingTool,SetACL.exe
If,Not,ExistFile,"%Tools%\x86\xml.exe",Run,%ScriptFile%,ErrMissingTool,xml.exe
// WaikTools
If,Not,ExistFile,"%Tools%\%HostArch%\BCDBoot\bcdedit.exe",Run,%ScriptFile%,GetWaikTools
If,Not,ExistFile,"%Tools%\%HostArch%\DISM\dism.exe",Run,%ScriptFile%,GetWaikTools
If,Not,ExistFile,"%Tools%\%HostArch%\Oscdimg\oscdimg.exe",Run,%ScriptFile%,GetWaikTools
[#MissingTool#]
[#ErrMissingTool#]
// ===============================================================================================================================
// Name...........: ErrMissingTool
// Description....: Present an error message and halt the build if a required .exe is missing from the %Tools% folder.
// Syntax.........: Run,%ScriptFile%,<ToolName>
// Parameters.....: #1 - Tool Name
@@ -175,12 +201,13 @@ If,Not,ExistFile,"%Tools%\%HostArch%\Oscdimg\oscdimg.exe",Run,%ScriptFile%,GetWa
// Remarks........: INTERNAL FUNCTION
// Related........: [CheckTools]
// ===============================================================================================================================
[MissingTool]
[ErrMissingTool]
Message,"The build cannot continue because the required application [ #1 ] is missing.#$x#$xPlease re-download the project.#$x#$x If the issue persists you may need to add an exception for the [%Tools%] folder in your anti-virus software in order to prevent false-positives from recurring.",ERROR
Halt,"The build cannot continue because [ #1 ] is missing."
[#GetWaikTools#]
// ===============================================================================================================================
// Name...........: GetWaikTools
// Description....: Download missing/required WAIK tools (dism, oscdimg, etc.) using JFX's GWT.exe
// Syntax.........:
// Parameters.....:
@@ -196,8 +223,9 @@ DirCopy,"%ProjectTemp%\ADK_6\x86\*.*","%Tools%\x86"
DirCopy,"%ProjectTemp%\ADK_6\amd64\*.*","%Tools%\x64"
If,Not,ExistFile,"%Tools%\x64\Oscdimg\oscdimg.exe",Halt,"Error downloading required Windows 10 ADK tools. The build cannot continue."
[#KnownBuilds#]
[#CheckKnownBuilds#]
// ===============================================================================================================================
// Name...........: CheckKnownBuilds
// Description....: Verify if the source is a known working version. If not warn the user that there may be issues.
//
// Version OS Build Release Date Codename Marketing Name
@@ -220,7 +248,7 @@ If,Not,ExistFile,"%Tools%\x64\Oscdimg\oscdimg.exe",Halt,"Error downloading requi
// Remarks........: As a general rule PhoenixPE will attempt to support the 2 most recent verified builds.
// Related........: Called by [Process]
// ===============================================================================================================================
[KnownBuilds]
[CheckKnownBuilds]
System,SetLocal
// Minimum supported version
@@ -274,11 +302,59 @@ If,ExistFile,"%ProjectCache%\WinRE.wim",Begin
Set,%WinREVer%,%imgVerMaj%.%imgVerMin%.%imgVerBld%.%imgVerSPBld%
If,Not,%WinREVer%,Equal,%SourceVer%,Begin
Echo,"Warning: Version mismatch. WinRE is not the same version as the source image. This could result in build failures.",Warn
Echo,"Warning: Version mismatch. WinRE is not the same version as the source image. This may result in build failures.",Warn
Message,"Warning: Version Mismatch#$x#$xThe WinRE image is not the same version as the Windows source (install.wim).#$xThis doesn't necessarily mean the build will fail, but the resulting PE environment may be unstable.#$x#$xProceed at your own risk.#$x#$xInstall.wim: %SourceVer%#$xWinRE.wim: %WinREVer%",Warning,10
End
End
[#CheckDiskSpace#]
// ===============================================================================================================================
// Name...........: CheckDiskSpace
// Description....: Make sure we have the minimum amount of free disk space required to build.
//
// Minimum Free Space is somewhat arbitrary, as we can't be sure what the final build size will be with
// whatever apps, features, etc. the user decides to include.
//
// For the purpose of this check we are primarily making sure we have the space needed to:
// - extract our base .wim image and cache it
// - extract the contents of the base .wim image to %TargetDir%
// - copy files from install.wim for "core" features such as Explorer, etc. to %TargetDir%
// - compress the resulting files back into a .wim image in %OutputDir%
// Syntax.........:
// Parameters.....:
// Return values..:
// Author.........: Homes32
// Remarks........: If %TargetDir% doesn't exist yet GetFreeSpace will fallback to the drive letter specified by the path.
// Related........:
// ===============================================================================================================================
[CheckDiskSpace]
System,SetLocal
// Set minimum space required to 5 GB
Set,%MinimumFreeMegabytes%,5120
Math,Mul,%MinimumFreeBytes%,%MinimumFreeMegabytes%,1048576
StrFormat,IntToBytes,%MinimumFreeBytes%,%HumanReadableMinimumFreeSpace%
// Check %TargetDir% & %Workbench%
System,GetFreeSpace,%TargetDir%,%FreeMegabytes%
Math,Mul,%FreeBytes%,%FreeMegabytes%,1048576
StrFormat,IntToBytes,%FreeBytes%,%HumanReadableFreeSpace%
If,%FreeMegabytes%,Smaller,%MinimumFreeMegabytes%,Begin
Echo,"Warning: You have less then %HumanReadableMinimumFreeSpace% of free disk space on your target drive [%TargetDir%]. This may result in build failures.",Warn
Message,"Warning: You only have [%HumanReadableFreeSpace%] free disk space on your target drive, which is less then the recommended %HumanReadableMinimumFreeSpace%. This may result in build failures.",Warning,10
End
// Check %OutputDir%
System,GetFreeSpace,%OutputDir%,%FreeMegabytes%
Math,Mul,%FreeBytes%,%FreeMegabytes%,1048576
StrFormat,IntToBytes,%FreeBytes%,%HumanReadableFreeSpace%
If,%FreeMegabytes%,Smaller,%MinimumFreeMegabytes%,Begin
Echo,"Warning: You have less then %HumanReadableMinimumFreeSpace% of free disk space on your output drive [%OutputDir%]. This may result in build failures.",Warn
Message,"Warning: You only have [%HumanReadableFreeSpace%] free disk space on your output drive [%OutputDir%], which is less then the recommended %HumanReadableMinimumFreeSpace%. This may result in build failures.",Warning,10
End
System,EndLocal
[#SetDefaultOptions#]
// ===============================================================================================================================
// Name...........: SetDefaultOptions
@@ -292,6 +368,7 @@ End
// ===============================================================================================================================
[SetDefaultOptions]
WriteInterface,Value,%ScriptFile%,Interface,cb_CheckForSupportedBuildVer,True
WriteInterface,Value,%ScriptFile%,Interface,cb_CheckFreeSpace,True
[#ToggleAdvancedOptions#]
// ===============================================================================================================================
@@ -313,6 +390,7 @@ End
Else,Set,%Toggle%,False
WriteInterface,Visible,%ScriptFile%,Interface,cb_CheckForSupportedBuildVer,%Toggle%
WriteInterface,Visible,%ScriptFile%,Interface,cb_CheckFreeSpace,%Toggle%
WriteInterface,Visible,%ScriptFile%,Interface,bvl_AdvancedOptions,%Toggle%
System,EndLocal
@@ -346,7 +424,8 @@ btn_SetDefaultOptions=,1,8,541,5,25,25,SetDefaultOptions,SetDefaults_16.png,True
btn_AdvancedOptions=,1,8,571,5,25,25,ToggleAdvancedOptions,Advanced_16.png,True,"__Show/Hide Advanced Options"
btn_ScriptInfo=,1,8,601,5,25,25,ShowScriptInfo,Help_16.png,True,"__Script Info"
bvl_AdvancedOptions="Advanced Options",0,12,5,50,446,71,8,Bold
cb_CheckForSupportedBuildVer="Verify Source Build Number",0,3,12,79,150,18,True,"__Check and see if the Win10 build version has been tested with this project."
cb_CheckForSupportedBuildVer="Verify Source Build Number",0,3,12,64,150,18,True,"__Check and see if the Win10 build version has been tested with this project."
cb_CheckFreeSpace="Verify Free Disk Space",0,3,12,84,150,18,True,"__Verify we have the free disk space required to build this project."
[InterfaceEncoded]
Advanced_16.png=1722,2396

View File

@@ -44,6 +44,7 @@ Date=2019-01-01
Run,%ScriptFile%,Cleanup
Run,%ScriptFile%,CreateTargetFolders
Run,%ScriptFile%,ExtractBaseWim
If,%cb_IncludeFullWinSxS%,Equal,False,Run,%ScriptFile%,CleanupWinSxS
[#Cleanup#]
// ===============================================================================================================================
@@ -103,10 +104,6 @@ Echo,"Creating Output directory..."
DirMake,%OutputDir%
DirMake,"%OutputDir%\Programs"
DirMake,"%OutputDir%\sources"
//DirMake,"%OutputDir%\boot"
//DirMake,%OutputDir%\boot\fonts
//DirMake,"%OutputDir%\efi"
//DirMake,"%OutputDir%\efi\microsoft\boot\fonts"
Echo,"Granting full access to [%OutputDir%]..."
SetFileACL,%OutputDir%
@@ -131,8 +128,6 @@ StrFormat,FileName,%SourceBaseWim%,%tmp_BaseFileName%
Echo,"Extracting [%tmp_BaseFileName%:%SourceBaseWimImage%] to [%TargetDir%]...#$x#$xThis can take awhile, please be patient."
WimApply,%SourceBaseWim%,%SourceBaseWimImage%,%TargetDir%,NOACL,NOATTRIB
If,%cb_IncludeFullWinSxS%,Equal,False,Run,%ScriptFile%,CleanupWinSxS
// WallpaperHost.exe causes issues with explorer starting
FileDeleteEx,%TargetDir%\Windows\System32\WallpaperHost.exe

View File

@@ -483,7 +483,7 @@ cmb_SoftwareHive=Install.wim,0,4,272,99,100,21,Boot.wim,Install.wim,_SetRegistry
lbl_DriversHive="Drivers hive:",0,1,17,105,64,18,8,Normal
cmb_DriversHive=Boot.wim,0,4,82,99,100,21,Boot.wim,Install.wim,_SetRegistryHiveSource_,True
lbl_HiveInfo="These settings allow you to choose the hive to be used as the #$qBase#$q for the registry.",0,1,16,130,419,30,8,Normal
cb_TakeFullOwnershipRegSoftware="Take full ownership of %RegSoftware%",0,3,15,163,213,18,True,_PurgeRegCache_,True,"__By default PhoenixPE only takes full ownership of a few important %RegSoftware% keys.#$xEnable this option to take full ownership of the entire %RegSoftware% hive.#$x#$xWARNING: Enabling this option can add up to 5 minutes to your initial build time.#$x#$xToggling this option will purge the current registry cache."
cb_TakeFullOwnershipRegSoftware="Take full ownership of the Software hive",0,3,15,163,213,18,True,_PurgeRegCache_,True,"__By default PhoenixPE only takes full ownership of a few important %RegSoftware% keys.#$xEnable this option to take full ownership of the entire %RegSoftware% hive.#$x#$xWARNING: Enabling this option can add up to 5 minutes to your initial build time.#$x#$xToggling this option will purge the current registry cache."
[InterfaceEncoded]
Trash.ico=1150,1212

View File

@@ -125,6 +125,9 @@ RegWrite,HKLM,0x1,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\ProfileList\
// Manage Computer on My Computer context menu
RegWrite,HKLM,0x2,"Tmp_software\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Manage\command","","#$pSystemRoot#$p\System32\mmc.exe /b compmgmt.msc",NoWarn
// Add C:\Windows\System32\DriverStore\FileRepository to Installation Sources. This will allow our PE look for drivers on the C: drive of the Host computer.
RegWrite,HKLM,0x7,"Tmp_Software\Microsoft\Windows\CurrentVersion\Setup","Installation Sources","C:\Windows\System32\DriverStore\FileRepository"
// Enable SIHost
RegWrite,HKLM,0x4,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\Winlogon","EnableSIHostIntegration",1
@@ -182,6 +185,10 @@ RegWrite,HKLM,0x4,"Tmp_System\ControlSet001\Services\usbhub\HubG","DisableOnSoft
// Turn off WMI Telemetry
RegWrite,HKLM,0x4,"Tmp_System\ControlSet001\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener","Start",0
// Disable Telemetry Service
RegWrite,HKLM,0x4,"Tmp_System\ControlSet001\Services\diagnosticshub.standardcollector.service","Start",4
RegWrite,HKLM,0x4,"Tmp_System\ControlSet001\Services\DiagTrack","Start",4
// EnableWheelDetection
RegWrite,HKLM,0x4,"Tmp_System\ControlSet001\Services\i8042prt\Parameters","EnableWheelDetection",2
@@ -218,6 +225,10 @@ RegWrite,HKLM,0x1,"Tmp_System\ControlSet001\services\Tcpip\Parameters","NV Hostn
RegWrite,HKLM,0x1,"Tmp_System\ControlSet001\services\Tcpip\Parameters","Hostname",%ProjectTitle%,NoWarn
RegWrite,HKLM,0x1,"Tmp_System\ControlSet001\Control\Session Manager\Environment","ComputerName",%ProjectTitle%,NoWarn
// Create and Disable Remote Desktop service to avoid event log errors
RegCopy,HKLM,"Tmp_Install_System\ControlSet001\Services\TermService",HKLM,"Tmp_System\ControlSet001\Services\TermService"
If,ExistRegSubKey,HKLM,"Tmp_System\ControlSet001\Services\TermService",RegWrite,HKLM,0x4,"Tmp_System\ControlSet001\Services\TermService","Start",4
// Start Services in Redstone 5+
If,%SourceVer%,Bigger,"10.0.17700.0",Begin
// Fix Base Filtering Engine startup (Firewalls)

View File

@@ -74,6 +74,7 @@ Echo,"Building a list of required files...#$x#$xThis can take awhile, please be
///////////////////////////////////////////////////////////////////////////////////
// Core WoW64 Emulation Layer
RequireFileEx,AppendList,\Windows\System32\ntdll.dll
RequireFileEx,AppendList,\Windows\System32\wow64.dll,NOMUI
RequireFileEx,AppendList,\Windows\System32\wow64cpu.dll,NOMUI
RequireFileEx,AppendList,\Windows\System32\wow64win.dll,NOMUI
@@ -102,6 +103,7 @@ Echo,"Building a list of required files...#$x#$xThis can take awhile, please be
///////////////////////////////////////////////////////////////////////////////////
// Core WoW64 Emulation Layer
RequireFileEx,AppendList,\Windows\System32\ntdll.dll
RequireFileEx,AppendList,\Windows\System32\wow64.dll,NOMUI
RequireFileEx,AppendList,\Windows\System32\wow64cpu.dll,NOMUI
RequireFileEx,AppendList,\Windows\System32\wow64win.dll,NOMUI