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,340
    234
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,340
    234
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,340
    234
    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...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    8,197
    27,739
    270
    No it won't
     
  5. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,340
    234
    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...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    879
    457
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,340
    234
    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...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,340
    234
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. slayer9450

    slayer9450 MDL Member

    Aug 3, 2015
    174
    70
    10
  10. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,340
    234
    60
    Did it work? I think it's only for .104 build...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Thomas Dubreuil

    Thomas Dubreuil MDL Junior Member

    Aug 29, 2017
    78
    127
    0
    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