[VBScript] Aunty Mel's Cheap And Nasty SxS Package Extractor (Updated 2013/09/30)

Discussion in 'Scripting' started by SuperBubble, Sep 17, 2013.

  1. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #61 Mr Jinje, Nov 6, 2013
    Last edited by a moderator: Apr 20, 2017
    Find them at Reboot.pro by Joakim

    http://reboot.pro/files/download/237-runassystem-and-runfromtoken/

    I have a devxexec trick to passing variables correctly that might work. Otherwise I'll just spawn my .exe with it and avoid the issue.
     
  2. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    #62 KNARZ, Nov 6, 2013
    Last edited by a moderator: Apr 20, 2017
    Do not use
    Code:
    INCLUDERES
    Extract the language/MUI files seperate! - The language dependent MUM won't be applied. As it's a seperate package for DISM.

    Is kind of right from my investigations...
    Easiest way is to control all packages if they include other *.MUM files. If so, than you found a superior Package and you can delete the redundant child ones.

    I can confirm this.
     
  3. SuperBubble

    SuperBubble MDL Member

    Nov 18, 2011
    150
    294
    10
    OP updated with a new version. Should allow complete extraction of WinPE-SRT packages.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #64 Mr Jinje, Nov 10, 2013
    Last edited by a moderator: Apr 20, 2017
    Seemed to work for me.

    Update on my app. Added pre-populated combo box / drop down list for easy mum selection rendering the mum button redundant. Added append button which dumps the command into a 'bubbles.cmd' for larger runs. One-Z / Two-Z runs can still be done using the Run button if my.exe is opened with devxexec. Added logo of Bubbles from TPB, christening the App "Bubbles Super Nasty SFX Extractor", mainly because it's dirty and sassy, so sassy.

    FYI, cannot replicate devxexec.exe error as reported by others. Can confirm I have been running both my.exe and the bubbles.cmd as trustedinstaller and generating packages. Not sure what issue is.

    Code:
    devxexec.exe /user:TrustedInstaller "C:\Users\Administrator\Desktop\RELEASE\SXS_Extractor_GUI.exe"
    devxexec.exe /user:TrustedInstaller "C:\Users\Administrator\Desktop\RELEASE\Bubbles.cmd"
     
  5. SuperBubble

    SuperBubble MDL Member

    Nov 18, 2011
    150
    294
    10
    Exxxcellent. Now Smithers, where's my tea?

    Small suggestion: since all the .mum files are in %ImageRoot%\Windows\Servicing\Packages, how about trimming off the path for display? That way, your window could be much thinner. :)

    Bonus huh? Why is this post being thanked? :confused:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. ericgl

    ericgl MDL Senior Member

    Mar 10, 2011
    250
    189
    10
    #66 ericgl, Nov 25, 2013
    Last edited by a moderator: Apr 20, 2017
    SuperBubble / Mr. Jinjie,

    I was wondering if it might be possible to use DISM.
    As we all know, there is an option to remove a package from an image, for example:

    Code:
    DISM /Image:C:\MOUNT /Remove-Package /PackageName:WinPE-MDAC-Package~31bf3856ad364e35~amd64~~6.3.9600.16384
    What if we could remove the package from the WIM file directly into a CAB file, for example:

    Code:
    DISM /Image:C:\MOUNT /Remove-Package /PackageName:WinPE-MDAC-Package~31bf3856ad364e35~amd64~~6.3.9600.16384 > D:\WinPE-MDAC.cab
    Is this somehow supported in DISM?
     
  7. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #67 Mr Jinje, Nov 25, 2013
    Last edited by a moderator: Apr 20, 2017
    If by DISM, you mean SuperBubbles VBS script combined with the SXSexpander and cabarc, than yes "DISM" could do that. But if you meant the built in Microsoft tool, then no, I do not think that is an available option.
     
  8. liliactr

    liliactr MDL Member

    Sep 3, 2009
    202
    83
    10
    This is an awesome tool. Very good work and should go on. Can i demand some stuff.

    *Can we add "select offline mounted windows folder" button on GUI for to use with also offline images?
    I see that in this post there is such tool but where is download link?

    http://forums.mydigitallife.net/thr...ed-2013-09-29)?p=836601&viewfull=1#post836601

    *As far as i know when adding packages dism also check for edition. Forexample it was not possible to add a windows package to a winpe image. Also again forexample you can not add an embedded edition cab file to a winpe boot.wim. Is this tool adds an hack to cab packages that they can be applicable to all editions?

    *If dism can not add the packages created with this tool can we add a section to gui that
    select the mounted wim
    select the cab file will be added.
    add (it will be enough that it only put the files to related folders. i know that packages also adds stuff the system hivs but to put the extracted files to right folders will be enough for me.)

    *Also can we select a group of mum files and batch process them to cabs? It is difficult to select one by one.
     
  9. ericgl

    ericgl MDL Senior Member

    Mar 10, 2011
    250
    189
    10
    SuperBubble,

    In the OP, you used CABARC.exe from Internet Explorer Administration Kit 10.
    But I think there's a newer version available from Internet Explorer Administration Kit 11.

    In IEAK11, the digital signature of CABARC.exe is stamped October 15th, 2013.

    Maybe this newer version could solve a few issues.
     
  10. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    I had a b!tch of a time writing it, but here is a thanksgiving release for all you jive turkeys.

    Append Button appends the current command in a Bubbles.cmd (for use with the "Run_Bubbles_As_Trusted_Installer.cmd") in the same directory as app.

    The Run Button runs the command in whatever user context the SXS_Extractor_Gui is running under (as current user or via TrustedInstaller with the included .cmd)

    Mount button allows you to choose the folder where your mounted install.wim is for extracting from an offline.iso.

    If there is no mounted wim at the mount location, your drop down list will be blank after you switch 'Offline'. Go back to 'Online' and it will repopulate in a second or two.

    The Mum Button is not needed, just use the drop down list, much faster and it saves your place in the list.

    Just set your settings (online/offline/debug/viscous hacks/includeRes) then choose the mum from the drop down list and hit append button. Then run the "Run_Bubbles_As_Trusted_Installer.cmd" and it will create your packages in the same directory.
     
  11. SuperBubble

    SuperBubble MDL Member

    Nov 18, 2011
    150
    294
    10
    #71 SuperBubble, Nov 29, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I need to check this thread more often. Every time I think it's died (I'm bad for killing threads...), it suddenly regenerates, blasting golden Time Lord energy all over the place, jolting me from the trance-like states I fall into when I work all week. :)

    ... which reminds me - if Paul McGann asks, the answer is 'yes, I would love to bear your children'.

    Ahem. Anyway, let's take it from the top, strategically skipping the bits that Mr Jinje has already well-answered :):

    I'm presuming you want to back up packages before removing them? That can be done in two steps by using my script to extract the package to somewhere safe, and then calling DISM to remove said package from the image. Give something like this a whirl:
    Code:
    C:\>CSCRIPT SXSEXTRACT.VBS /Image:C:\MOUNT\Windows C:\MOUNT\Windows\Servicing\Packages\WinPE-MDAC-Package~31bf3856ad364e35~amd64~~6.3.9600.16384.MUM WinPE-MDAC.CAB
    C:\>DISM /Image:C:\MOUNT /Remove-Package /PackageName:WinPE-MDAC
    So when you realise that you loved :wub: the MDAC components and can't possibly live without them, you can pop them right back in, like this:
    Code:
    C:\>DISM /Image:C:\MOUNT /Add-Package /PackagePath:WinPE-MDAC.CAB
    Note that, as I recall, the /Remove-Package switch was introduced in DISM for Windows 8, and doesn't work for earlier versions of Windows.

    This is a toughie. KNARZ (the Great and Powerful :worthy:) invented a way to add packages from other Windows editions, but put the project aside for lack of time, and there being so many 'threads' to follow. Further, he looked into bypassing DISM's signature checking to allow modified packages to install - but alas, it's non-trivial to trick the entire Windows servicing stack into looking the other way.

    It's a shame, because if anyone could do it, it would be KNARZ. Try offering him food, bribes, or sexual favours. :eek:

    Ooh, thanks, I'll take a looksie. :hug2:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. ericgl

    ericgl MDL Senior Member

    Mar 10, 2011
    250
    189
    10
    SuperBubble,

    Thanks for your helpful answers.
    I don't know if you've noticed, but the new Windows 8.1 Embedded (all versions of it) doesn't offer a catalog anymore.
    Previous versions (WES7, WES8) had a "catalog" folder inside the ISO, containing CAB packages.

    So now, in order to extract packages from the Install.WIM of Windows 8.1 Embedded, I have to use your tool.

    I haven't tested this, but as I understand, it's not trivial to get those packages and inject them into WinPE 5.0.
    DISM performs some sort of check to block us from doing so.
     
  13. SuperBubble

    SuperBubble MDL Member

    Nov 18, 2011
    150
    294
    10
    You're welcome. :)

    No, I hadn't noticed, but Windows Embedded was never my thing - always been a WinPE girl, and wrote my own PE builder - which I still use - which, while very manual compared to the Embedded build tools, does pretty much everything I want.

    My complaint about Embedded (at least the last time I played with it, which was probably around the time of WinFLP) was that it didn't seem to me that there was enough 'ground' between WinPE and full Windows to be worth it, unless deep (but reasonably easy) customisation was important, and memory was at a premium.

    Bonus edit: Or you need multimedia features - but you'd be surprised how much Windows PE can do with help. The peeps down at reboot.pro seem to have a cottage industry of building almost full-featured Windows based on WinPE.

    That has obviously changed, as I've heard of quite a few people building things based on Embedded in recent times... I might revisit it over Christmas. :hug2:

    Precisely, that's what KNARZ was trying to work around.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. liliactr

    liliactr MDL Member

    Sep 3, 2009
    202
    83
    10
    Can you give screenshot or upload. Strange that have not seen your nick any of windows pe forums. You use another nick name in here?
     
  15. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    16,141
    84,319
    340
    [VBScript] doesn't mean .ps1 :D
    yes it's .vbs
     
  16. SuperBubble

    SuperBubble MDL Member

    Nov 18, 2011
    150
    294
    10
    It's just a string of batch files that call the AIK/ADK tools. It's completely customised to my workflow, and it's only configurable through editing the batch files. Because of its nature, it looks an awful lot like the CODE segments and screenshots here.

    And no, you haven't seen me on any WinPE forum, ever: I merely lurk. reboot.pro and MSFN have (so far...) had everything I wanted to know without having to ask - as someone else already had. :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. internals

    internals MDL Novice

    Jan 22, 2014
    1
    0
    0
    To this point, I've been able to modify packages to create custom combinations, working through edition / flavor / sku targets. I definitely encountered the same signature checks as KNARZ has but there are some exceptions that allow flexibility.

    SuperBubble, I'd love to chat with you about it! Perhaps it has some applicability to your tools. I seem to be unable to PM until I get 5 posts in, but could you shoot me an email maybe? ian at internals.io . I've lurked with a few accounts for a while but find I'm rather poor at keeping up on forums nowadays. :)
     
  18. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30

    Uh? ... How?
    Have you patched CbsProvider.dll?
     
  19. slmrojo

    slmrojo MDL Novice

    Feb 6, 2017
    1
    0
    0
    I cannot find the download link anywhere can i get any help?
     
  20. sebus

    sebus MDL Guru

    Jul 23, 2008
    6,354
    2,026
    210
    Here, version from KNARZ