Commit 24482749 authored by Tomoki Sekiyama's avatar Tomoki Sekiyama Committed by Michael Roth
Browse files

Add a script to extract VSS SDK headers on POSIX system

VSS SDK(*) setup.exe is only runnable on Windows. This adds a script
to extract VSS SDK headers on POSIX-systems using msitools.


From: Paolo Bonzini <>
Signed-off-by: default avatarPaolo Bonzini <>
Signed-off-by: default avatarTomoki Sekiyama <>
Reviewed-by: default avatarLaszlo Ersek <>
Reviewed-by: default avatarMichael Roth <>
Signed-off-by: default avatarMichael Roth <>
parent 69d5d21f
#! /bin/bash
# extract-vsssdk-headers
# Author: Paolo Bonzini <>
set -e
if test $# != 1 || ! test -f "$1"; then
echo 'Usage: extract-vsssdk-headers /path/to/setup.exe' >&2
exit 1
if ! command -v msiextract > /dev/null; then
echo 'msiextract not found. Please install msitools.' >&2
exit 1
if test -e inc; then
echo '"inc" already exists.' >&2
exit 1
# Extract .MSI file in the .exe, looking for the OLE compound
# document signature. Extra data at the end does not matter.
export LC_ALL=C
offset=$(grep -abom1 "$MAGIC" "$1" | sed -n 's/:/\n/; P')
tmpdir=$(mktemp -d)
trap 'rm -fr -- "$tmpdir" vsssdk.msi' EXIT HUP INT QUIT ALRM TERM
tail -c +$(($offset+1)) -- "$1" > vsssdk.msi
# Now extract the files.
msiextract -C $tmpdir vsssdk.msi
mv "$tmpdir/Program Files/Microsoft/VSSSDK72/inc" inc
echo 'Extracted SDK headers into "inc" directory.'
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment