install_wim_tweaker - How does it unhide\hide the packages ?

Discussion in 'Scripting' started by tnx, Aug 22, 2015.

  1. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    Hi all.

    been messing with Win 10 and making my own custom image.
    Been using DISM to remove various packages and also been giving DISM a boost as it were from the install_wim_tweaker .

    Does anybody know what the process is of un-hiding all those packages allowing them to be removed, then re-hiding them.

    Can this be achieved by a .cmd script ?

    :tea:
     
  2. Yasser Da Silva

    Yasser Da Silva MDL Senior Member

    Mar 15, 2015
    499
    2,567
    30
  3. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    6,414
    15,608
    210
    #4 MSMG, Aug 22, 2015
    Last edited by a moderator: Apr 20, 2017
    Command to List all the Packages present in the Image and store the list in packages.txt file :

    Code:
    install_wim_tweak.exe /p <MountDir> /l
    Command to UnHde All Packages in the Image :

    Code:
    install_wim_tweak.exe /p <MountDir>
    Command to Hide All Packages in the Image :

    Code:
    install_wim_tweak.exe /p <MountDir> /h

    Command to UnHide a particular Package from an Image :


    Code:
    install_wim_tweak.exe /p <MountDir> /c <PackageName> 
    Command to UnHide and remove a particular Package from an Image :

    Code:
    install_wim_tweak.exe /p <MountDir> /c <PackageName> /r
    Command to UnHide a particular Package and removing the same Package using DISM from an Image :

    Code:
    install_wim_tweak.exe /p <MountDir> /c <PackageName>
    
    dism.exe /Image:<MountDir> /Remove-Package /PackageName:<PackageName>


    Yes you can use command script to achieve the same.



     
  4. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,186
    90,643
    340
    #5 abbodi1406, Aug 22, 2015
    Last edited by a moderator: Apr 20, 2017
    I think the OP is asking how install_wim_tweak itself unhide the packages and allowing them to be removed, not how to use install_wim_tweak :rolleyes:

    the process rely on this registry path:
    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages
    which holds all packages informations (including updates)

    what install_wim_tweak do is:
    - change Visibility value to 1
    - remove package subkey Owners

    it can be done with a script, but will need SetACL.exe tool to get registry permissions (it's restricted to TrustedInstaller)

    the tool itself is an auto advanced script :D
     
  5. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    #6 tnx, Aug 22, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Yep. this is the info I was after.


    Thanks guys, I did know how to use it but I wanted to know what it did.

    I don't know who made that little .exe and I always seem to have my suspicions on what else it is doing that I don't know about.
    Not saying this little app is bad but, well you know what I mean..:cool:
     
  6. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
  7. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    Not a super script bloke but me thinks I will mount an install.wim image.
    mount the reg hive, take a look at

    May even export it.

    then run the tweaker to un-hide the packages and take a second look and see if I can spot the differences. ( Bet not, but fun to try ):eek:
     
  8. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,186
    90,643
    340
  9. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    #10 tnx, Aug 22, 2015
    Last edited: Aug 23, 2015
    (OP)
    Been messing and found summet very interesting..

    Once the install.wim is mounted it has nothing to do with mounting the reg hive.:eek:

    Let me see if I can explain what I did. ( not right good at this bit ):eek:

    Mount install.wim

    run this .cmd
    this gives you this
    ONLY COPIED THE TOP THREE --- OK..

    with the install.wim still mounted run REGEDIT

    highlight
    select File > load hive

    The navigate to your mounted install.wim image and navigate to
    in my case
    select
    the Open
    Give this a name. I just used "a"

    the navigate the registry to
    I selected the top one "Flash player"
    I took FULL CONTROLL of that reg entry and changed the visibility to 1

    IMPORTANT BIT

    UN LOAD THE NEW REG ENTRY i.e "a"
    Highlight it - File > Un Load Hive

    Run this command again
    This gave me

    Notice the new package - Flash Player is now visible

    Now I am NO expert but I think that is how the install_wim_tweaker un hides and re hides the packages..

    How does this read ?
    How does this sound ?
     
  10. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    Doing all that above still does not allow me to remove that package

    Just brought errors up...

    maybe one step further..

    May try it on a package I know I have removed already, with help from the tweaker.exe. The one drive package..

    fun to try..
     
  11. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,186
    90,643
    340
    :)

    ........
     
  12. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    I see your smiley face....

    I see "- remove package subkey Owners"

    But do I have to add this as a new key ?:confused:
     
  13. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    #14 tnx, Aug 22, 2015
    Last edited: Aug 22, 2015
    (OP)
    I have not seen such a key in the reg ?

    I SEE IT..

    doh....

    cheers
     
  14. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    BINGO

    Man that was it.....

    I bow down to you abbodi1406:worthy:
     
  15. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,556
    15,642
    270
    Yes, as usual abbodi did it. Me too! :worthy:
     
  16. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    Pretty excited at this..

    I just managed to remove the flash player package...


    JUST FOR THE RECORD...Chose the Flash player because it was the very first one. I have no intention of permanently removing this package.........



    Exactly what I wanted to do...:D


    :clap: :clap: :clap:
     
  17. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,694
    267
    60
    Well id one more test, just to make sure.

    I tested it out on a fresh install.wim image.

    Went through the whole process and removed the flash player package.

    un mounted with commit.
    Re-mounted the image

    Checked the registry of the mounted image for the flash package - GONE
    made a list and it was GONE

    Checked it with the tweaker .exe, it made a list and it was GONE.

    So really happy, so far. No idea of how to turn my steps into a .cmd but hey. I managed to succeed on doing it manually.

    Now I know how the .exe does it. ( sort of ) :D

    it does it a darn sight faster too but I ain't after that, I wouldn't mind taking half hour or more in un hiding and removing all the packages I want to. Once its done and tested, won't need to do it very often at all. if ever again ?