[msvc] Automatically update (win-)config.h with the correct version number
[mono.git] / msvc / winsetup.bat
1 @echo off
2 cd ..
3 if exist config.h if not exist cygconfig.h copy config.h cygconfig.h
4 if exist eglib\config.h if not exist eglib\cygconfig.h copy eglib\config.h eglib\cygconfig.h
5 copy winconfig.h config.h
6 copy eglib\winconfig.h eglib\config.h
7 powershell -Command "(Get-Content config.h) -replace '#MONO_VERSION#', (Select-String -path configure.ac -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content config.h"
8 goto end
9 :error
10 echo fatal error: the VSDepenancies directory was not found in the "mono" directory
11 echo error: you must download and unzip that file
12 exit /b 100
13 goto end
14 :ok
15 echo OK
16 :end
17 exit /b 0