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

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    Usually it's updated every week to week-and-a-half. I'm not sure how quickly you expect updates but debugging in itself can take quite some time, considering I have to run it on multiple independent images of different editions, apply said images to virtual machines and then put them under various forms of runtime load while auditing logs with my server to ensure things are running as they should be.

    Moreover, I have never just updated due to one specific issue unless that issue is severe. I prefer to update with a handful of fixes that need addressed at once rather than having a new update every other day just for one single 'fix' that does not necessary result in any finalization improvements (i.e. resource function code optimizations).

    As far as the GUI version is concerned - it's been complete for a while; however, its WimgApi and Dism dynamic library (.dll files) C# wrappers have required recent updates which I addressed in another thread last week on here.

    *EDIT*

    Also, I am testing a newer version with 19041.1 (20H1)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. petok

    petok MDL Senior Member

    May 4, 2009
    340
    187
    10
    I also test script on 19041.1 with latest script (but with modification I no like some option and make customized), before is unsupported arch.
     
  3. GodHand

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    20H1 has a handful of registry and policy related changes as well as layout and some metadata changes. The removal processes of Optimize-Offline run universally across builds, however.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. petok

    petok MDL Senior Member

    May 4, 2009
    340
    187
    10
    Yes, I know. I change script to work just for remove system appx, bundle appx and disable features - for registry I import custom reg file before starting scripts.

    PS: This is just for idea. I like, if can you remove registry parameters from Optimize-Offline.psm1 and import into other (ex. Tweaks_Optimize.ps1) file be clean and fast edit script. If can to be just Optimize-Offline.psm1 be caller on all other scripts.
     
  5. megaborg

    megaborg MDL Novice

    Nov 14, 2009
    11
    3
    0
    Hi GodHand first off all thanks for your beautiful program which is very useful for me.
    I'd like to know if possible what does it mean:
    Can you explain in a few words how do you do that exactly , since i'm very curious to know your method to ensure thing are running correctly,obviously if you want to share this.
    Thanks again for your script....bye
     
  6. GodHand

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    #286 GodHand, Feb 13, 2020
    Last edited: Feb 13, 2020
    I use a script that utilizes the VirtDisk.dll (a library for VHD management APIs) and WimgApi.dll. It basically creates multiple sparse VHDXs and WimgApi applies multiple images to each. Because I use the native APIs, this can be done in a PE environment, x86 environment, etc. and does not require Hyper-V to be present on the device (nor does one have to use Hyper-V's abysmal cmdlets and GUI). Then they're made bootable, added to a Hyper-V Converged Cluster and controlled with Windows Admin Center. They're basically set up like an independent virtual network infrastructure. Since each has its own isolated NIC/hardware throughput (as well as any shielding/security one may implement), they do everything an independent machine would do that is not connected to a network or server infrastructure, and the actual server itself does nothing other than audit logs using User Right privileges via GPO. Likewise, you can also debug in real time using programs like Visual Studio, etc.

    I also will deploy them over a network using SCCM and the default Windows Server Deployment Services.

    Everything on my Server is virtual. I create virtual machines (many dedicated) to run all databases (SQL and the like) and absolutely nothing from the public internet interacts with the actual hardware of the server or directly with the server. Everything is managed using Failover Clustering or on a Converved Infrastructure which are entirely virtual. The virtual environments themselves can then be monitored and controlled however one sees fit, or whatever is required for the environment one creates.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. megaborg

    megaborg MDL Novice

    Nov 14, 2009
    11
    3
    0
    Wow,really thanks for your explanation,it's really a long and hard work so thanks again for your program.
     
  8. GodHand

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    It's not really hard work at all to set up a virtual system similar to mine. What can be problematic for some (or, rather, a hindrance) is the cost of the hardware required. Each virtual environment you create requires a specific amount of hardware throughput to run optimally in order to attain accurate data. SQL databases require very little, whereas my Onion router, as well as linking to other networks, can require a significant amount due to the implementation of security features like SSL/TLS and the fact it will be used for constant traffic. As an example, I help host a few very popular Discord bots that are in over 1,000 channels each, and are constantly requesting/updating/returning data to whatever queries it. I can easily log over 500k individual queries in a 12 hour period per bot.

    Conversely, it's not difficult nor is any server-specific grade hardware required for deploying images, creating them or testing them in moderate environments.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. FlyTech

    FlyTech MDL Novice

    Sep 24, 2009
    19
    3
    0
    Anyone use this script successfully with a Enterprise 17763.1012 LTSC iso. If so, can you point out what I'm doing wrong.
    To start script I have to type./Start-Optimize twice to get it to start. The first attempt always displays this..

    "./Start-Optimize : Cannot bind argument to parameter 'Path' because it is null.
    At line:1 char:1
    + ./Start-Optimize
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (C:\Optimize\Optimize-Offline.psm1:String) [], RuntimeException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Resolve-FullPath"

    The second attempt typing ./Start-Optimize always starts the script. Below is my configuration.json selections..


    "SourcePath": "C:\\10\\enterprise_ltsc_2019.iso",
    "WindowsApps": "All",
    "SystemApps": true,
    "Capabilities": true,
    "Packages": true,
    "Features": true,
    "DeveloperMode": false,
    "WindowsStore": false,
    "MicrosoftEdge": false,
    "Win32Calc": false,
    "Dedup": false,
    "Registry": true,
    "Additional": {
    "Setup": false,
    "Wallpaper": false,
    "SystemLogo": false,
    "LockScreen": false,
    "RegistryTemplates": false,
    "Unattend": false,
    "Drivers": false,
    "NetFx3": true
    },
    "ISO": "Prompt"

    I never get the Remove Appx Provisioned Packages grid window to show up no matter what selection I choose, All, Select or Whitelist in the json.
    with the script starting at the Remove System Apps Gridview. After the process of removing my System Apps I selected, the script displays another window which display the following
    Failed to import custom app associations
    The window closes quickly and the script moves on through the
    various selections gridview windows. At the end of the script just right after i choose the compression
    method, it errors out with this message...

    [​IMG]

    Any suggestions greatly appreciated
     

    Attached Files:

  10. FlyTech

    FlyTech MDL Novice

    Sep 24, 2009
    19
    3
    0
    After posting, I finally read all the pages in this thread, which lead me back to the script creators github page. Clicking on the issues tab I discovered the issue i was having was posted there by another script user who was using a LTSC copy like myself. The solution was to install ADK. The host OS I was using the script on and getting errors is LTSC 2019 and after installing ADK the script ran smoothly. The script completed in 12 mins without any errors on an W10UI_8.0 updated copy of Windows 10 Enterprise (N) LTSC 2019. Thanks for the help, and the moral of the story is to not be lazy like me and read through all the thread first before posting.
     
  11. Mavericks Choice

    Mavericks Choice MDL Guru

    Aug 5, 2015
    2,910
    12,469
    90
    Yes I like to have the ADK tools installed anyway, you download it once & can move it easily to any PC from there.
     
  12. Brother please install win10 ADK 1809 before executing the script on your host machine.
    i hope single error will be resolved after that as i get the same error & as per suggestion by brother kedarworlf i installed win 10 adk 17763 / 1809 . then all i got is no error left at completion of script.
     
  13. akhmedtaia

    akhmedtaia MDL Addicted

    Nov 2, 2013
    518
    138
    30
  14. Heimnetz

    Heimnetz MDL Novice

    Jun 5, 2014
    14
    3
    0
    very good work in "Optimize-Offline 4.0..0.6.
    i work on a german *.wim
    My canged in configuration.json:
    {
    "_Info": [
    "This is a JSON based Configuration file for Optimize-Offline.",
    "Ensure proper formatting is used when editing the JSON parameter values.",
    "Boolean parameter values use true and false. String parameter values must be enclosed in double-quotes."
    ],
    "SourcePath": "E:\Win10\install.wim",
    "WindowsApps": "Select",
    "SystemApps": true,
    "Capabilities": true,
    "Packages": true,
    "Features": true,
    "DeveloperMode": false,
    "WindowsStore": false,
    "MicrosoftEdge": false,
    "Win32Calc": true,
    "Dedup": true,
    "Registry": true,
    "Additional": {
    "Setup": false,
    "Wallpaper": true,
    "SystemLogo": true,
    "LockScreen": true,
    "RegistryTemplates": false,
    "Unattend": false,
    "Drivers": false,
    "NetFx3": false
    },
    }


    and
    In the Start-Optimuze.ps1 --> line 82
    Optimize-Offline -SourcePath "E:\Win10\install.wim" -WindowsApps "Select" -SystemApps -Capabilities -Features -Win32Calc -Additional @{ Wallpaper = $true; SystemLogo = $true; LockScreen = $true; }
     
  15. Zeuskk

    Zeuskk MDL Novice

    Aug 27, 2013
    5
    0
    0
    Can I somehow install Windows Defender in Windows 10 LTSC, because by accident I removed it from my installer?
     
  16. BigheadSMZ

    BigheadSMZ MDL Novice

    Aug 9, 2015
    2
    0
    0
    First I want to say, this script is great! I've been using enterprise ltsc for awhile now but recently purchased ryzen 3700x so I needed a more recent build (1903+ for the AMD optimizations). So looking for an alternative for a "stripped down" version of Windows I found this, figured it out, and I love it.

    With that said, I did find an issue with defender and the registry optimizations. If keeping "Microsoft.Windows.SecHealthUI" enabled and using the registry optimizations, the firewall part of defender will work but the virus and threat protection part will not. Attempting to open "Virus & threat protection" displays the following: You'll need a new app to open this windowsdefender. After multiple attempts, about 10+ virtualbox installs, disabling only the registry optimizations seemed to fix the issue and defender works properly.
     
  17. spanishfly

    spanishfly MDL Senior Member

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