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

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

  1. #121 Deleted member 1385001, Dec 18, 2021
    Last edited by a moderator: Dec 18, 2021
    Code:
    @echo off
    cd /d %~dp0
    set src=C:\Windows\servicing\Packages
    cscript /nologo SxSExtract.vbs /U /IMAGE:%src% %src%\Packagename.mum ExtractPackage >log.txt 2>&1
    
    Code:
    ' Help text.
    Sub DisplayHelp
       Call LogBare("CSCRIPT.EXE SXSEXTRACT.VBS [/?,/H,/HELP] [/DEBUG,/V] </ONLINE|/IMAGE:<folder>>")
       Call LogBare("  [/INCLUDERES] [/VICIOUSHACKS] [/UPDATEPACK,/U] <source>.mum [<target>[.cab]]")
       Call LogBare("")
       Call LogBare("Parses a Windows Side-by-Side package manifest file, chases up all the")
       Call LogBare("references, and copies all the files associated with the package.")
       Call LogBare("")
       Call LogBare("  /?,/H,/HELP      Display this help text.")
       Call LogBare("  /DEBUG,/V        Enable verbose debug output.")
       Call LogBare("  /ONLINE          Uses %SYSTEMROOT% (usually C:\Windows) as the root folder to")
       Call LogBare("                   search for associated files.")
       Call LogBare("  /IMAGE:<folder>  Uses <folder> as the root folder to search for associated")
       Call LogBare("                   files instead.")
       Call LogBare("  /INCLUDERES      Extract MUI resources as well, for packages that don't have")
       Call LogBare("                   associated language packs.")
       Call LogBare("  /VICIOUSHACKS    Activates a couple of hacks to the script, for extracting")
       Call LogBare("                   'difficult' packages that don't reference assemblies by")
       Call LogBare("                   exact name.")
       Call LogBare("  /UPDATEPACK,/U   Extract package from another package, where all files are")
       Call LogBare("                   within the same <folder>, as in updates or langpacks.")
       Call LogBare("  <source>.mum     Specifies a package manifest file. Wildcards are not")
       Call LogBare("                   permitted.")
       Call LogBare("  <target>[.cab]   Specifies the target folder for extracted files. If the")
       Call LogBare("                   extension '.cab' is specified, the script will call")
       Call LogBare("                   CABARC.EXE to create a cabinet of the extracted files.")
       Call LogBare("")
       Call LogBare("This script requires both SXSEXPAND.EXE and CABARC.EXE, either in the")
       Call LogBare("current folder or on the system PATH, for full functionality.")
    End Sub
    
    Thanks a LOT LOT :)
     
  2. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,890
    1,566
    60
    #122 Ace2, Dec 19, 2021
    Last edited: Dec 19, 2021
    :cool:
     
  3. mhussain

    mhussain MDL Senior Member

    Oct 1, 2012
    368
    144
    10
    @abbodi1406
    dude, i'm in aur of you sir!
    i'm sure that lady super bubble would not mind you inhanseing her work.
    thank you so much for updateing and keeping this alive.
    i'm very greatful.
    I hope that updates will continue in some form?
    stay safe!
    sorry for any errors, I am using a screen reader due to my blindness.
     
  4. bear_aussie

    bear_aussie MDL Senior Member

    Jun 8, 2015
    275
    304
    10
    she doesnt mind
    how do i know ?
    i aksed her :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,425
    2,606
    120
    #125 pm67310, Dec 8, 2022
    Last edited: Dec 8, 2022
    for me SxSExport.cmd not works in ltsc 2021 21h2 : /
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. mhussain

    mhussain MDL Senior Member

    Oct 1, 2012
    368
    144
    10
    could someone kindly repost a link of ssx v1?
    I would be very greatful
    Majid
     
  7. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,856
    19,116
    340
  8. mhussain

    mhussain MDL Senior Member

    Oct 1, 2012
    368
    144
    10
    @Tito
    thank you so much sir!
    your a saint.
    :)
    thank you again.
    i'll keep this safe.
     
  9. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,425
    2,606
    120
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,281
    91,237
    340
    The symbol at beginning means you used accent letter or something
     
  11. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,425
    2,606
    120
    resolved antivirus error ^^ thank @abbodi1406
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Apoly

    Apoly MDL Member

    Aug 21, 2016
    166
    141
    10
    Never knew this existed, will play around with it, thanks a bunch!
     
  13. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,281
    91,237
    340
    #133 abbodi1406, Jul 19, 2024
    Last edited: Jul 19, 2024
    I forgot to upload :)

    - Add support for NT 6.0 packages ("dependentAssembly" node is little different in Vista manifest)
     

    Attached Files:

  14. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,425
    2,606
    120
    SxS Package Extractor 2.7
    Powershell Version

    https://www.mediafire.com/file/55ehbf0yytbiosi/SxS_Expander_v2.7.7z/file


    Code:
    v2.7 - What's New
    
    + Fixed renaming of exported package files:
      + Corrected the issue with renaming `update.mum` and `update.cat` files after export.
    
    + Fixed loop switch in the update section:
      + Now, after selecting option 1, it returns to the package selection, allowing the extraction of another package.
    
    ---------------------------------------------------------------------------------------------------------------------------
    
    v2.6 - What's New
    
    + Removed unnecessary console logs:
      + Significantly speeding up package extraction by eliminating redundant log entries.
    
    + Replaced `SUBST` with `robocopy`:
      + Files are now copied directly to the final directory, improving efficiency by eliminating double copying.
    
    + Added better support for `REG_QWORD`:
      + Fixed handling of `REG_QWORD` values to prevent conversion errors,
        ensuring no more errors like `Cannot convert value "1234567890" to type "System.Int64"`.
    
    + Improved temp folder cleanup:
      + Enhanced the cleaning process of the `C:\Windows\Temp` folder containing decompressed manifests.
    
    + Several minor improvements:
      + Various other optimizations and fixes to improve overall performance and stability.
    
    ----------------------------------------------------------------------------------------------------------------------------
    
    v2.5 - What's New
    
    + Added support for `REG_MULTI_SZ`:
      + Added support for processing and exporting `REG_MULTI_SZ` (multi-string value) registry entries.
    
    + Added support for `REG_EXPAND_SZ`:
      + Added support for processing and exporting `REG_EXPAND_SZ` (expandable string value) registry entries.
    
    + Added support for `REG_BINARY`:
      + Added support for processing and exporting `REG_BINARY` (binary value) registry entries.
    
    + Namespace Initialization:
      + Corrected initialization of XML namespace manager to handle XML documents more effectively.
     
    + Enhanced Placeholder Replacement:
      + Implemented `ReplacePlaceholders` function to replace placeholders in registry keys and values with actual paths.
    
    + Accurate Conversion of `REG_DWORD`:
      + Ensured correct conversion of `REG_DWORD` values to their hex representation in the exported `.reg` file.
    
    + Enhanced Logging:
      + Added debug messages for each step in processing registry keys and values to aid in troubleshooting and validation.
    
    ----------------------------------------------------------------------------------------------------------------------------
    v2.4 - What's New?
    
    + Added `RegManifest` Setting:
      + Introduced the RegManifest setting to the INI configuration.
      + Allows control over whether registry keys are processed and exported.
      + When set to 0, registry keys will be skipped.
    
    + Enhanced Logging:
      + Improved logging functionality to provide more detailed information and debug messages.
      + Added LogToConsole setting to the INI configuration.
      + Allows control over whether logs are displayed in the console.
      + When set to 0, certain logs will be suppressed in the console output.
    
    + Namespace Manager Initialization:
      + Incorporated XML namespace manager initialization for handling XML documents more effectively.
    
    + File Skipping Logic:
      + Implemented logic to skip certain file types, such as .mum files, during processing.
    
    + Registry Export Folder Creation:
      + Automated creation of export folders for registry changes, including the naming convention based on manifest names.
    
    + Registry File Export:
      + Enabled the export of registry changes to .reg files, with support for various registry value types including REG_SZ,
      REG_DWORD, and others.
    
    -----------------------------------------------------------------------------------------------------------------------------
    
    v2.3 - What's New?
    
    + Added `Check-Update` function:
      + Checks if items matching the "*KB*" pattern are folders.
      + Verifies that found folders are not empty.
    
    + Path validation in the main script execution:
      + Verifies if the provided path exists.
      + Checks if the path is a directory.
      + Displays appropriate error messages if the path is invalid.
    
    + Ensured proper handling of empty directories in `Check-Update`:
      + Displays a message if a found "*KB*" folder is empty.
      + Skips non-directory items matching the "*KB*" pattern.
    
    + Updated `Extract-Update` function:
      + Added support for extracting .msu, .cab, .wim, .esd files using 7-Zip and dism.
      + Handles extraction based on file types.
    
    + Added tools:
      + Integrated 7-Zip x86/x64 for file extraction.
      + Updated PSFExtractor.exe to version 3.07 x86/x64.
    
    - Removed support for extracting .exe files.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,856
    19,116
    340
    Why did you re-upload and post @remek002's work without proper citation?

    Besides, what you posted is not even a full-fledged SxS Package Extractor, it's just the SxS File Expander module.
     
  16. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,425
    2,606
    120
    I couldn't remember who the original author was
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,856
    19,116
    340
    Please do proper research before posting.