Optimize-Offline Guide - Windows Debloating Tool, Windows 1803, 1903, 19H2, 1909, 20H1 and LTSC 2019

Discussion in 'Windows 10' started by KedarWolf, Jul 30, 2019.

  1. strotee

    strotee MDL Member

    Jan 30, 2011
    229
    204
    10
    #1801 strotee, Apr 7, 2022
    Last edited: Apr 7, 2022
    Thanks for the new release. Initial thoughts, I encountered an error while running v5 on my PC (OO image). I copied the ISO with the OO files to a virgin VM and it has passed the point I failed on my PC image. Something changed in v5 as I was able to run OO on my PC with the recent commits leading up to v5.

    Edit: Don't get me wrong, it's not the end of the world to have to do this one extra step, but it's certainly convenient to do it locally.
     
  2. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    420
    10
    If you tell me host OS, guest OS, logs? And maybe share configuration.json

    The tool is an open platform, i do not take care of many things, i leave them to the user to decide, so that is why it depends so much on the inputs :)
     
  3. strotee

    strotee MDL Member

    Jan 30, 2011
    229
    204
    10
    #1804 strotee, Apr 7, 2022
    Last edited: Apr 7, 2022
    19044.1620 for everything. By the way, my VM created the ISO and it installed fine in a new VM.

    Edit: I'm re-running the last or 2nd to last committed version and it's running past the part that failed earlier today (v5) just to verify that I wasn't imagining things and it's running locally just fine.
    Code:
    Index     : 0
    Exception : An advanced installer failed during setup or servicing.
            
    Category  : NotSpecified: (:) [Remove-WindowsCapability], COMException
    ErrorID   : Microsoft.Dism.Commands.RemoveWindowsCapabilityCommand
    Target    :
    Command   : [Void](Remove-WindowsCapability @RemoveCapabilityParams)
    Script    : Z:\Projects\OS\Windows\tools\Optimize-Offline\Optimize-Offline-4.0.1.9-gdeliana-5\Optimize-Offline.psm1
    Line      : 1187
    Column    : 14
    
    Code:
    {
      "_Info": [],
      "SourcePath": "Z:\\Projects\\OS\\Windows\\10\\19044.1620.iso",
      "WindowsApps": "Blacklist",
      "SystemApps": "Blacklist",
      "Capabilities": "Blacklist",
      "Packages": "Blacklist",
      "FeaturesToDisable": "List",
      "FeaturesToEnable": "List",
      "DaRT": [],
      "Registry": true,
      "Additional": {
        "Setup": true,
        "RegistryTemplates": true
      },
      "ISO": "Prompt",
      "CompressionType": "Maximum",
      "SelectiveRegistry": {
        "DisableDriverUpdate":true,
        "DormantOneDrive": true,
        "Disable3rdPartyApps": true,
        "W11ClassicContextMenu": true,
        "ExplorerUIRibbon": false,
        "ClassicSearchExplorer": true,
        "RemoveTaskbarPinnedIcons": true,
        "DisableTeamsApp": true,
        "DisableVirtualizationSecurity": false,
        "RunAsTiContextMenu": true,
        "AmoledBlackTheme": true
      }
    }
    
     
  4. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    420
    10
    The error says that some capability selected by you for removal cannot be removed. Can you send me the list of capabilities and maybe packages as well? But keep in mind this known that some capabilities cannot be removed. It happened to me also before.
     
  5. strotee

    strotee MDL Member

    Jan 30, 2011
    229
    204
    10
    #1806 strotee, Apr 7, 2022
    Last edited: Apr 7, 2022
    I typically copy over my Lists folder between versions. I re-ran populateTemplates.bat just to verify I had the right data in the templates file.Again, it works with a version or two ago but it doesn't work with v5.
    The file:
    Code:
    {
       "Name": [
           "App.Support.QuickAssist~~~~0.0.1.0",
           "Hello.Face.18967~~~~0.0.1.0",
           "Hello.Face.Migration.18967~~~~0.0.1.0",
           "MathRecognizer~~~~0.0.1.0",
           "OneCoreUAP.OneSync~~~~0.0.1.0",
           "OpenSSH.Client~~~~0.0.1.0",
           "Print.Fax.Scan~~~~0.0.1.0",
           "Print.Management.Console~~~~0.0.1.0"
       ]
    }
    
     
  6. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    420
    10
    Can you run populateTemplates on your iso? And if you get these in the template list? Maybe one of the packages is not present?
     
  7. strotee

    strotee MDL Member

    Jan 30, 2011
    229
    204
    10
    If you read my previous message, I stated that I did already. I just re-ran populateTemplates now and still receive the same error. Fortunately, there's an old version I can still execute.
     
  8. Mavericks Choice

    Mavericks Choice MDL Guru

    Aug 5, 2015
    2,917
    12,504
    90
    Have you posted up the populated template list perhaps?
     
  9. strotee

    strotee MDL Member

    Jan 30, 2011
    229
    204
    10
    #1811 strotee, Apr 8, 2022
    Last edited: Apr 8, 2022
    CapabilitiesBlacklist.json
    Code:
    {
       "Name": [
                    "App.Support.QuickAssist~~~~0.0.1.0",
                    "Hello.Face.18967~~~~0.0.1.0",
                    "Hello.Face.Migration.18967~~~~0.0.1.0",
                    "MathRecognizer~~~~0.0.1.0",
                    "OneCoreUAP.OneSync~~~~0.0.1.0",
                    "OpenSSH.Client~~~~0.0.1.0",
                    "Print.Fax.Scan~~~~0.0.1.0",
                    "Print.Management.Console~~~~0.0.1.0"
       ]
    }
    
    CapabilitiesTemplate.json
    Code:
    {
        "Name":  [
                     "App.StepsRecorder~~~~0.0.1.0",
                     "App.Support.QuickAssist~~~~0.0.1.0",
                     "Browser.InternetExplorer~~~~0.0.11.0",
                     "DirectX.Configuration.Database~~~~0.0.1.0",
                     "Hello.Face.18967~~~~0.0.1.0",
                     "Hello.Face.Migration.18967~~~~0.0.1.0",
                     "Language.Handwriting~~~en-US~0.0.1.0",
                     "Language.OCR~~~en-US~0.0.1.0",
                     "Language.Speech~~~en-US~0.0.1.0",
                     "MathRecognizer~~~~0.0.1.0",
                     "Media.WindowsMediaPlayer~~~~0.0.12.0",
                     "Microsoft.Windows.MSPaint~~~~0.0.1.0",
                     "Microsoft.Windows.Notepad~~~~0.0.1.0",
                     "Microsoft.Windows.PowerShell.ISE~~~~0.0.1.0",
                     "Microsoft.Windows.WordPad~~~~0.0.1.0",
                     "NetFX3~~~~",
                     "OneCoreUAP.OneSync~~~~0.0.1.0",
                     "OpenSSH.Client~~~~0.0.1.0",
                     "Print.Fax.Scan~~~~0.0.1.0",
                     "Print.Management.Console~~~~0.0.1.0",
                     "Windows.Client.ShellComponents~~~~0.0.1.0"
                 ]
    }
    
    Edit: I just ran OOv5 in a OO'ed VM and it worked so it's a local issue. I'm not sure what I did locally but it's not something that needs addressing so no worries.
     
  10. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    870
    30
    @gdeliana

    If I run the Set-Additional.ps1 I no longer can copy and paste text in the Seach Icon and Windows explorer search text boxes

    I narrowed it down to the Clipboard history tweaks in the .ps1 and if I remove them, the copy and paste works just fine but then I lose any of the clipboard optimizations.

    Can you look into it when you get a chance?
     
  11. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    870
    30
    #1815 KedarWolf, Apr 10, 2022
    Last edited: Apr 12, 2022
    (OP)
    @gdeliana

    DON'T do this on AMD or delete the keys. On my 5950x CPU it lowered multicore on CPU-Z by 200 points and in Cinebench R23 by over 300 points. :(

    Meltdown Mitigation Fix Removal Tweak.

    On AMD it's not affected and helps performance. My y-cruncher benches on my 5950x are a full second faster with that and locked pages in memory.

    You can use it on Intel too if you're not too worried about security.

    Edit: It might be this tweak causes the Windows install to error out if not done AFTER the first boot.

    Testing if it's that in VMWare.

    Yes, you can only do it after you install Windows or your install errors out.

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
    "FeatureSettingsOverride"=dword:00000003
    "FeatureSettingsOverrideMask"=dword:00000003
     
  12. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    420
    10
    Strange i think i removed the clipboard tweak from the script, will have a look again. Which lines of code you removed exactly?
     
  13. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    420
    10
    Wow super thanks on this, my ryzen 3600 will also benefit from this :)
     
  14. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    870
    30
    #1818 KedarWolf, Apr 12, 2022
    Last edited: Apr 12, 2022
    (OP)
    I see you removed the disabling of the service in the last line. I haven't checked since then Let me run the script.

    Code:
    # Disable Clipboard history, its synchronization service and any Remote Desktop redirection.
            If ($Build -ge 17763)
            {
                If (!(Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -ItemType Directory -Force | Out-Null }
                Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name AllowCrossDeviceClipboard -Value 0 -Force
                Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name AllowClipboardHistory -Value 0 -Force
                If (!(Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Terminal Server Client")) { New-Item -Path "HKLM:\SOFTWARE\Microsoft\Terminal Server Client" -ItemType Directory -Force | Out-Null }
                Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Terminal Server Client" -Name DisableClipboardRedirection -Value 1 -Force
                If (!(Test-Path -Path "HKCU:\Software\Microsoft\Clipboard")) { New-Item -Path "HKCU:\Software\Microsoft\Clipboard" -ItemType Directory -Force | Out-Null }
                Set-ItemProperty -Path "HKCU:\Software\Microsoft\Clipboard" -Name EnableClipboardHistory -Value 0 -Force
                Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\cbdhsvc" -Name Start -Value 4 -Force
            }
    I ran the Set-Additional, copy/paste on Explorer search box and the Taskbar Search box working fine now with the service not being disabled. :)
     
  15. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,354
    2,308
    60
    ... I suppose it goes without saying that User would (also) have to delete said keys (If previously applied on running OS) when following the "Upgrade" path?
     
  16. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    420
    10
    So in other words, i put this into set-additional, which can be run logged in