From a2eb0b6ec606c416e9adf6f569de63183f6cf6c8 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Wed, 21 Jun 2023 23:22:37 +0800 Subject: [PATCH] =?UTF-8?q?reinstall.bat=20=E4=BD=BF=E7=94=A8=20http=20?= =?UTF-8?q?=E4=BB=A3=E6=9B=BF=20https?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++++--- reinstall.bat | 12 ++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e3cc4ef..38657b3 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,13 @@ reboot ``` #### 使用(当前系统是 Windows): ``` -下载 https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat +下载 +https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat +https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh +放到同一目录 -管理员权限打开 cmd/powershell -reinstall.bat centos-7 (或其他系统) +管理员权限打开 cmd/powershell 窗口 +运行 reinstall.bat centos-7 (或其他系统) 本脚本所有功能皆可在 Windows 下使用,包括重装到 Linux/Windows/dd ``` diff --git a/reinstall.bat b/reinstall.bat index 12ef4b2..9e0ce5f 100644 --- a/reinstall.bat +++ b/reinstall.bat @@ -2,6 +2,10 @@ set confhome=https://raw.githubusercontent.com/bin456789/reinstall/main setlocal EnableDelayedExpansion +:: Windows 7 SP1 winhttp 默认不支持 tls 1.2 +:: https://support.microsoft.com/en-us/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392 +:: 有些系统根证书没更新 +:: 所以不要用https :: 进入脚本目录 cd /d %~dp0 @@ -18,12 +22,12 @@ set tags=%tmp%\cygwin-installed-!pkgs! if not exist !tags! ( :: 检查是否国内 :: 在括号里面,:: 下一行不能是空行!!!!! - call :download https://geoip.fedoraproject.org/city %tmp%\geoip "Check Location" + call :download http://geoip.fedoraproject.org/city %tmp%\geoip "Check Location" findstr CHN %tmp%\geoip >nul if !errorlevel! == 0 ( - set host=https://mirrors.tuna.tsinghua.edu.cn + set host=http://mirror.nju.edu.cn ) else ( - set host=https://mirrors.kernel.org + set host=http://mirrors.kernel.org ) :: 检查32/64位 @@ -37,7 +41,7 @@ if not exist !tags! ( ) :: 下载 Cygwin - call :download https://www.cygwin.com/setup-!arch!.exe %tmp%\setup-cygwin.exe "Download Cygwin" + call :download http://www.cygwin.com/setup-!arch!.exe %tmp%\setup-cygwin.exe "Download Cygwin" :: 安装 Cygwin set site=!host!!dir!