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. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    Hello mate, thanks a lot for testing :) I really appreciate your systematic work. I have added your explanation part to the readme for the services removal feature.
    Have also enabled again the MBR boot option in the new ISO creation method of @GodHand. Want to stay as close as possible to his work. Am also thinking for a PR to his main project, trying to make a clean code :rolleyes:

    Maybe soon will make a release have gathered enough changes :)
     
  2. AveYo

    AveYo MDL Expert

    Feb 10, 2009
    1,836
    5,685
    60
    #1342 AveYo, Sep 30, 2021
    Last edited: Sep 30, 2021
    xinso-ed :yeahyeah:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    Hello @BAU . I kinda knew that maybe could be a reaction from you. :D
    Mate your code is incredibly 90% the same as the new code. You are using the same powershell objects and components. I don't know for the c# code, as i have absolutely no c# knowledge so can't speak about that, but maybe that is also the same.

    Actually i took the ".psobject.BaseObject" solution from your code. Otherwise implementing the boot options array would have never worked.

    Personally speaking i do not care about coding style ;). So for me is not at all relevant that. Despite that i make an effort to do styled code as well.

    I just prefer to stick closer to the main project code as this is just a fork. But absolutely your coding skills are not questioned here :cool:. In fact i will give you credit in the repo as well, coz you have your contribution in the code.

    For any kind of suggestion just let me know and i will insert it. I am not biased at all. I am just workaholic dev that just loves to make things done and learn new technologies.
     
  4. AveYo

    AveYo MDL Expert

    Feb 10, 2009
    1,836
    5,685
    60
    I wanted to brag a bit that I've inspired the gods (pun intended). my moment of gratification has passed, so please don't.
    follow the main project and the original style, it's good practice no matter what I or any one else ramble about it
    just don't call other style not "clean", powershell event log says otherwise :rolleyes: - also, I wash my code twice a.. year
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    No worries i can smell it clean already :). For sure you both are gods for me as devs :rolleyes:
     
  6. spanishfly

    spanishfly MDL Senior Member

    Dec 5, 2018
    352
    527
    10
    I get your reference!
    But you were too late! We have forever at least some of your "brag" trapped in the reply! :p
    My 2 cents on your original now xinso-ed statement. I actually learned a ton of powershell studying the original single page all-in-one optimize-offline script of many years ago. If I was stepping into this project right-now, I'd have to stare at the code a lot longer to figure anything out. Having said that, your super-compact style forces me to stare pretty hard at your scripts to see what you're up to as well!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
  8. Dgk

    Dgk MDL Member

    Jan 18, 2020
    145
    52
    10
    Since you are following W11 tinkering - what is the current status of achieving Optimize-Offline on W11 image?
    I guess since I dont really use anything except removal of packages and features it is already doable for me to do manually, I guess. The only question is what can be safely removed this time
     
  9. spanishfly

    spanishfly MDL Senior Member

    Dec 5, 2018
    352
    527
    10
    #1350 spanishfly, Sep 30, 2021
    Last edited: Oct 23, 2021
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. spanishfly

    spanishfly MDL Senior Member

    Dec 5, 2018
    352
    527
    10
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. strotee

    strotee MDL Member

    Jan 30, 2011
    228
    204
    10
    I'm having issues with Optimize-Offline-4.0.1.9-gdeliana-1, specifically FeaturesToDisable (thankfully, I still have beta 5 and that works well). It's giving me the red text error ([ERROR]: Failed to Disable Optional Features) as it tries to runs through FeaturesToDisable.

    Configuration.json:
    Code:
    {
      "_Info": [],
      "SourcePath": "Z:\\Projects\\OS\\Windows\\Client\\10\\17763.2183.iso",
      "FeaturesToDisable": "List",
      "DaRT": [],
      "Registry": true,
      "Additional": {
        "RegistryTemplates": true
      },
      "ISO": "Prompt",
      "CompressionType": "Maximum",
      "SelectiveRegistry": {
        "DisableWindowsUpdate": false,
        "DisableDriverUpdate": false,
        "DormantOneDrive": true
      }
    }
    OptimizeErrors.log:
    Code:
    Index     : 0
    Exception : The specified module could not be found.
             
    Category  : NotSpecified: (:) [Disable-WindowsOptionalFeature], COMException
    ErrorID   : Microsoft.Dism.Commands.DisableWindowsOptionalFeatureCommand
    Target    :
    Command   : [Void](Disable-WindowsOptionalFeature @DisableFeatureParams)
    Script    : Z:\Projects\OS\Windows\Client\10\tools\Optimize-Offline-4.0.1.9-gdeliana-1\Optimize-Offline.psm1
    Line      : 1201
    Column    : 14
    
    FeaturesToDisable.json
    Code:
    {
       "FeatureName" : [
           "FaxServicesClientPackage"
       ]
    }
    
     
  12. AveYo

    AveYo MDL Expert

    Feb 10, 2009
    1,836
    5,685
    60
    is the removal done blindly, without querying if the feature is available first?
    querying should be possible, but I guess just "blacklists" with packages not present in LTS* sources would do
    could also silence the errors since the script continues anyway without issues (or so it should, still haven't run it myself, but will do at some point)
    @strotee, I suppose you can just ignore the "red text" for now - in this case is just informational, and should help you learn what is present, what is not, what can be removed
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. strotee

    strotee MDL Member

    Jan 30, 2011
    228
    204
    10
    Unfortunately, it kills the entire run. My "template" lists are always ran with populatelists beforehand so it "should" be there, right?
     
  14. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
    Really only been monitoring @gdeliana's commits and haven't had a chance to test out latest changes - mostly because my daily driver 21390 was due to expire
    have opted to upgrade to 22468 only to find that it operates a little differently than it does in a VM... go figure...

    Will try and get around to having a look at your query and hopefully come up with an answer (maybe even before someone else)
     
  15. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    Will have a look at this one, could be a bug from my side.
     
  16. zbigniew59

    zbigniew59 MDL Senior Member

    May 14, 2016
    374
    171
    10
    I've been using this script for a long time - but on the last builds 19043 and 19044 I have a problem - according to my lists - 19043 everything works fine after installation.
    The same scrypt - WITH THE SAME LISTS - on 19044 - has an error after installation - right mouse button / personalize / Display settings - closes the window.
    The same - Settings / System - closes the window.
    Anyone know why? How do they differ in this?

    I include my whitelists - I don't use any other lists.
    {
    "Name": [
    "Browser.InternetExplorer~~~~0.0.11.0",
    "DirectX.Configuration.Database~~~~0.0.1.0",
    "Language.Handwriting~~~pl-PL~0.0.1.0",
    "Language.OCR~~~pl-PL~0.0.1.0",
    "Language.Speech~~~pl-PL~0.0.1.0",
    "Microsoft.Windows.MSPaint~~~~0.0.1.0",
    "Media.WindowsMediaPlayer~~~~0.0.12.0",
    "Language.Speech~~~pl-PL~0.0.1.0",
    "Microsoft.Windows.PowerShell.ISE~~~~0.0.1.0",
    "NetFX3~~~~",
    "Print.Fax.Scan~~~~0.0.1.0",
    "Print.Management.Console~~~~0.0.1.0",
    "Windows.Client.ShellComponents~~~~0.0.1.0",
    "Microsoft.Windows.Notepad~~~~0.0.1.0",
    "Windows.Kernel.LA57~~~~0.0.1.0"
    ]
    }

    -
    {
    "FeatureName": [
    "MicrosoftWindowsPowerShellV2",
    "Internet-Explorer-Optional-amd64",
    "MicrosoftWindowsPowerShellV2Root",
    "MSRDC-Infrastructure",
    "Printing-XPSServices-Features",
    "Windows-Defender-Default-Definitions",
    "SmbDirect",
    "WindowsMediaPlayer",
    "WorkFolders-Client"
    ]
    }

    -
    {
    "FeatureName": [
    "MicrosoftWindowsPowerShellV2",
    "Internet-Explorer-Optional-amd64",
    "MicrosoftWindowsPowerShellV2Root",
    "MSRDC-Infrastructure",
    "Printing-XPSServices-Features",
    "Windows-Defender-Default-Definitions",
    "SmbDirect",
    "WindowsMediaPlayer",
    "WorkFolders-Client"
    ]
    }

    -
    {
    "DisplayName": [
    "Microsoft.VCLibs.140.00",
    "CortanaApp.View.App",
    "Microsoft.UI.Xaml.2.4",
    "Microsoft.BingNews",
    "Microsoft.BingWeather",
    "Microsoft.HEIFImageExtension",
    "Microsoft.DesktopAppInstaller",
    "CortanaApp.View.App",
    "Microsoft.VP9VideoExtensions",
    "Microsoft.WebMediaExtensions",
    "Microsoft.windowscommunicationsapps",
    "MicrosoftWindows.Client.WebExperience",
    "Microsoft.WindowsStore",
    "Microsoft.WebpImageExtension",
    "Microsoft.StorePurchaseApp",
    "Microsoft.WindowsTerminal"
    ]
    }
     
  17. strotee

    strotee MDL Member

    Jan 30, 2011
    228
    204
    10
    #1360 strotee, Oct 1, 2021
    Last edited: Oct 1, 2021