Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2@file 

3@brief Various functions to install `MinGW <http://www.mingw.org/>`_. 

4""" 

5from __future__ import print_function 

6import sys 

7import os 

8 

9from .install_custom import download_file 

10from ..installhelper.install_cmd_helper import run_cmd 

11 

12 

13def install_vs(dest_folder=".", fLOG=print, install=True, version=None): 

14 """ 

15 install `Visual Studio Express <https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx>`_ (only on Windows) 

16 

17 @param dest_folder where to download the setup 

18 @param fLOG logging function 

19 @param install install (otherwise only download) 

20 @param version version to download (unused) 

21 @return temporary file 

22 

23 @todo check it is installed 

24 """ 

25 if version is not None: 

26 raise ValueError("cannot specify a version") 

27 if not sys.platform.startswith("win"): 

28 raise NotImplementedError( 

29 "Visual Studio can only be installed on Windows at the moment") 

30 

31 name = "vs_community.exe" 

32 newurl = "https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x40c" 

33 outfile = os.path.join(dest_folder, name) 

34 fLOG("[pymy] Visual Studio, download from ", newurl) 

35 local = download_file(newurl, outfile) 

36 

37 if install: 

38 run_cmd("msiexec /i " + local, fLOG=fLOG, wait=True) 

39 return local