From c8a1b0db946491dfd504464677d98a00e8fc875a Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 12 Aug 2022 12:33:52 -1000 Subject: [PATCH] Visual Studio Projects: Automatic install/update of windows-build without git Leverage windows provided curl and tar to fetch and then expand the latest windows-build archive. --- Visual Studio Projects/Pre-Build-Event.cmd | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/Visual Studio Projects/Pre-Build-Event.cmd b/Visual Studio Projects/Pre-Build-Event.cmd index 006cebe1..64bc5853 100644 --- a/Visual Studio Projects/Pre-Build-Event.cmd +++ b/Visual Studio Projects/Pre-Build-Event.cmd @@ -216,6 +216,34 @@ popd set _TRIED_CLONE=1 goto _check_build :_notice1_announce +if "%_TRIED_CURL%" neq "" goto _notice3_announce +call :FindCurl _CURL_CURL +if "%_CURL_CURL%" equ "" goto _notice3_announce +call :FindTar _TAR_TAR +if "%_TAR_TAR%" equ "" goto _notice3_announce +echo ***************************************************** +echo ***************************************************** +echo ** ** +echo ** The required build support is not yet available.** +echo ** ** +echo ** Using curl and tar to acquire and expand a ** +echo ** local copy of the windows-build repository ** +echo ** in archive form from: ** +echo ** ** +echo ** https://github.com/simh/windows-build ** +echo ** ** +echo ** This may take a minute or so. Please wait... ** +echo ** ** +echo ***************************************************** +echo ***************************************************** +pushd ..\.. +%_CURL_CURL% --location https://github.com/simh/windows-build/archive/windows-build.tar.gz --output windows-build.tar.gz +%_TAR_TAR% -xzf windows-build.tar.gz +del windows-build.tar.gz +popd +set _TRIED_CURL=1 +goto _check_build +:_notice3_announce echo ***************************************************** echo ***************************************************** echo ** The required build support is not available. ** @@ -260,6 +288,34 @@ popd set _TRIED_PULL=1 goto _check_build :_notice2_announce +if "%_TRIED_CURL%" neq "" goto _notice4_announce +call :FindCurl _CURL_CURL +if "%_CURL_CURL%" equ "" goto _notice4_announce +call :FindTar _TAR_TAR +if "%_TAR_TAR%" equ "" goto _notice4_announce +echo ***************************************************** +echo ***************************************************** +echo ** ** +echo ** The required build support is out of date. ** +echo ** ** +echo ** Using curl and tar to acquire and expand a ** +echo ** local copy of the windows-build repository ** +echo ** in archive form from: ** +echo ** ** +echo ** https://github.com/simh/windows-build ** +echo ** ** +echo ** This may take a minute or so. Please wait... ** +echo ** ** +echo ***************************************************** +echo ***************************************************** +pushd ..\.. +%_CURL_CURL% --location https://github.com/simh/windows-build/archive/windows-build.tar.gz --output windows-build.tar.gz +%_TAR_TAR% -xzf windows-build.tar.gz +del windows-build.tar.gz +popd +set _TRIED_CURL=1 +goto _check_build +:_notice4_announce echo ***************************************************** echo ***************************************************** echo ** The required build support is out of date. ** @@ -393,6 +449,22 @@ set _GIT_TMP_= set _GIT_TMP= exit /B 0 +:FindTar +set _TAR_TMP=%1 +call :WhichInPath tar.exe _TAR_TMP_ +set %_TAR_TMP%=%_TAR_TMP_% +set _TAR_TMP_= +set _TAR_TMP= +exit /B 0 + +:FindCurl +set _CURL_TMP=%1 +call :WhichInPath curl.exe _CURL_TMP_ +set %_CURL_TMP%=%_CURL_TMP_% +set _CURL_TMP_= +set _CURL_TMP= +exit /B 0 + :FindVCVersion call :WhichInPath cl.exe _VC_CL_ for /f "tokens=3-9 delims=\" %%a in ("%_VC_CL_%") do call :VCCheck _VC_VER_NUM_ "%%a" "%%b" "%%c" "%%d" "%%e" "%%f" "%%g"