forked from Galleondragon/qb64
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathfindcurl.cmd
executable file
·30 lines (24 loc) · 1.03 KB
/
findcurl.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@echo off
rem This script breaks when the version gets updated.
rem Can someone else work a way around that?
rem This script does not handle failure to make a directory
rem nor a failure to download the curl.cab
rem It also assumes that curl is downloaded to the users Desktop
set DLPAGE=http://skanthak.homepage.t-online.de/download
set CURLVERSION=curl-7.64.1.cab
set LINK=%DLPAGE%/%CURLVERSION%
rem grab the arch. We'll need this to extract files.
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set ARCH=i386|| set ARCH=amd64
rem Check if curl exists
curl --version 2>NUL 1>&2
if %ERRORLEVEL == 9009 (
mkdir internal\curl >NUL
echo Fetching %LINK%
explorer %LINK%
rem we should wait until the file is downloaded, because explorer returns straight away
"%SystemRoot%\system32\expand.exe" "%USERPROFILE%\Desktop\%CURLVERSION%" /F:%ARCH%\* internal\curl
rem Add to path
PATH=%PATH%;%~dp0\internal\curl
) ELSE (
echo "Found curl, continuing"
)