MSMG ToolKit

Discussion in 'MDL Projects and Applications' started by MSMG, Nov 21, 2013.

  1. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    5,430
    11,396
    180
  2. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    5,430
    11,396
    180
    1) Will think of it either to add an option or add back functionality.

    2) Though it says it's applicable to WinPE image but need to test it whether the component need to be updated exists in the WinRE.wim

    3) It says it's applicable to WinPE image but the component need to be updated does not exists in the WinRE.wim

    Have fixed the Toolkit script not to add Secure Boot DBX update to winre.wim, do check the download link for Toolkit.cmd

     
  3. geese howard

    geese howard MDL Junior Member

    Aug 18, 2009
    75
    12
    0
    #18664 geese howard, Mar 3, 2021
    Last edited: Mar 3, 2021
    No.

    Is it KB4598481?
     
  4. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    35,561
    59,624
    450
    #18665 Enthousiast, Mar 3, 2021
    Last edited: Mar 3, 2021
    No, that is the Jan. 2021 19041.740 SSU, but the lowest required SSU for .844 = 19041.504 = KB4577266.

    The SSU inside the 844 combined LCU/SSU is SSU-19041.841-x64.cab = KB5000911
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Rr0

    Rr0 MDL Member

    Jul 8, 2017
    151
    13
    10
    What should I remove from 21h1 to completely purge windows' built in antivirus?
    Just [24] + Windows Defender App ?
    What is [G] + Security Center | Depends on: Windows Defender

    What other apps are 100% rock solid safe to remove? The only thing I need is Microsoft Store. I don't use weather, mail,
     
  6. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    5,430
    11,396
    180
    Just Remove Windows Defender which will eventually remove Security Center, Security Center is the applet present in Control panel which is used to set the notifications for security related features.

    To have build like LTSC + Store App :

    1) Select Everything from Windows Apps and de-select Windows Store App, Xbox Identity Provider, Store Purchase App
    2) Remove the selected Windows Apps

    The reset of the components will depend upon your needs.

     
  7. haz367

    haz367 MDL Senior Member

    Jan 11, 2020
    325
    415
    10
  8. forslaey

    forslaey MDL Novice

    Mar 4, 2021
    7
    5
    0
    Hello everyone. I am a newbie, I recently got acquainted with your wonderful tool and am trying to figure it out, please answer if it does not take you a lot of time for a few stupid questions. Sorry, I do not speak the language well, so I am writing through the google translator.

    - Enable Fraunhofer MP3 Professional Codec (does this provide any advantage and in which applications are these codecs used?)
    - Force .NET Programs to Use Newest .NET Framework (is it for dependent applications to use .NET 4.8, there will be no errors because of this?)
    - Please give advice, maybe someone has a long-proven and ready-made list for removing applications from windows, which will never cause problems for users?

    What is the compression ratio of the image when converting to .esd? The same as / Compress: recovery or another, can I set the compression ratio of the images myself?
     
  9. geese howard

    geese howard MDL Junior Member

    Aug 18, 2009
    75
    12
    0
    Both installed, error persists (0x800f081f, 0x800f0988)
     
  10. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    5,430
    11,396
    180
    - Enable Fraunhofer MP3 Professional Codec is used in Audio Video Editing/Conversion Software.
    - Force .NET Programs to Use Newest .NET Framework can able applications written in older framework to use the latest one but few people had reported it to causes errors for some programs.
    - The full list is found in <Bin\Lists\ToolKitHelper_Templates> folder and the compatibility info is present in the menus.

    IE is required for Online Installers like Adobe, WMP may be required for some Multimedia softwares.

    The DISM is used for all image related operations expect the removal so the compression ratio is same.

     
  11. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    5,430
    11,396
    180
    Will check.

     
  12. haz367

    haz367 MDL Senior Member

    Jan 11, 2020
    325
    415
    10
    @MSMG

    Ok, i stand correct...You are correct, as on a fresh VM OS the sourcehash file isn't installed, must be Office or something then....I'll redo it on the VM.

    It's weird tho...as it seems to work just fine on my main W7 OS.

    Everything is perfect, identical each time i recapture the files, as it should be according to your guide/tips except for the "Program Files (x86) folder from the X64 OS. Those files are identical as on x86, and those get set correctly, as the "Program Files" folder from X64

    Something fishy about this (x86) one for sure :p

    PS: How do you set the folder permissions btw if i may ask? As those are not correct when you just capture and build the tpk.
     
  13. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    5,430
    11,396
    180
    I do not set the permissions, I do capture the initial ESD using wimlib-imagex.exe with a script containing the list of files to be captured.

    Command used to capture the image

    Code:
    wimlib-imagex capture C:\ PowerShell7_w7_x64.esd test test --compress=LZMS --solid --config=scripts\PowerShell7.ini >nul
    
    Contents of PowerShell7.ini

    Code:
    [ExclusionList]
    \
    
    [ExclusionException]
    \Program Files\PowerShell
    \Program Files (x86)\PowerShell
    \ProgramData\Microsoft\NetFramework\BreadcrumbStore
    \ProgramData\Microsoft\Windows\Start Menu\Programs\PowerShell
    \Windows\Installer
    
    For Windows 7 the below line is not required

    Code:
    \ProgramData\Microsoft\NetFramework\BreadcrumbStore
    
    If your system is already affected by folder permission bug then it's a tedious task to fix it, better you may re-install the OS.

     
  14. haz367

    haz367 MDL Senior Member

    Jan 11, 2020
    325
    415
    10
    @MSMG

    Oh..ok. It should work out of the box

    I fix it this way and it works fine except for "index2" Program Files (x86) that one keeps giving NT Security: xxxxx Domain d:xxxx

    Adapt it for new x86/64 builds. Not sure where the folder permission bug is coming from as it's a fresh OS install, nothing else added...Only the required stuff for PowerShell. Have to try again on vm then...

    Code:
    @echo off
    
    setlocal enabledelayedexpansion
    
    pushd "%~dp0bin"
    
    if exist "%windir%\SysWOW64" set "arch=x64"
    if not exist "%windir%\SysWOW64" set "arch=x86"
    
    set wimlib=%~dp0bin\%arch%\wimlib-imagex.exe
    set dism=%~dp0bin\%arch%\dism10\dism
    set nsudo=%~dp0bin\%arch%\nsudo
    set icacls=%~dp0bin\%arch%\icacls.exe
    set cecho=%~dp0bin\%arch%\cecho.exe
    set psini=%~dp0bin\%arch%\PowerShell.ini
    
    %cecho% {07}Create {0a}PowerShell Build 7.x.x X86 {07}:: {0a}X64 TPK Package {#}
    echo.
    echo.
    
    echo.
    echo.
    
    %cecho% {07}[1] {0a}:: {1f}Capture PowerShell Build 7.x.x X86 {#}
    echo.
    echo.
    
    rem wimlib -- x86 config.ini
    %nsudo% -U:T -P:E cmd /c %wimlib% capture c:\ %~dp0bin\x86\PowerShell7_WIN7_x86.wim "Windows PowerShell 7.1.2 (x86)" "Windows PowerShell 7.1.2 (x86)" --config=%psini%
    
    rem wimlib -- x86 source.txt command 1
    rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x86\PowerShell_X86-source.txt %~dp0bin\x86\powershell7_WIN7_x86.wim --source-list
    
    rem wimlib -- source.txt command 2
    rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x86\PowerShell_X86-source.txt %~dp0bin\x86\powershell7_WIN7_x86.wim --strict-acls --source-list
    
    :nxt
    
    %cecho% {07}[2] {0a}:: {1f}Capture PowerShell Build 7.x.x X64 {#}
    echo.
    echo.
    
    rem wimlib -- x64 config.ini
    %nsudo% -U:T -P:E cmd /c %wimlib% capture M:\ %~dp0bin\x64\PowerShell7_WIN7_x64.wim "Windows PowerShell 7.1.2 (x64)" "Windows PowerShell 7.1.2 (x64)" --config=%~dp0bin\x64\PowerShell.ini
    
    rem wimlib -- x64 source.txt command 1
    rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x64\PowerShell_X64-source.txt %~dp0bin\x64\powershell7_WIN7_x64.wim --source-list
    
    rem wimlib -- x64 source.txt command 2
    rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x64\PowerShell_X64-source.txt %~dp0bin\x64\powershell7_WIN7_x64.wim --strict-acls --source-list
    
    echo.
    pause
    
    :nxt2
    
    echo.
    
    %cecho% {07}[3] {0a}:: {07}Apply the {0a}PowerShell 7.x.x {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}WIM Images {#}
    echo.
    echo.
    
    md %~dp0bin\x86mount >nul
    md %~dp0bin\x64mount >nul
    timeout /t 2 >nul
    
    %dism% /Apply-Image /ImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86.wim /Index:1 /ApplyDir:%~dp0bin\x86mount /CheckIntegrity /Verify
    %dism% /Apply-Image /ImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64.wim /Index:1 /ApplyDir:%~dp0bin\x64mount /CheckIntegrity /Verify
    
    echo.
    pause
    
    :nxt3
    
    echo.
    
    %cecho% {07}Note: {0a}Modify the mountfolders incase required... {#}
    echo.
    echo.
    pause
    
    echo.
    
    %cecho% {07}[4] {0a}:: {07}Fix and set the folder permissions and attributes correctly...{#}
    echo.
    echo.
    
    rem md "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework\BreadcrumbStore"
    rem md "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework\BreadcrumbStore"
    
    rem for /f "delims=" %%L in (%~dp0bin\x86\BreadcrumbStore_x86.txt) do copy "%%L" "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework\BreadcrumbStore"
    rem for /f "delims=" %%L in (%~dp0bin\x86\BreadcrumbStore_x86.txt) do copy "%%L" "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework\BreadcrumbStore"
    rem xcopy "%~dp0bin\x86mount2\Program Files (x86)\PowerShell" "%~dp0bin\x64mount\Program Files (x86)\PowerShell\" /s /y >nul
    
    rem folder permissions/owner....
    %icacls% "%~dp0bin\x86mount\Program Files" /setowner "NT SERVICE\TrustedInstaller"
    %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files" /setowner "NT SERVICE\TrustedInstaller"
    %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files (x86)" /setowner "NT SERVICE\TrustedInstaller"
    
    %icacls% "%~dp0bin\x86mount\Program Files\PowerShell" /setowner SYSTEM /T
    %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files\PowerShell" /setowner SYSTEM /T
    %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files (x86)\PowerShell" /setowner SYSTEM /T
    
    rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft" /setowner Administrators
    rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft" /setowner Administrators
    rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework" /restore "%~dp0bin\installers\BreadcrumbStore_acl"
    rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\NetframeWork" /restore "%~dp0bin\installers\BreadcrumbStore_acl"
    
    %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework" /setowner SYSTEM /T
    %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework" /setowner SYSTEM /T
    
    rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" /setowner SYSTEM /T
    rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" /setowner SYSTEM /T
    rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows" /setowner Administrators
    rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows" /setowner Administrators
    
    %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows\Start Menu" /setowner Administrators
    %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows\Start Menu" /setowner Administrators
    
    %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows\Start Menu\Programs" /setowner Administrators
    %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows\Start Menu\Programs" /setowner Administrators
    
    %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows\Start Menu\Programs\PowerShell" /setowner SYSTEM /T
    %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows\Start Menu\Programs\PowerShell" /setowner SYSTEM /T
    
    rem x86 installer
    %icacls% "%~dp0bin\x86mount\Windows\Installer\{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM
    %icacls% "%~dp0bin\x86mount\Windows\Installer\SourceHash{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM
    %icacls% "%~dp0bin\x64mount\Windows\Installer\{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM
    %icacls% "%~dp0bin\x64mount\Windows\Installer\SourceHash{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM
    rem x64 installer
    %icacls% "%~dp0bin\x64mount\Windows\Installer\{357A3946-1572-4A21-9B60-4C7BD1BB9761}" /setowner SYSTEM
    %icacls% "%~dp0bin\x64mount\Windows\Installer\SourceHash{357A3946-1572-4A21-9B60-4C7BD1BB9761}" /setowner SYSTEM
    
    
    rem Set folder and files attributes
    
    attrib -i "%~dp0bin\x86mount\Program Files"
    attrib -i "%~dp0bin\x86mount\Program Files\*.*" /s /d
    attrib -i "%~dp0bin\x64mount\Program Files"
    attrib -i "%~dp0bin\x64mount\Program Files\*.*" /s /d
    
    attrib +r "%~dp0bin\x86mount\Program Files"
    attrib +r "%~dp0bin\x64mount\Program Files"
    
    attrib -i "%~dp0bin\x86mount\ProgramData\*.*" /s /d
    attrib -i "%~dp0bin\x64mount\ProgramData\*.*" /s /d
    
    attrib -i "%~dp0bin\x86mount\Windows\Installer\*.*" /s
    attrib -i "%~dp0bin\x64mount\Windows\Installer\*.*" /s
    attrib -i "%~dp0bin\x86mount\Windows"
    attrib -i "%~dp0bin\x64mount\Windows"
    attrib -a "%~dp0bin\x86mount\Windows"
    attrib -a "%~dp0bin\x64mount\Windows"
    
    attrib -i "%~dp0bin\x86mount"
    
    echo.
    timeout /t 5 >nul
    
    :nxt4
    
    echo.
    
    %cecho% {07}[5] {0a}:: {07}Capture the {0d}PowerShell7 {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}mounted Builds to {0a}WIM Images... {#}
    echo.
    echo.
    
    %dism% /Capture-Image /ImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86_2.wim /CaptureDir:%~dp0bin\x86mount\ /Name:"Windows PowerShell 7.1.2 (x86)" /Description:"Windows PowerShell 7.1.2 (x86)" /Compress:max
    
    %dism% /Capture-Image /ImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64_2.wim /CaptureDir:%~dp0bin\x64mount\ /Name:"Windows PowerShell 7.1.2 (x64)" /Description:"Windows PowerShell 7.1.2 (x64)" /Compress:max
    
    echo.
    pause
    
    :nxt5
    
    echo.
    
    %cecho% {07}[6] {0a}:: {07}Export the {0a}PowerShell7 {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}WIM Images {0e}to {07}ESD Images {0a}:: {0d}LZMS:27 {07}Compression {#}
    echo.
    echo.
    
    %dism% /Export-Image /SourceImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86_2.wim /SourceIndex:1 /Scratchdir:"%~dp0bin\Scratch" /DestinationImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86.tpk /Compress:Recovery
    
    echo.
    pause
    
    %dism% /Export-Image /SourceImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64_2.wim /SourceIndex:1 /Scratchdir:"%~dp0bin\\Scratch" /DestinationImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64.esd /Compress:Recovery
    
    echo.
    pause
    
    :nxt6
    
    echo.
    
    %cecho% {07}[7] {0a}:: {07}Combine the {0a}PowerShell7 {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}ESD Images {#}
    echo.
    echo.
    
    %wimlib% export %~dp0bin\x64\PowerShell7_WIN7_x64.esd 1 %~dp0bin\x86\PowerShell7_WIN7_x86.tpk "Windows PowerShell 7.1.2 (x64)" "Windows PowerShell 7.1.2 (x64)" --compress=LZMS --solid
    
    echo.
    pause
    
    rem %nsudo% -U:T -P:E cmd /c %wimlib% export %~dp0bin\x64\PowerShell7_WIN7_x64_2.wim 1 %~dp0bin\x86\PowerShell7_WIN7_x86_2.tpk "Windows PowerShell 7.1.2 (x64)" "Windows PowerShell 7.1.2 (x64)" --check --solid
    
    rem %wimlib% export "%~dp0bin\x86\PowerShell7_WIN7_x86_2.wim" all "%~dp0bin\x86\PowerShell7_WIN7_3.tpk" --compress=LZMS --solid
    
    rem %nsudo% -U:S -P:E cmd /c %dism% /Export-Image /SourceImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64_2.wim /SourceIndex:1 /DestinationImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86_2.tpk /DestinationName:"Windows PowerShell 7.1.2 (x64)" /Compress:max
    
    rem Optimize the PowerShell7_WIN7 x86/x64 WIM Image  :: Fixes "incorrect reference count" reported by 7zip...
    
    rem %wimlib% optimize %~dp0bin\x86\PowerShell7_WIN7_3.TPK
    
    rem :timer6
    rem for /f %%x in ('tasklist /NH /FI "IMAGENAME eq wimlib-imagex.exe"') DO IF %%x == wimlib-imagex.exe goto busy
    rem goto nxt6
    rem :busy
    rem timeout /t 3 >nul
    rem goto timer6
    
    :nxt7
    
    echo.
    
    %cecho% {0b}Cleanup temp folders and files... {#}
    echo.
    echo.
    
    ren %~dp0bin\x86\PowerShell7_WIN7_x86.tpk PowerShell7_WIN7.tpk >nul
    move /y %~dp0bin\x86\PowerShell7_WIN7.tpk %~dp0bin\tpk\PowerShell >nul
    
    del %~dp0bin\x86\PowerShell7_WIN7_x86.wim >nul
    del %~dp0bin\x64\PowerShell7_WIN7_x64.wim >nul
    del %~dp0bin\x86\PowerShell7_WIN7_x86_2.wim >nul
    del %~dp0bin\x64\PowerShell7_WIN7_x64_2.wim >nul
    del %~dp0bin\x64\PowerShell7_WIN7_x64.esd >nul
    
    rd /s /q %~dp0bin\x86mount >nul
    rd /s /q %~dp0bin\x64mount >nul
    
     
  15. JLT2000

    JLT2000 MDL Novice

    Nov 3, 2020
    36
    14
    0
    Hi MSMG

    I want to integrate language pack into W10 Ltsb EN-US 1607 non-n, so far i got it working without any cu updates

    But when i integrate CU updates it's not working anymore, i know about the setup media after updates, but what package do i need for 1607 non-n

    I have the LP an media-FP packs from you're site installed + the 40mb cab LP file from MS

    I must be missing something
     
  16. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    5,430
    11,396
    180