Skip to main content

A utility to get a list of files per Visual Studio installer package and to unpack Visual Studio installer packages.

Project description

mite-vspkg

A utility to get a list of files per Visual Studio installer package and to unpack Visual Studio installer packages.
Uses manifests of Visual Studio installer to get a list of available Visual Studio packages.
Supported formats: .msi, .vsix, .zip.

Features

  • Check files of the selected packages.

    Download all payloads of a package, check its files, keep the list of filenames, delete downloaded payloads to conserve space. Once all packages are checked, save the result in .json.

    Then mite-vspkg can be used to get useful info from the resulting .json :

    • print a list of filenames per payload (with URLs) per package,
    • print packages per filename regex,
    • print URLs per payload per filename regex.

    Intermediate results are saved after downloading certain amount of bytes so the operation can be resumed if suddenly interrupted.

    Only .msi, .vsix, .zip are downloaded, .cab are skipped.

  • Download and unpack files from the selected packages.

    If resumed, downloaded payloads are not redownloaded. Hashes of the downloaded payloads are compared with hashes in the installer manifest to remove corrupted payloads.

    Only .msi, .vsix, .zip, .cab are downloaded.

Requirements

  1. python 3.7+

  2. msitools 0.98+ and libgcab 1.2+
    msitools doesn't work on Windows. https://gitlab.gnome.org/GNOME/msitools#notes

mite-vspkg was tested on Linux only.

Installation

This command should install the program on Unix/macOS.
python3 -m pip install mite_vspkg

If it doesn't work, see this https://packaging.python.org/en/latest/tutorials/installing-packages/

Usage

The options are loaded from the configuration file in the config folder of a --work-dir .
By default, the name of the config is config.py . Alternative config name can be specified with --config-name option.

Example

This command will copy the default config to $HOME/mite-vspkg/config/config.py and execute the program using that config.
By default, the program will download and cache the manifests and print the list of all packages.
python3 -m mite_vspkg --work-dir="$HOME/mite-vspkg"

After executing the command, the options can be changed by editing the $HOME/mite-vspkg/config/config.py .
If the user scrolls to the bottom of the config.py ,
comments
mode = util_enum.mode.PRINT_SEL_PKGS_VSDOWNLOAD
uncomments
#mode = util_enum.mode.CHECK_FILES
saves the changes,
then executes the same command
python3 -m mite_vspkg --work-dir="$HOME/mite-vspkg"
the program will download-check-delete every package and store lists of filenames and .cab info in $HOME/mite-vspkg/check_files/out/out_file.json .

Notes

util_enum.mode.CHECK_FILES
If there is a partially filled output .json, selected packages are ignored and the program tries to finish the interrupted check.
If there is a fully filled output .json, the program creates a backup of this .json and then tries to check the selected packages.

util_enum.mode.DOWNLOAD_AND_UNPACK
After unpacking, filenames are unquoted, i.e. %xx escapes are replaced with their single-character equivalent, e.g. %20 is replaced by space " ", %2B is replaced by plus "+".

When the program prints a list of packages, there are 3 architectures after the package type.
Example: Microsoft.VisualStudio.Debugger.Concord.Remote (Vsix) (x64; ARM64; neutral) (3.3 MB; 3.3 MB; 9.8 MB)
Those are: chip, machineArch, productArch.

When the program prints a list of packages, there are 3 sizes at the end.
Example: Microsoft.Icecap.Collection.Msi (Msi) (64.0 KB; 1.9 MB; 5.0 MB)

  1. Download size to get list of filenames and .cab info from the package, i.e. size of .msi, .vsix, .zip payloads.
  2. Download size to unpack the package, i.e. size of .msi, .vsix, .zip, .cab payloads.
  3. Install size of the package. The program doesn't install the packages and doesn't unpack some file types, so the real unpack size is likely different from the install size.

When the program prints a list of payloads, there are 2 sizes near the payload name.
Example: SDK Debuggers-x86_en-us.msi (636.0 KB; 138.1 MB)

  1. Size of the payload.
  2. Size of the payload, plus size of required .cab payloads, plus size of .msi payloads which have the required .cab files. The program counts an .msi only if it has a .cab which is not available for download as a payload. If multiple .msi have the required .cab files, the most lightweight combination is counted.

By default, dependencies of the selected packages are also selected. Dependency resolution can be turned off by setting "skip_dependencies" to True in the config.

Acknowledgments

The program contains a modified version of vsdownload.py from https://github.com/mstorsjo/msvc-wine (ISC license).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mite-vspkg-1.0.0.post1.tar.gz (22.7 kB view hashes)

Uploaded Source

Built Distribution

mite_vspkg-1.0.0.post1-py3-none-any.whl (25.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page