core: 将 cygwin setup.exe 下载到当前目录

This commit is contained in:
bin456789 2024-11-23 23:50:12 +08:00
parent 823046b6bf
commit 0a3cb891ad
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
3 changed files with 32 additions and 44 deletions

View File

@ -81,26 +81,17 @@ curl -O https://www.ghproxy.cc/https://raw.githubusercontent.com/bin456789/reins
<details>
<summary>😢Still unable to download?</summary>
<summary>Resolving Script Download Issues on Windows 7</summary>
### Try the following methods
Due to lack of support for TLS 1.2, SHA-256, or outdated root certificates, Windows Vista, 7, and Server 2008 (R2) may not be able to download scripts automatically. Manual downloading is required, as follows:
1. For Windows 7, install this patch to enable TLS 1.2.
Use Internet Explorer (enable TLS 1.2 in IE's advanced settings first) to download, or use Remote Desktop to save the following two files into the same directory:
<https://aka.ms/easyfix51044>
- <https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
2. Update SSL root certificates.
- <https://www.cygwin.com/setup-x86.exe>
```batch
certutil -generateSSTFromWU root.sst
certutil -addstore Root root.sst
```
3. Download manually by copying these two files through `Remote Desktop Connection`.
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh>
To use, run the downloaded `reinstall.bat`.
</details>

View File

@ -81,26 +81,17 @@ curl -O https://www.ghproxy.cc/https://raw.githubusercontent.com/bin456789/reins
<details>
<summary>😢还是无法下载?</summary>
<summary>解决 Windows 7 下无法下载脚本</summary>
### 可尝试以下几种方法
由于不支持 TLS 1.2、SHA-256、根证书没有更新等原因Vista7 和 Server 2008 (R2) 可能无法自动下载脚本,因此需要手动下载,具体操作如下:
1. Windows 7 安装此补丁启用 TLS 1.2
用 IE 下载 (先在 IE 高级设置里启用 TLS 1.2),或者通过远程桌面,将这两个文件保存到同一个目录
<https://aka.ms/easyfix51044>
- <https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
2. 更新 SSL 根证书
- <https://www.cygwin.com/setup-x86.exe>
```batch
certutil -generateSSTFromWU root.sst
certutil -addstore Root root.sst
```
3. 手动下载,通过 `远程桌面` 复制这两个文件
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh>
使用时运行下载的 `reinstall.bat`
</details>

View File

@ -32,12 +32,11 @@ if not exist %tmp% (
)
rem 检查是否国内
if not exist %tmp%\geoip (
if not exist geoip (
rem 部分地区 www.cloudflare.com 被墙
call :download http://dash.cloudflare.com/cdn-cgi/trace %tmp%\geoip
if errorlevel 1 goto :download_failed
call :download http://dash.cloudflare.com/cdn-cgi/trace %~dp0geoip || goto :download_failed
)
findstr /c:"loc=CN" %tmp%\geoip >nul
findstr /c:"loc=CN" geoip >nul
if not errorlevel 1 (
rem mirrors.tuna.tsinghua.edu.cn 会强制跳转 https
set mirror=http://mirror.nju.edu.cn
@ -111,12 +110,14 @@ if not exist "%tags%" (
)
rem 下载 Cygwin
call :download http://www.cygwin.com/setup-!CygwinArch!.exe %tmp%\setup-cygwin.exe
if errorlevel 1 goto :download_failed
if not exist setup-!CygwinArch!.exe (
call :download http://www.cygwin.com/setup-!CygwinArch!.exe %~dp0setup-!CygwinArch!.exe || goto :download_failed
)
rem 安装 Cygwin
set site=!mirror!!dir!
%tmp%\setup-cygwin.exe --allow-unsupported-windows ^
start /wait setup-!CygwinArch!.exe ^
--allow-unsupported-windows ^
--quiet-mode ^
--only-site ^
--site !site! ^
@ -124,6 +125,11 @@ if not exist "%tags%" (
--local-package-dir %tmp%\cygwin-local-package-dir ^
--packages %pkgs% ^
&& type nul >"%tags%"
if errorlevel 1 (
echo "Failed to install Cygwin."
exit /b 1
)
)
rem 在c盘根目录下执行 cygpath -ua . 会得到 /cygdrive/c因此末尾要有 /