import os
import sys
import shutil
from glob import glob
from os.path import join

assert sys.platform == 'win32'
sys.path.insert(0, r'..\tools')

from conv_template import process_file

src_dir = r'..\src'

def convert_templates():
    for path in glob(join(src_dir, '*.src')):
        process_file(path)


def main():
    convert_templates()
    shutil.copy('npy_config.h', src_dir)
    os.system("msbuild")


if __name__ == '__main__':
    main()

@@ -70,20 +70,66 @@
  import 
-join
+expanduser, join%0A%0Afrom egginst.utils import rm_rf%0A
 %0A%0Aassert
@@ -347,16 +347,368 @@
 path)%0A%0A%0A
+def install():%0A    usr_dir = expanduser(r'~%5Cusr')%0A    rm_rf(usr_dir)%0A%0A    usr_inc_dir = join(usr_dir, 'include')%0A    os.makedirs(usr_inc_dir)%0A    for path in glob(join(src_dir, '*.h')):%0A        shutil.copy(path, usr_inc_dir)%0A%0A    usr_lib_dir = join(usr_dir, 'lib')%0A    os.makedirs(usr_lib_dir)%0A    shutil.copy(r'Release%5Clibndarray.dll', usr_lib_dir)%0A%0A%0A
 def main
@@ -772,24 +772,24 @@
 ', src_dir)%0A
-
     os.syste
@@ -801,16 +801,30 @@
 build%22)%0A
+    install()%0A
 %0A%0Aif __n

add install() to Windows build script