From b11726cfcebc66cb68a0bf564a017e54ffc22fc3 Mon Sep 17 00:00:00 2001 From: reksarka Date: Wed, 17 Jan 2024 19:01:25 +0200 Subject: [PATCH] FIX: `get-sdk.bat` Requires an URL as the first arg. --- README.md | 8 +++++--- get-sdk.bat | 11 +++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1196ba5..a014e44 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Collects portable MS Visual Studio Tools. Currently only x64-x64 is available for host-target platforms. ```bat -vsget [destination] +vsget "[destination]" ``` Downloads and unpacks (without installation) to `destination`: @@ -23,18 +23,20 @@ Adds related `vcvars*.bat` to init the VS Tools environment. Windows SDK can be downloaded separately: ```bat -get-sdk [destination] +get-sdk "[url]" "[destination]" ``` Downloads the ISO, extracts the MSI installers (with related CAB files) of the SDK components and unpacks them into `destination`. +The actual `SDK_URL` can be found in `vsget.bat`. + # Uncache MS Visual Studio Components Use the MS Visual Studio cache to generate `vsix-groups\*.txt` files: ```bat -vsuncache {CachePath} +vsuncache "{CachePath}" ``` If the optional `CachePath` is ommited, tries to find the VS cache path in the diff --git a/get-sdk.bat b/get-sdk.bat index a14d2be..051892f 100644 --- a/get-sdk.bat +++ b/get-sdk.bat @@ -16,6 +16,17 @@ call which destination >NUL 2>&1 || set "PATH=%~dp0utils;%PATH%" call which check-components >NUL 2>&1 || set "PATH=%~dp0sdk;%PATH%" set url=%~1 + +if "%url%" == "" ( + echo [ERR][%~n0] SDK URL is required! + exit /b 1 +) + +if not "%url:~0,4%" == "http" ( + echo [ERR][%~n0] Invalid SDK URL! + exit /b 1 +) + call destination "%~2" || exit /b 1 call check-components "%destination%" && (