Skip to content

Instantly share code, notes, and snippets.

@patrickocoffeyo
Last active December 21, 2015 03:19
Show Gist options
  • Save patrickocoffeyo/6241614 to your computer and use it in GitHub Desktop.
Save patrickocoffeyo/6241614 to your computer and use it in GitHub Desktop.
Allows you to download/create an IE VM for Virtualbox in Linux easily.
#!/usr/bin/python
import sys
import optparse
import urllib
import urllib2
import os
import stat
def main():
p = optparse.OptionParser()
p.add_option('--browser', '-b', default='11')
p.add_option('--system', '-s', default='7')
p.add_option('--path', '-p', default='packages/')
options, arguments = p.parse_args()
#Download the config text file
f = urllib2.urlopen('https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE'+options.browser+'_'+options.system+'/IE'+options.browser+'.'+options.system+'.For.LinuxVirtualBox.txt')
paths = f.read().splitlines()
#Grab all the files as specified in the config files.
#Let's let wget handle this
os.system('mkdir '+options.path)
for path in paths:
print 'Downloading '+path
urllib.urlretrieve(path, options.path+'/'+path.split('/').pop())
#Execute the sfx file
sfxPath = options.path+'IE'+options.browser+'.Win'+options.system+'.For.LinuxVirtualBox.part1.sfx'
st = os.stat(sfxPath);
os.chmod(sfxPath, st.st_mode | stat.S_IEXEC)
os.system('./'+sfxPath);
if __name__ == '__main__':
main()
@patrickocoffeyo
Copy link
Author

chmod +x installie.py
./installie.py -b (ie version, 11, 10, 9, etc) -s (Windows version, 7 Vista, etc) -p (path to place packages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment