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
    215
    186
    10
    #1881 strotee, May 12, 2022
    Last edited: May 12, 2022
    I shrunk "_Info": [], and your configuration file worked. I too got an error after using your file so give that a try.

    Edit: But specifically, it's the 2nd to last line, "Services : None | Select | List | Advanced", (comma was missing)
     
  2. Mavericks Choice

    Mavericks Choice MDL Guru

    Aug 5, 2015
    2,216
    9,028
    90
    Thank you, you were 100% spot on with the missing comma! ;)
     
  3. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    261
    290
    10
    According to this user you need to add an additional binary file to the installation. Problem is that this project is meant to be open source, adding that binary would break this rule. I am keeping the code i have added there, it will not hurt anything. Let's see in the future if Microsoft makes things work :D
     
  4. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    883
    773
    30
    Latest release and latest commit. Windows 11 22000.675 IoT

    Code:
    Index     : 0
    Exception : Cannot bind argument to parameter 'Path' because it is an empty string.
    Category  : InvalidData: (:) [Get-Item], ParameterBindingValidationException
    ErrorID   : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.GetItemCommand
    Target    :
    Command   : $SaveDirectory = Get-Item -Path $OutputPath
    Script    : D:\Optimize\Optimize-Offline\Optimize-Offline.psm1
    Line      : 2705
    Column    : 39
     
  5. strotee

    strotee MDL Member

    Jan 30, 2011
    215
    186
    10
    Post your Configuration.json. But look at your OutputPath as the error message is complaining about it.
     
  6. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    883
    773
    30
    I don't think it's that, it finds the ISO I point OO to and runs OO just fine. And the ISO OO makes installed just fine. It must be something else.
     
  7. strotee

    strotee MDL Member

    Jan 30, 2011
    215
    186
    10
    So it does everything correctly but you're concerned about this error message? Also, what's Windows 11 22000.675 IoT (Edit: Nevermind) ? Are you populating your Lists or running OO all manually?
     
  8. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    883
    773
    30
    Just my PC OCD is all, having an error message irks me. I populate all my lists.
     
  9. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    883
    773
    30
    @gdeliana

    I was wondering why Nividia drivers were installed automatically on a clean Windows install.

    I checked the registry.

    These keys are there.

    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -Type DWord -Value "1"
    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -Type DWord -Value "1"
    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -Type DWord -Value "0"

    These are not in the registry.

    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value "1"
    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value "1"
    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -Type DWord -Value "1"

    From SelectiveRegistry.ps1

    Code:
    If($SelectiveRegistry.DisableDriverUpdate) {
        Log $OptimizeData.SelectiveRegistryDriverUpdate
        RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value "1"
        RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -Type DWord -Value "1"
        RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -Type DWord -Value "1"
        RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -Type DWord -Value "0"
        RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value "1"
        RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -Type DWord -Value "1"
        Start-Sleep 1
    }
     
  10. Magmarock

    Magmarock MDL Member

    Oct 12, 2016
    117
    17
    10
    Wow this just looks beyond me. I'm going to have to study this. Why is 1809 absent from it though.
     
  11. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    261
    290
    10
    I think its Microsoft setup overriding those values, as it is the case with the amoled theme. We need to find a way to prevent the OOBE setup from doing that.
     
  12. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,140
    1,783
    60
    Couldn't that be achieved by skipping OOBE via Unattend.xml
     
  13. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    883
    773
    30
    #1895 KedarWolf, Jun 8, 2022
    Last edited: Jun 9, 2022
    (OP)
    I skip OOBE in my unattend.xml.

    Actually, in Windows 11 skipping User or Machine OOBE is depreciated and will cause your install to error out. I DO skip everything like Account Creation and Wireless Setup though.
     
  14. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    883
    773
    30
    @gdeliana

    If I choose an output path for the ISO, get no errors.

    But if there is already an ISO with that name in that output path, it errors out trying to create the ISO.

    Code:
    Exception : Cannot create a file when that file already exists.
               
    Category  : WriteError: (D:\IoTEnterprise_22000.iso:String) [Rename-Item], IOException
    ErrorID   : RenameItemIOError,Microsoft.PowerShell.Commands.RenameItemCommand
    Target    : D:\IoTEnterprise_22000.iso
    Command   : Rename-Item -Path $MovedItem.FullName -NewName $NewFileName
    Script    : D:\Optimize-Offline-master\Optimize-Offline-master\Optimize-Offline.psm1
    Line      : 2729
    Column    : 6
    
    Could we make it overwrite the existing ISO by default if using the same ISO name and path?
     
  15. zalim581

    zalim581 MDL Novice

    Aug 12, 2019
    30
    6
    0
  16. zb9525

    zb9525 MDL Novice

    Apr 24, 2017
    25
    13
    0
    EnableOLEDTaskbar
    If ($InstallInfo.Build -le '19044'){
    $RegistryData.EnableOLEDTaskbar | Out-File -FilePath $RegistryLog -Encoding UTF8 -Append -Force
    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "UseOLEDTaskbarTransparency" -Value 1 -Type DWord
    RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Microsoft\Windows\Dwm" -Name "ForceEffectMode" -Value 1 -Type DWord
    RegKey -Path "HKLM:\WIM_HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Value 1 -Type DWord
    }
    -le '19044' ?
    22000 not support´╝č