Removing InBox Apps from Win10 1809?

Discussion in 'Windows 10' started by MonarchX, Oct 27, 2018.

  1. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
  2. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    I understand it's already Sunday after a long week and the next week isn't going to be sunshine either, but this has to get done somehow. I did my part - tried and failed. It's your turn! I already upgraded my rig, now finally upgrading from Win10 LTSB 1607 to Win10 LTSC 1809 and some Windows OS defense-against-the-holy-removal-of-crapware error cannot stop me!

    How do I get nasty MS stuff out of my box?
     
  3. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    You said it there yourself that CU's would restore AppX's that were removed from the registry, which is why removing them from the registry AND from StateRepository-Machine.srd is the way to go. That way CU's only update files, but AppX's themselves never come back! However, at least in 1809 changing "StateRepository-Machine.srd" seems impossible...
     
  4. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,597
    93,461
    340
    No it won't
     
  5. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    One way or another, it makes no sense that IsInBox SQL entry cannot be set to anything other than 1. No value, except for 1, works. The file is somehow protected... The NULL value for those entries can be done somehow, perhaps with some other software or simply be forced via some other method. That's the only way to get those Apps to show up and remove them properly with PowerShell commands...
     
  6. GodHand

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    483
    30
    I don't think it's the absolute worst way. - IMO it's ok do it this way.
    Have you tried offline editing the DB?
     
  8. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    I have not tried offline editing, but I did copy the file onto a separate drive, renamed it, changed the extension, restarted PC (all to make sure that file isn't somehow being used). That did not help with editing... I researched that error and it seems like it's SQL-related in some way I do not understand...

    I also tried to export that database tot CSV file, then make changes, and re-import CSV back into the database, but the same exact error peraiafed...
     
  9. slayer9450

    slayer9450 MDL Member

    Aug 3, 2015
    211
    87
    10
  10. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    Did it work? I think it's only for .104 build...
     
  11. Thomas Dubreuil

    Thomas Dubreuil MDL Senior Member

    Aug 29, 2017
    363
    625
    10
    I did mess with this and don't recommend...
    when I had old appx leftovers after an upgrade (reported in DISM++ thread)
    This .srd file can't be edited, uou can easily delete it if you want, simply killing the state repository service before.
    .srd file will be recreated by the service (in no time) and empty (0 ko) : that means you won't be able to deploy any appx after and forever = breaking the feature, but that's what you want it seems.

    What I did finally to get rid of leftovers is replacing this file from a "fresh install" one and it worked (no leftover + I can deploy all needed/no error).
    A bit crazy, but "maybe" you could think to use the same method...
    I'd install server (desktop) which it has the minimum required appx. Not sure you get same clsid, but use same name at least. Backup the apprepository folder, and replace on your windows 10 to "debloat"
    Note: even disabled repository service restarts on its own quite fast, so do your operations faster.


    ps: I made this (small) batch script to run explorer as TI (note you must have nsudo in same folder of script), simple:
    It modifies the key that avoids explorer elevation (with nsudo), then launch explorer as TI (with nsudo), then set the key back to default value after a few seconds.
    I had to put a timing for the key to be set back, because randomly it wouldn't work without delay...
    This way I always keep the "RunAs" value intact, because previously0 I was letting this key "permanently" modified, to be able to run explorer as admin from a shortcut.

    Even made an .exe with nsudo embedded, but not sure tool like this can be released...As always thanks to Abodi "the script master" for the nsudo script he adviced.

    Code:
    @Echo off
    cd %systemroot%\system32
    call :IsAdmin
    
    %windir%\system32\reg.exe query "HKU\S-1-5-19" 1>nul 2>nul || goto :eof
    
    %windir%\system32\whoami.exe /USER | find /i "S-1-5-18" 1>nul && (
    goto :OK
    ) || (
    "%~dp0NSudo.exe" -U:T -P:E "%~dpnx0"
    goto :eof
    )
    
    :OK
    Reg.exe delete "HKCR\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}" /v "RunAs" /f
    Reg.exe add "HKCR\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}" /v "_RunAs_" /t REG_SZ /d "Interactive User" /f
    "%~dp0NSudo.exe" -U:T -P:E "explorer"
    TimeOut /T 3 /NOBREAK
    Reg.exe delete "HKCR\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}" /v "_RunAs_" /f
    Reg.exe add "HKCR\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}" /v "RunAs" /t REG_SZ /d "Interactive User" /f
    Exit
    
    :IsAdmin
    Reg.exe query "HKU\S-1-5-19\Environment"
    If Not %ERRORLEVEL% EQU 0 (
     Cls & Echo You must have administrator rights to continue ...
     Pause & Exit
    )
    Cls
    goto:eof
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. 100055

    100055 MDL Novice

    Dec 15, 2018
    5
    7
    0
    I just ran into the same problem. I have discovered a solution. I will be making a video soon.
     
  13. 100055

    100055 MDL Novice

    Dec 15, 2018
    5
    7
    0
    #15 100055, Dec 15, 2018
    Last edited: Dec 16, 2018
  14. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,928
    1,619
    60
    #16 Ace2, Dec 21, 2018
    Last edited: Dec 24, 2018
    Windows 10 Home Version 1809 (OS Build 17763.107) X64

    THESE SETTINGS ARE OUT DATED, USE AS INFO ONLY.

    Code:
    Mounted install.wim, backup C:\Windows\System32\config folder.
    
    Opened C:\Windows\System32\config\SOFTWARE with Registry Editor, using Load Hive...
    
    Went to HKEY_LOCAL_MACHINE\S\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\
    
    Applications\Sub, I delete all.
    
    *
    
    Config\Sub, I keep.
    
    Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy
    Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy
    Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy
    Microsoft.Windows.OOBENetworkCaptivePortal_cw5n1h2txyewy
    Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy
    windows.immersivecontrolpanel_cw5n1h2txyewy
    
    then i delete the rest, and i add.
    
    Microsoft.Windows.OOBENetworkConnectionFlow_cw5n1h2txyewy / SetupPhase (set to 7)
    Microsoft.Windows.SecHealthUI_cw5n1h2txyewy / SetupPhase (set to 7)
    
    *
    
    InboxApplications\Sub, I keep.
    
    Microsoft.AAD.BrokerPlugin_10.0.17763.1_neutral_neutral_cw5n1h2txyewy
    Microsoft.Windows.CloudExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy
    Microsoft.Windows.ContentDeliveryManager_10.0.17763.1_neutral_neutral_cw5n1h2txyewy
    Microsoft.Windows.OOBENetworkCaptivePortal_10.0.17763.1_neutral_neutral_cw5n1h2txyewy
    Microsoft.Windows.OOBENetworkConnectionFlow_10.0.17763.1_neutral_neutral_cw5n1h2txyewy
    Microsoft.Windows.SecHealthUI_10.0.17763.1_neutral__cw5n1h2txyewy
    Microsoft.Windows.ShellExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy
    windows.immersivecontrolpanel_10.0.2.1000_neutral_neutral_cw5n1h2txyewy
    
    then i delete the rest.
    
    *
    
    Staged\Sub, I delete all.
    
    Saved settings, by Unload Hive...
    
    *
    
    Moved most Apps to Deleted (folder), did not move these Apps to Deleted.
    
    WindowsApps:
    Deleted
    Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x64__8wekyb3d8bbwe
    Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x86__8wekyb3d8bbwe
    Microsoft.NET.Native.Framework.1.7_1.7.25531.0_x64__8wekyb3d8bbwe
    Microsoft.NET.Native.Framework.1.7_1.7.25531.0_x86__8wekyb3d8bbwe
    Microsoft.NET.Native.Runtime.1.6_1.6.24903.0_x64__8wekyb3d8bbwe
    Microsoft.NET.Native.Runtime.1.6_1.6.24903.0_x86__8wekyb3d8bbwe
    Microsoft.NET.Native.Runtime.1.7_1.7.25531.0_x64__8wekyb3d8bbwe
    Microsoft.NET.Native.Runtime.1.7_1.7.25531.0_x86__8wekyb3d8bbwe
    Microsoft.VCLibs.140.00_14.0.25426.0_x64__8wekyb3d8bbwe
    Microsoft.VCLibs.140.00_14.0.25426.0_x86__8wekyb3d8bbwe
    
    *
    
    SystemApps:
    Deleted
    Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy
    Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy
    Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy
    Microsoft.Windows.OOBENetworkCaptivePortal_cw5n1h2txyewy
    Microsoft.Windows.OOBENetworkConnectionFlow_cw5n1h2txyewy
    Microsoft.Windows.SecHealthUI_cw5n1h2txyewy
    ShellExperienceHost_cw5n1h2txyewy
    
    I commit / unmount / install / and the modded install.wim installed just fine.
    .
    NOTES Adding:
    Microsoft.Windows.OOBENetworkConnectionFlow_cw5n1h2txyewy / SetupPhase (set to 7)
    Microsoft.Windows.SecHealthUI_cw5n1h2txyewy / SetupPhase (set to 7)

    Seems to stop, Windows could not complete the installation. To install Windows on this computer, restart the installation, error.

    *

    NOTES 2
    If anyone tries this method, and you get this error:
    Windows could not complete the installation. To install Windows on this computer, restart the installation

    Code:
     Press Shift + F10 - Type Exit - Press Enter - Press Esc 
    let the computer restart, then installation will finish just fine, with no errors.