Multi-OEM/Retail Project {MRP} - Mk3

Discussion in 'MDL Projects and Applications' started by mxman2k, Oct 15, 2016.

  1. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,274
    94,763
    450
  2. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    #7922 mxman2k, Feb 22, 2022
    Last edited: Feb 22, 2022
    (OP)
    MRP 143 is at RC5 stage and getting close to release, a few final bits to get checked to make sure that they are working ok on Win 11 builds etc and should be good to go. :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    Must be something in this new build as nothing in mrp alters the notepad associations.

    Has m$ removed notepad.exe now and forcing use of the appx version?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,274
    94,763
    450
  5. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    Typical m$ screw something up :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,694
    1,932
    60
    on sony vaio the logos look so cool

    thank you for your work :dance:
     
  7. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    #7930 mxman2k, Feb 28, 2022
    Last edited: Feb 28, 2022
    (OP)
    Last minute checks as hoping to get MRP 143 released later today :)

    **Update Edit*
    Had to remove the .log/.txt extension test due to not being reliable during oobe, as it appears that associations are not set until the last minute and so because MRP has already finished by then it always said it is not associated. It not a huge loss as it was only a simple registry check.

    The QT will be next to finish off, it is almost ready.

    Code:
    
    REG query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.log\OpenWithList" 2>nul | find /i "notepad.exe" >nul 2>nul && SET "DotLogInfo=The '.log' file extension is associated with NotePad.exe" || SET "DotLogInfo=The '.log' file extension does not appear to be associated with NotePad.exe"
    REG query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\OpenWithList" 2>nul | find /i "notepad.exe" >nul 2>nul && SET "DotTxtInfo=The '.txt' file extension is associated with NotePad.exe" || SET "DotTxtInfo=The '.txt' file extension does not appear to be associated with NotePad.exe"
    
    
    I could of delved deeper but as it not detrimental to the use of MRP etc i decided not to proceed further.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    MRP v143 Baseline has been uploaded, 2nd post's download link, password and hashes have been updated. :)

    Mainly a bug fix release with a little new bits added.

    + Added Sapphire branding to the OEM's list. Thanks @JanCerny for the files.

    + Added a couple of new Windows 11 options:

    1} Remove that 'System Requirements Not Met' type of desktop watermark. This just turns off that message it does not do any other internal changes.

    2} Prevent the 'Windows 11 upgrade' nag screen that shows in the Settings pages, the one that says you can upgrade or check your system if it meets requirements etc.

    The .log and .txt extension checks to see if they are associated with Notepad.exe are not reliable during the oobe stage and have been removed for now.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,694
    1,932
    60
    if i leave the oobe.cmd in it ignores the firstlogon.cmd in the actual 22000.527

    i make from the oobe.cmd the entries in the setupcomplete.cmd
    (Compiled_15th_January_2022)

    MRP143
    new not tested yet, i think i will stay with the stupcomplete.cmd with the entries
     
  11. OOBE : Before User is Created
    SetupComplete : After User is Created

    Pl be sure not to do anything with oobe.cmd
     
  12. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    Remember that Win11 builds are strange to say the least! Very odd results seem to be normal recently, more so in the Dev builds.

    Oobe.cmd is called early on in the setup, setupcomplete and firstlogon scripts are run/called via setup after the username has been created so technically they should be ok to have both as they are run at different stages.

    MRP deletes the 'scripts' folder only on a reboot/logout+in cycle and not delete any .cmd file if not used by MRP... Unless you use the MRP option to not auto delete the scripts folder, in which case you will have to tidy that up in your own script(s).

    If you are using any reg tweaks in oobe and they have HKCU (Current_User) hive parts then they will NOT be set as the user hive is not setup at that stage, they must only be HKLM types.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,694
    1,932
    60
    I do more in there

    setupcomplete.cmd
    Code:
    REM Installiere alle Files mit der Endung *.reg
    IF EXIST "%~dp0RegTweaks\*.reg" (
    FOR /F "tokens=*" %%A IN ('DIR /B  "%~dp0RegTweaks\*.reg"') DO (
    regedit /S "%~dp0RegTweaks\%%A"
       )
    )
    
    IF EXIST "%Windir%\Setup\Scripts\DeCompile.exe" (
     CALL "%Windir%\Setup\Scripts\DeCompile.exe"
     DEL /F /Q "%Windir%\Setup\Scripts\DeCompile.exe" >nul
    )
    
    REM Added a early log that is created during the silent oobe part. Will be auto deleted when MRP completes.
    REM This is for debugging when something causes MRP to abort in the early stages. Please do not rename.
    IF EXIST "%Windir%\Setup\Scripts\Install.cmd" CALL "%Windir%\Setup\Scripts\Install.cmd" >"%SystemDrive%\EarlyRun.log"
    IF EXIST "%Windir%\Setup\Scripts\MRPInstall.cmd" CALL "%Windir%\Setup\Scripts\MRPInstall.cmd" >"%SystemDrive%\EarlyRun.log"
    
    cd /d "%~dp0"
    
    REM Microsoft Office LTSC Professional Plus 2021 v2201 Build 16.0.14827.20198 (Price 832.52 USD)
    call %~dp0Office_Installer.cmd"
    
    
    REM Office 2021 Offline KMS Aktivator (KMS_VL_ALL_AIO-45)
    call %~dp0KMS_VL_ALL_AIO.cmd /s /a
    
    
    REM Windows 10/11 Digital Lizenz Aktivierung (MAS 1.5)
    reg query HKU\S-1-5-19 1>nul 2>nul || exit /b
    
    start /b /wait cmd /c "%~dp0HWID_Activation_AIO.cmd" /a
    
    
    reg add HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v firstlogon /t REG_SZ /d %windir%\Setup\Scripts\firstlogon.cmd /f
    firstlogon.cmd

    Code:
    xcopy %SYSTEMDRIVE%\install\ash_inet2.dll "%ProgramFiles(x86)%\Ashampoo\Ashampoo WinOptimizer 19" /S /Q /R /K /Y
    xcopy %SYSTEMDRIVE%\install\version.dll "%ProgramFiles(x86)%\IObit\Driver Booster\9.2.0" /S /Q /R /K /Y
    xcopy %SYSTEMDRIVE%\install\cfg.ini "%ProgramFiles(x86)%\AOMEI\Partition Assistant" /S /Q /R /K /Y
    xcopy %SYSTEMDRIVE%\install\nativeLang.xml "%ProgramFiles%\Notepad++" /S /Q /R /K /Y
    RD /S /Q "%SYSTEMDRIVE%\install"
    
    
    call %~dp0RunAsTI.bat"
    
    
    
    cd /d "%SystemRoot%\Setup\"
    if exist "%SystemRoot%\Setup\Scripts" RD /S /Q "%SystemRoot%\Setup\Scripts"
    exit /b
    RunAsTI.bat

    Code:
    @echo off& title RunAsTI - lean and mean snippet by AveYo, 2018-2022
    goto :nfo
        [FEATURES]
        - innovative HKCU load, no need for reg load / unload ping-pong; programs get the user profile
        - sets ownership privileges, high priority, and explorer support; get System if TI unavailable       
        - accepts special characters in paths for which default run as administrator fails
        - adds Send to - RunAsTI right-click menu entry to launch files and folders as TI via explorer
        [USAGE]
        - First copy-paste RunAsTI snippet after .bat script content
        - Then call it anywhere to launch programs with arguments as TI
          call :RunAsTI regedit
          call :RunAsTI powershell -noprofile -nologo -noexit -c [environment]::Commandline
          call :RunAsTI cmd /k "whoami /all & color e0"
          call :RunAsTI "C:\System Volume Information"
        - Or just relaunch the script once if not already running as TI:
          whoami /user | findstr /i /c:S-1-5-18 >nul || ( call :RunAsTI "%~f0" %* & exit /b )
        2022.01.28: workaround for 11 release (22000) hindering explorer as TI; fix 7 args
    :nfo
    
    :::::::::::::::::::::::::
    :: .bat script content ::
    :::::::::::::::::::::::::
    
    
    :: [optional] add Send to - RunAsTI right-click menu entry to launch files and folders as TI via explorer
    :: set "0=%~f0"& powershell -nop -c iex(([io.file]::ReadAllText($env:0)-split':SendTo\:.*')[1])& goto :SendTo:
    :: $SendTo=[Environment]::GetFolderPath('ApplicationData')+'\Microsoft\Windows\SendTo\RunAsTI.bat'; $enc=[Text.Encoding]::UTF8
    :: if ($env:0 -ne $SendTo) {[IO.File]::WriteAllLines($SendTo, [io.file]::ReadAllLines($env:0,$enc))}
    :: :SendTo:
    
    
    :: call RunAsTI snippet with default commandline args - if none provided, defaults to opening This PC as TI
    call :RunAsTI %*
    
    :: Zeige Dateierweiterungen an.
    :: Kompaktansicht im Datei-Explorer einschalten.
    :: Stellt die Sprache von Revo Uninstaller auf Deutsch.
    :: Traegt den Registrierten Benutzer fuer Revo Uninstaller ein.
    ::
    :: Zeigt das alte Kontextmenue an von Windows 10.
    ::
    :: reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
    :: Wird nicht benoetigt wenn StartallBack installiert wird.
    ::
    :: Hash-Wert Berechnung [Hashtab] CRC32, MD5, SHA-1, SHA-256.
    :: Uhrzeit mit Sekunden in Taskbar anzeigen [Funktioniert nur in Verbindung mit StartallBack]
    
    REM ; Zeige Dateierweiterungen an.
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d "0" /f
    REM ; Kompaktansicht im Datei-Explorer einschalten.
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "UseCompactMode" /t REG_DWORD /d "1" /f
    REM ; Stellt die Sprache von Revo Uninstaller auf Deutsch.
    reg add "HKCU\software\VS Revo Group\Revo Uninstaller Pro\General" /v "Language file" /t REG_SZ /d "german.ini" /f
    REM ; Traegt den Registrierten Benutzer fuer Revo Uninstaller ein.
    reg add "HKCU\software\VS Revo Group\Revo Uninstaller Pro\General" /v "RegUN" /t REG_SZ /d "Senftube" /f
    REM ; Hash-Wert Berechnung [Hashtab] CRC32, MD5, SHA-1, SHA-256.
    reg add "HKCU\SOFTWARE\HashTab\Algorithms\CRC32" /v "Enabled" /t REG_DWORD /d "1" /f
    reg add "HKCU\SOFTWARE\HashTab\Algorithms\MD5" /v "Enabled" /t REG_DWORD /d "1" /f
    reg add "HKCU\SOFTWARE\HashTab\Algorithms\SHA-1" /v "Enabled" /t REG_DWORD /d "1" /f
    reg add "HKCU\SOFTWARE\HashTab\Algorithms\SHA-256" /v "Enabled" /t REG_DWORD /d "1" /f
    REM ; Uhrzeit mit Sekunden in Taskbar anzeigen [Funktioniert nur in Verbindung mit StartallBack]
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowSecondsInSystemClock" /t REG_DWORD /d "1" /f
    
    
    
    
    cd /d "%~dp0"
    REM F-Secure Freedome VPN v2.45.888.0
    "Apps\F.Secure.Freedome.VPN.v2.45.888.0.exe" /SILENT
    
    REM StartAllBack für Windows 11 v3.3.2.4295 Final
    "Apps\StartAllBack_v3.3.2.4295.exe" /elevated /silent
    
    REM  Patch [Freischaltung]StartAllBack für Windows 11 v3.3.2.4295 Final
    "Apps\StartAllBack_3.x_Patch.exe" /silent
    
    
    
    
    
    echo args: %*
    ::whoami
    timeout /t 25
    del %SYSTEMDRIVE%\MRP_*.log
    shutdown /r /t 60
     
    
    :: done
    exit /b
    
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: .bat script content end - copy-paste RunAsTI snippet ::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    
    #:RunAsTI snippet to run as TI/System, with innovative HKCU load, ownership privileges, high priority, and explorer support 
    set ^ #=& set "0=%~f0"& set 1=%*& powershell -c iex(([io.file]::ReadAllText($env:0)-split'#\:RunAsTI .*')[1])& exit /b
    function RunAsTI ($cmd,$arg) { $id='RunAsTI'; $key="Registry::HKU\$(((whoami /user)-split' ')[-1])\Volatile Environment"; $code=@'
     $I=[int32]; $M=$I.module.gettype("System.Runtime.Interop`Services.Mar`shal"); $P=$I.module.gettype("System.Int`Ptr"); $S=[string]
     $D=@(); $T=@(); $DM=[AppDomain]::CurrentDomain."DefineDynami`cAssembly"(1,1)."DefineDynami`cModule"(1); $Z=[uintptr]::size
     0..5|% {$D += $DM."Defin`eType"("AveYo_$_",1179913,[ValueType])}; $D += [uintptr]; 4..6|% {$D += $D[$_]."MakeByR`efType"()}
     $F='kernel','advapi','advapi', ($S,$S,$I,$I,$I,$I,$I,$S,$D[7],$D[8]), ([uintptr],$S,$I,$I,$D[9]),([uintptr],$S,$I,$I,[byte[]],$I)
     0..2|% {$9=$D[0]."DefinePInvok`eMethod"(('CreateProcess','RegOpenKeyEx','RegSetValueEx')[$_],$F[$_]+'32',8214,1,$S,$F[$_+3],1,4)}
     $DF=($P,$I,$P),($I,$I,$I,$I,$P,$D[1]),($I,$S,$S,$S,$I,$I,$I,$I,$I,$I,$I,$I,[int16],[int16],$P,$P,$P,$P),($D[3],$P),($P,$P,$I,$I)
     1..5|% {$k=$_; $n=1; $DF[$_-1]|% {$9=$D[$k]."Defin`eField"('f' + $n++, $_, 6)}}; 0..5|% {$T += $D[$_]."Creat`eType"()}
     0..5|% {nv "A$_" ([Activator]::CreateInstance($T[$_])) -fo}; function F ($1,$2) {$T[0]."G`etMethod"($1).invoke(0,$2)}   
     $TI=(whoami /groups)-like'*1-16-16384*'; $As=0; if(!$cmd) {$cmd='control';$arg='admintools'}; if ($cmd-eq'This PC'){$cmd='file:'}
     if (!$TI) {'TrustedInstaller','lsass','winlogon'|% {if (!$As) {$9=sc.exe start $_; $As=@(get-process -name $_ -ea 0|% {$_})[0]}}
     function M ($1,$2,$3) {$M."G`etMethod"($1,[type[]]$2).invoke(0,$3)}; $H=@(); $Z,(4*$Z+16)|% {$H += M "AllocHG`lobal" $I $_}
     M "WriteInt`Ptr" ($P,$P) ($H[0],$As.Handle); $A1.f1=131072; $A1.f2=$Z; $A1.f3=$H[0]; $A2.f1=1; $A2.f2=1; $A2.f3=1; $A2.f4=1
     $A2.f6=$A1; $A3.f1=10*$Z+32; $A4.f1=$A3; $A4.f2=$H[1]; M "StructureTo`Ptr" ($D[2],$P,[boolean]) (($A2 -as $D[2]),$A4.f2,$false)
     $Run=@($null, "powershell -win 1 -nop -c iex `$env:R; # $id", 0, 0, 0, 0x0E080600, 0, $null, ($A4 -as $T[4]), ($A5 -as $T[5]))
     F 'CreateProcess' $Run; return}; $env:R=''; rp $key $id -force; $priv=[diagnostics.process]."GetM`ember"('SetPrivilege',42)[0]   
     'SeSecurityPrivilege','SeTakeOwnershipPrivilege','SeBackupPrivilege','SeRestorePrivilege' |% {$priv.Invoke($null, @("$_",2))}
     $HKU=[uintptr][uint32]2147483651; $NT='S-1-5-18'; $reg=($HKU,$NT,8,2,($HKU -as $D[9])); F 'RegOpenKeyEx' $reg; $LNK=$reg[4]
     function L ($1,$2,$3) {sp 'HKLM:\Software\Classes\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}' 'RunAs' $3 -force -ea 0
      $b=[Text.Encoding]::Unicode.GetBytes("\Registry\User\$1"); F 'RegSetValueEx' @($2,'SymbolicLinkValue',0,6,[byte[]]$b,$b.Length)}
     function Q {[int](gwmi win32_process -filter 'name="explorer.exe"'|?{$_.getownersid().sid-eq$NT}|select -last 1).ProcessId}
     $11bug=($((gwmi Win32_OperatingSystem).BuildNumber)-eq'22000')-AND(($cmd-eq'file:')-OR(test-path -lit $cmd -PathType Container))
     if ($11bug) {'System.Windows.Forms','Microsoft.VisualBasic' |% {[Reflection.Assembly]::LoadWithPartialName("'$_")}}
     if ($11bug) {$path='^(l)'+$($cmd -replace '([\+\^\%\~\(\)\[\]])','{$1}')+'{ENTER}'; $cmd='control.exe'; $arg='admintools'}
     L ($key-split'\\')[1] $LNK ''; $R=[diagnostics.process]::start($cmd,$arg); if ($R) {$R.PriorityClass='High'; $R.WaitForExit()}
     if ($11bug) {$w=0; do {if($w-gt40){break}; sleep -mi 250;$w++} until (Q); [Microsoft.VisualBasic.Interaction]::AppActivate($(Q))}
     if ($11bug) {[Windows.Forms.SendKeys]::SendWait($path)}; do {sleep 7} while(Q); L '.Default' $LNK 'Interactive User'
    '@; $V='';'cmd','arg','id','key'|%{$V+="`n`$$_='$($(gv $_ -val)-replace"'","''")';"}; sp $key $id $($V,$code) -type 7 -force -ea 0
     start powershell -args "-win 1 -nop -c `n$V `$env:R=(gi `$key -ea 0).getvalue(`$id)-join''; iex `$env:R" -verb runas
    }; $A=$env:1-split'"([^"]+)"|([^ ]+)',2|%{$_.Trim(' "')}; RunAsTI $A[1] $A[2]; #:RunAsTI lean & mean snippet by AveYo, 2022.01.28
    
    
     
  14. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    Office being install via setupcomplete etc will add a lot of extra time , i can see why some would do it to make a system 'ready' but i find office takes longer to install than the actual OS!!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    @KleineZiege

    Try the MRP option NOT to clean/delete the Scripts folder after completion as then it should allow any extra scripts you use to run without being removed, that option was added ages ago to allow such user scripts to work and MRP not interfere with the Scripts folder.

    If MRP detects non MRP files in the Scripts folder it will auto move the MRP files out the way to prevent those sort of scenarios where added user scripts etc was wiped by mistake.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,694
    1,932
    60
    ne firstlogon it is
     
  17. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    5,780
    19,353
    180
    Firstlogon is ran along side setupcomplete it may be run before setupcomplete.cmd as i cant remember the order in which they are run in, but both are run AFTER the user is created.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,694
    1,932
    60
    i do not use ini from them
    with this is set via regtweaks or via RunAsTI.

    I can gladly provide you with my complete $OEM$ folder in private