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

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

  1. GodHand

    GodHand MDL Senior Member

    Jul 15, 2016
    490
    653
    10
    #261 GodHand, Feb 6, 2020
    Last edited: Feb 6, 2020
    I already have a full nested module that works with Optimize-Offline that will integrate updates. The reason I have not added it to the project is because it's not just a simple Add-WindowsPackage, rinse and repeat module; rather, it's a fairly heavy module as it will automatically download the updates your specific build requires using custom catalog XML files I created and uses the Sessions.xml inside the install.wim to enumerate current packages to verify any update about to be applied. In the near future I will undoubtedly trim it down and integrate it into the project but because the Win10UI by @abbodi1406 works so well, I have not been adamant about it.

    I have also found a way to integrate Microsoft Edge Chromium in an offline state, so the integration of the Microsoft Edge (HTML) packages will be getting removed from an upcoming project update and replaced with the integration of Microsoft Edge Chromium.

    **EDIT**

    As for the issues people are having installing paid Microsoft Store and gaming packages with some of the clean-up registry settings Optimize-Offline applies after Windows Apps have been deprovisioned and removed - I will add a way for those settings to be omitted.
     
  2. KedarWolf

    KedarWolf MDL Senior Member

    Mar 17, 2016
    414
    272
    10
    #262 KedarWolf, Feb 6, 2020
    Last edited: Feb 6, 2020
    (OP)
    Thanks!!! I spent a full day Googling, trying to figure out what the issue was with my Microsoft Store game. And reinstalling Windows with various Optimize Offline configurations.

    Also, does the below lines in the code add those tweaks if any Xbox package is removed or only if the Microsoft.XboxGameCallableUI is removed. I deleted the code as I feared some of the tweaks might interfere with the store as well but never tested it with the code still in the script as I finally got my game to download. I never removed Microsoft.XboxGameCallableUI with Optimise Offline but I removed other Xbox packages.

    If you prefer, I can do a ticket on Github. :)

    Code:
    If ($RemovedAppxPackages.Keys -like "*Xbox*" -or $RemovedSystemApps.'Microsoft.XboxGameCallableUI')
                    {
                        RegKey -Path "HKLM:\WIM_HKLM_SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AudioCaptureEnabled" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name "CursorCaptureEnabled" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\SOFTWARE\Microsoft\GameBar" -Name "AutoGameModeEnabled" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\SOFTWARE\Microsoft\GameBar" -Name "AllowAutoGameMode" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\SOFTWARE\Microsoft\GameBar" -Name "UseNexusForGameBarEnabled" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\System\GameConfigStore" -Name "GameDVR_Enabled" -Value 0 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\System\GameConfigStore" -Name "GameDVR_FSEBehavior" -Value 2 -Type DWord
                        RegKey -Path "HKLM:\WIM_HKCU\System\GameConfigStore" -Name "GameDVR_FSEBehaviorMode" -Value 2 -Type DWord
                        @("xbgm", "XblAuthManager", "XblGameSave", "xboxgip", "XboxGipSvc", "XboxNetApiSvc") | ForEach-Object -Process { If (Test-Path -Path "HKLM:\WIM_HKLM_SYSTEM\ControlSet001\Services\$($PSItem)") { RegKey -Path "HKLM:\WIM_HKLM_SYSTEM\ControlSet001\Services\$($PSItem)" -Name "Start" -Value 4 -Type DWord } }
                        [Void]$Visibility.Append('gaming-gamebar;gaming-gamedvr;gaming-broadcasting;gaming-gamemode;gaming-xboxnetworking;quietmomentsgame;')
                        If ($InstallInfo.Build -lt '17763') { [Void]$Visibility.Append('gaming-trueplay;') }
                    }
    
     
  3. GodHand

    GodHand MDL Senior Member

    Jul 15, 2016
    490
    653
    10
    Those subkeys and values are applied if either Xbox Provisioned App Packages are removed or the XboxGameCallableUI System Application.

    I personally do not play any games through the Microsoft Store but considering the Xbox feature has evolved over time into Microsoft's core gaming component, I'm assuming it would be affected, though I'm willing to bet if anything would affect gameplay from Store Apps, it would be the disabling of the Xbox services and not the regular disabling of GameDVR and GameBar.

    Either way I will add the ability to omit these registry entries from being added for those who wish to play games and the like through Microsoft Store.
     
  4. KedarWolf

    KedarWolf MDL Senior Member

    Mar 17, 2016
    414
    272
    10
    I'll test it of course when you do.
     
  5. fLOW.

    fLOW. MDL Senior Member

    Jul 28, 2009
    395
    319
    10
  6. spanishfly

    spanishfly MDL Novice

    Dec 5, 2018
    17
    16
    0
  7. Manish2018

    Manish2018 MDL Member

    May 15, 2018
    110
    26
    10
    i have already tested 4.0.0.5 & source iso as1909 - 18363.592 without doing so as mentioned by spanishfly & installed it on a vmware workstation but i havent found any BSOD (Blue Sceen of Death) even i tried to install it on a old machine [17-3770 with gigabyte h61m-s mobo 160gb old seagate hdd] & installation finished without any error or BSOD . i think spanishfly might have removed a needed system app or might have disabled a feature which is mandatory for windows 10 to install thatswhy it results into an BSOD at her end.
    it will be better if spanishfly could upload a final log of ver 4.0.0.5 so that developer will rectify it & will suggest her where she was wrong at any step of the build.
     
  8. Manish2018

    Manish2018 MDL Member

    May 15, 2018
    110
    26
    10
    means in year 2021 developer will release GUI . good to know from spanishfly.
     
  9. fLOW.

    fLOW. MDL Senior Member

    Jul 28, 2009
    395
    319
    10
  10. Manish2018

    Manish2018 MDL Member

    May 15, 2018
    110
    26
    10
    no any new updates . i think developer is working on to build a full final GUI of the project.
     
  11. GodHand

    GodHand MDL Senior Member

    Jul 15, 2016
    490
    653
    10
    I rarely, if ever, check this thread. As a matter of fact, this is the most I've even browsed this thread because I never officially released the project here for one specific reason: it's hard for me to respond to all requests here and Github in a timely fashion with other projects because of work, and because simply replying/debugging issues on GitHub and PowerShellGet can take a lot of time in itself, hence why I prefer ticket submissions on Github because help from others does not get potentially "lost" in the copious amount of replies forum releases can accumulate. I will try to offer the occasional help here, too, though, but cannot guarantee immediate responses.
     
  12. KedarWolf

    KedarWolf MDL Senior Member

    Mar 17, 2016
    414
    272
    10
    I'll open tickets on GitHub, that's what I normally do so it's all good. :)
     
  13. GodHand

    GodHand MDL Senior Member

    Jul 15, 2016
    490
    653
    10
    I will be changing line 567 to the following:

    Code:
    If ($RemovedAppxPackages.'Microsoft.XboxIdentityProvider' -and ($RemovedAppxPackages.Keys -like "*Xbox*").Count -gt 1 -or $RemovedSystemApps.'Microsoft.XboxGameCallableUI')
    This way the clean-up of Xbox leftovers will only occur if the XboxIdentityProvider Provisioned App Package has been deprovisioned and removed, the count of removed Xbox packages is greater than 1 and the XboxGameCallableUI System Application has also been removed.

    If any of these criteria are not met, it will skip the Xbox clean-up.