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.1.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mite_vspkg-1.0.1-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file mite-vspkg-1.0.1.tar.gz.

File metadata

  • Download URL: mite-vspkg-1.0.1.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mite-vspkg-1.0.1.tar.gz
Algorithm Hash digest
SHA256 024fb10dc6c87a2f1e59bc5467e2ccb7ac4de844ba190e3c6c356fb0ee293ce4
MD5 fd4e8d8409dd718282f09c83a445335f
BLAKE2b-256 ea03d45780ec80c5a984703111c4e2dc0c12c96546f7c97c8ce964dce91da399

See more details on using hashes here.

File details

Details for the file mite_vspkg-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: mite_vspkg-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mite_vspkg-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83512c27e7cff6538ae8bbd7b18fd67c8f90881c23f3fe49d025d6d3d18be51e
MD5 fa27d0b97e1802640aab1af81dc39168
BLAKE2b-256 e474e1adbb6e47be951c0d539c8bbc8482b29d6c2d5272987d0322a3c082996c

See more details on using hashes here.

Supported by

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