diff --git a/README.en.md b/README.en.md
index 6a59640..60e8f85 100644
--- a/README.en.md
+++ b/README.en.md
@@ -81,26 +81,17 @@ curl -O https://www.ghproxy.cc/https://raw.githubusercontent.com/bin456789/reins
-😢Still unable to download?
+Resolving Script Download Issues on Windows 7
-### 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:
-
+-
-2. Update SSL root certificates.
+-
- ```batch
- certutil -generateSSTFromWU root.sst
- certutil -addstore Root root.sst
- ```
-
-3. Download manually by copying these two files through `Remote Desktop Connection`.
-
-
-
-
+To use, run the downloaded `reinstall.bat`.
diff --git a/README.md b/README.md
index a69cc13..201833a 100644
--- a/README.md
+++ b/README.md
@@ -81,26 +81,17 @@ curl -O https://www.ghproxy.cc/https://raw.githubusercontent.com/bin456789/reins
-😢还是无法下载?
+解决 Windows 7 下无法下载脚本
-### 可尝试以下几种方法
+由于不支持 TLS 1.2、SHA-256、根证书没有更新等原因,Vista,7 和 Server 2008 (R2) 可能无法自动下载脚本,因此需要手动下载,具体操作如下:
-1. Windows 7 安装此补丁启用 TLS 1.2
+用 IE 下载 (先在 IE 高级设置里启用 TLS 1.2),或者通过远程桌面,将这两个文件保存到同一个目录
-
+-
-2. 更新 SSL 根证书
+-
- ```batch
- certutil -generateSSTFromWU root.sst
- certutil -addstore Root root.sst
- ```
-
-3. 手动下载,通过 `远程桌面` 复制这两个文件
-
-
-
-
+使用时运行下载的 `reinstall.bat`
diff --git a/reinstall.bat b/reinstall.bat
index 58449e6..9dedade 100644
--- a/reinstall.bat
+++ b/reinstall.bat
@@ -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,19 +110,26 @@ 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 ^
- --quiet-mode ^
- --only-site ^
- --site !site! ^
- --root %SystemDrive%\cygwin ^
- --local-package-dir %tmp%\cygwin-local-package-dir ^
- --packages %pkgs% ^
- && type nul >"%tags%"
+ start /wait setup-!CygwinArch!.exe ^
+ --allow-unsupported-windows ^
+ --quiet-mode ^
+ --only-site ^
+ --site !site! ^
+ --root %SystemDrive%\cygwin ^
+ --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,因此末尾要有 /