forked from cgartlab/Software_Install_Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@echo off | ||
chcp 65001 | ||
set "software=v2rayN.exe" | ||
|
||
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit | ||
cd /d "%~dp0" | ||
|
||
tasklist | find /i "v2rayN.exe" >nul | ||
if %errorlevel% EQU 0 ( | ||
echo v2rayN 正在运行,正在进行下一步 | ||
|
||
rem 设置winget代理配置 | ||
winget settings --enable ProxyCommandLineOptions | ||
|
||
rem 逐行读取软件列表文件并安装软件 | ||
for /f "tokens=*" %%a in (software_list.txt) do ( | ||
echo 正在安装: %%a | ||
winget install %%a --proxy http://127.0.0.1:10809 | ||
) | ||
) else ( | ||
echo 错误:v2rayN 没有运行,请按任意键退出。 | ||
pause > nul | ||
exit /b | ||
) | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
rem @echo off | ||
|
||
rem chcp 65001 | ||
set "software=v2rayN.exe" | ||
|
||
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit | ||
cd /d "%~dp0" | ||
|
||
tasklist | find /i "v2rayN.exe" >nul | ||
if %errorlevel% EQU 0 ( | ||
echo v2rayN 正在运行,正在进行下一步 | ||
|
||
rem 设置winget代理配置 | ||
winget settings --enable ProxyCommandLineOptions | ||
|
||
rem 逐行读取软件列表文件并安装软件 | ||
for /f "tokens=*" %%a in (software_list.txt) do ( | ||
echo 正在安装: %%a | ||
winget install %%a --proxy http://127.0.0.1:10809 | ||
) | ||
) else ( | ||
for /f "tokens=*" %%a in (software_list.txt) do ( | ||
echo 正在安装: %%a | ||
winget install %%a | ||
) | ||
) | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@echo off | ||
set "software=v2rayN.exe" | ||
|
||
rem 检查winget是否存在 | ||
where winget >nul | ||
if %errorlevel% NEQ 0 ( | ||
echo winget is not installed or not in the PATH. Please install it. | ||
exit /b 1 | ||
) | ||
|
||
rem 读取代理配置 | ||
set "proxy=http://127.0.0.1:10809" | ||
rem 如果需要可以通过环境变量或配置文件来设置代理 | ||
rem set "proxy=%PROXY%" | ||
|
||
tasklist | find /i "%software%" >nul | ||
if %errorlevel% EQU 0 ( | ||
echo %software% is running. | ||
|
||
rem 设置winget代理配置 | ||
winget settings --enable ProxyCommandLineOptions | ||
if %errorlevel% NEQ 0 ( | ||
echo Failed to enable winget proxy settings. | ||
exit /b 1 | ||
) | ||
|
||
rem 逐行读取软件列表文件并安装软件 | ||
for /f "tokens=*" %%a in (software_list.txt) do ( | ||
echo 正在安装: %%a | ||
winget install %%a --proxy %proxy% | ||
if %errorlevel% NEQ 0 ( | ||
echo Failed to install %%a | ||
) | ||
) | ||
) else ( | ||
echo %software% is not running. Exiting script. | ||
exit /b | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
rem 定义软件列表文件路径 | ||
set "proxysoftwarelist=proxy_software_list.txt" | ||
|
||
rem 检查文件是否存在 | ||
if not exist "%proxysoftware%" ( | ||
echo Error: File %proxysoftware% does not exist. | ||
exit /b | ||
) | ||
|
||
rem 读取并检查每个软件 | ||
for /f "tokens=*" %%s in ("%proxysoftware%") do ( | ||
set "software=%%s" | ||
tasklist | find /i "!software!" >nul | ||
if %errorlevel% NEQ 0 ( | ||
echo !software! is not running. Exiting script. | ||
exit /b | ||
) | ||
) | ||
|
||
echo All required software is running. | ||
rem 这里可以添加更多的命令继续执行 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@echo off | ||
set "software=v2rayN.exe" | ||
|
||
tasklist | find /i "%software%" >nul | ||
if %errorlevel% EQU 0 ( | ||
echo %software% is running. | ||
rem 这里可以添加更多的命令继续执行 | ||
winget settings --enable ProxyCommandLineOptions | ||
|
||
REM 逐行读取软件列表文件并安装软件 | ||
for /f "tokens=*" %%a in (software_list.txt) do ( | ||
echo 正在安装: %%a | ||
winget install %%a --proxy http://127.0.0.1:10809 | ||
) | ||
) else ( | ||
echo %software% is not running. Exiting script. | ||
exit /b | ||
) |