[main]
Title=Post Config
Description=Finalizing Windows PE...
Selected=none
Level=8
Author=Kare
Version=7
Date=16.04.2021

[Interface]
pTextLabel1=compression:,10,0,Default,30,100,90,20
pScrollBox1=XPRESS,1,0,0,121,100,90,20,None,LZX,XPRESS
//
tEcho_1=Creating image...
tEcho_4=Creating [Userfile] ...

[Interface.07]
Description=Schließt die Erstellung von WindowsPE ab ...
pTextLabel1=Kompression:,10,0,Default,30,100,90,20
pscrollbox1=XPRESS,1,0,0,121,100,90,20,Keine,LZX,XPRESS
//
tEcho_1=Image-Datei wird erstellt...
tEcho_4=Erstellt wird [Benutzerdatei] ...

[process]

ShellExecute,Hide,%WindowsDir%\system32\cmd.exe, /c cd /d #$q%target_sys%\config#$q && del /ah COMPONENTS.LOG* COMPONENTS{* SAM.LOG* SAM{* SECURITY.LOG* SECURITY{* SYSTEM.LOG* SYSTEM{* SOFTWARE.LOG* SOFTWARE{* Default.LOG* Default{* Drivers{* Drivers.log* BBi.log*
System,Error,off
FileDelete,%targetdir%\Users\default\ntuser.dat.log*.*
FileDelete,%targetdir%\Users\default\ntuser.dat{*.*
System,Error,on

If,Srtchecked,Shells\2-bsexplorer.srt,then,Run,%ProjectDir%\Shells\2-bsexplorer.srt,BuildShortcut

Interface,GetIndex,pScrollBox1,%Var%
if,%Var%,=,1,then,Set,%pscrollbox1%,=,None

Junc,GetTarget,%TargetDir%,%tmp%
echo,%tEcho_1%
Wim,Create,%pScrollBox1%,%tmp%,%Target_CD%\sources\Boot.wim

echo,Bcdedit /store bcd set {bootmgr} locale %DistLang%

RegLoad,%Target_CD%\Boot\bcd,PE-BCD
ShellExecute,Hide,%Tools%\%HostArch%\SetAcl.exe, -on #$qHKLM\PE-BCD#$q      -ot reg -rec yes -actn setowner -ownr #$qn:S-1-5-32-544;s:y#$q -silent
If,Not,%ExitCode%,=,0,Then,Halt,Error ACL
ShellExecute,Hide,%Tools%\%HostArch%\SetAcl.exe, -on #$qHKLM\PE-BCD#$q      -ot reg -rec yes -actn ace -ace #$qn:S-1-5-32-544;p:full;s:y#$q -ace #$qn:S-1-1-0;p:full;s:y#$q -silent
If,Not,%ExitCode%,=,0,Then,Halt,Error ACL

RegWrite,HKLM,0x1,PE-BCD\Description,KeyName,BCD00000000
RegWrite,HKLM,0x1,PE-BCD\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000005,Element,%DistLang%
RegRead,%Default%,HKLM,PE-BCD\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\23000003,Element
RegWrite,HKLM,0x1,PE-BCD\Objects\%Default%\Elements\12000005,Element,%DistLang%
RegWrite,HKLM,0x1,PE-BCD\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Elements\12000005,Element,%DistLang%
RegWrite,HKLM,0x3,PE-BCD\Objects\%Default%\Elements\250000C2,Element,00,00,00,00,00,00,00,00

// The following of Bypass Driver Signing (see "1-Base Files). Thanks JFX http://theoven.org/index.php?topic=866.msg11055#msg11055
If,%Arch%,=,x64,then
	RegWrite,HKLM,0x3,PE-BCD\Objects\%Default%\Elements\16000048,Element,01
	RegWrite,HKLM,0x1,PE-BCD\Objects\%Default%\Elements\12000030,Element,DISABLE_INTEGRITY_CHECKS
End
RegUnLoad,PE-BCD

//MadMax
If,ExistFile,%target_cd%\efi\microsoft\boot\bcd,then
	RegLoad,%target_cd%\efi\microsoft\boot\bcd,PE-BCD

	ShellExecute,Hide,%Tools%\%HostArch%\SetAcl.exe, -on #$qHKLM\PE-BCD#$q      -ot reg -rec yes -actn setowner -ownr #$qn:S-1-5-32-544;s:y#$q -silent
	If,Not,%ExitCode%,=,0,Then,Halt,Error ACL
	ShellExecute,Hide,%Tools%\%HostArch%\SetAcl.exe, -on #$qHKLM\PE-BCD#$q      -ot reg -rec yes -actn ace -ace #$qn:S-1-5-32-544;p:full;s:y#$q -ace #$qn:S-1-1-0;p:full;s:y#$q -silent
	If,Not,%ExitCode%,=,0,Then,Halt,Error ACL

	RegRead,%Default%,HKLM,PE-BCD\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\23000003,Element
	RegWrite,HKLM,0x1,PE-BCD\Objects\%Default%\Elements\12000030,Element,TESTSIGNING

	RegUnLoad,PE-BCD
End


[Script-Pic]
0=2642,3292,ZLB64
1=eNqdlHdU00sWx38hgSR0pIuA0lREsNACAgJPEHmIROkCYl6ohl6VJrwEFSECGlRAREB6k44UkY4FUZogJYaOkQRBAgnJJu7bff/sH7v7nbkz98zcO+d+zswZ1jhrFhA+Z2ZhBoBAIOAKuwEsInD+TIS3BwBYWQGqAADAAAgYBHCzPRDbDG2Ef80gzmAjAkD+uS7YZbPnbx/gCIR7CgDVeNYkYApwgUCc/pfA3GCOeCAQMDeUBwrlGAzOB4fBeGFQKK8ALy8fP1tQuKCQAL8gx+ccwknnZLE7PwwK4/+fxXoFiMCA08BpMEgB4BIBgUVArC5Anl0pN+iXgL8E4gJDuHnYJfHysQPqhNnlg8Fc7GK5IWxEUDR7H4CIcO85cNyYR9TGHaoQKHbiZmouTNGkukMcOURROnk1KB7OKyEpJb1XWeXgocOqmlraOroIPdPfzpiZn7U4d/GSrZ29g6MT6g+0h6eXt09wSGhYeETk9YQ/sbjEW7fvpKXff0DIePjo8bO8/ILnhUXFJS9qauvqGxqbml93dnX39Pb1D3z8NDwyOjb+eYL4lTQ3v7C4tLxCXf+xsflzi7a9w+ECAWDQv/QfuUTYXFzsO4BAOVwgrnBOgAiE+8Bxnj3GNlD3QFGFEzdhYiapudUdcMWTSIr41aAhXgklTaIylYP2i+y/A4v/v8j+DfY31wTAz36MXCJgEcAI2GU8u3MIeNayRqrsLvVPJEi8OUpyKO8P+KFQqhkxuTtrTvXUZe4LzMJnxfq0T4wxpd2IAdSeOsPcr8lcCLICQd/ATKs52bMJx/UGkqJD3kPYFlIxKMg4UGyzWO7ovtQ9gMlPm6oPGu02yazF1+Q3n8239TjjQc/NlGm7P5etHGYb6uH6dF+qmxpDnbZGof9Mo2H8bxSwgNcGJA2+VQCtXC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