diff --git a/openClaw/OpenClawPrecheck.exe b/openClaw/OpenClawPrecheck.exe deleted file mode 100755 index 296e2e5..0000000 Binary files a/openClaw/OpenClawPrecheck.exe and /dev/null differ diff --git a/openClaw/openClaw-win11安装指南.md b/openClaw/openClaw-win11安装指南.md index 82fac17..f162e2d 100755 --- a/openClaw/openClaw-win11安装指南.md +++ b/openClaw/openClaw-win11安装指南.md @@ -9,7 +9,7 @@ ## 📋 第一阶段:前置条件检查 > 理论上当前使用的电脑都应该符合。若不确定,也可使用以下脚本检测一下 -> 一键检查脚本(双击打开):启动检查工具.bat +> 一键检查脚本(双击打开):[校验脚本](./scripts/OpenClawPrecheck.exe) ### 1. 电脑配置要求 diff --git a/openClaw/scripts/OpenClawPrecheck.exe b/openClaw/scripts/OpenClawPrecheck.exe new file mode 100755 index 0000000..f7d99d2 Binary files /dev/null and b/openClaw/scripts/OpenClawPrecheck.exe differ diff --git a/openClaw/OpenClawPrecheck.ps1 b/openClaw/scripts/OpenClawPrecheck.ps1 similarity index 100% rename from openClaw/OpenClawPrecheck.ps1 rename to openClaw/scripts/OpenClawPrecheck.ps1 diff --git a/openClaw/scripts/build_in_win.ps1 b/openClaw/scripts/build_in_win.ps1 new file mode 100644 index 0000000..1ff91a1 --- /dev/null +++ b/openClaw/scripts/build_in_win.ps1 @@ -0,0 +1,55 @@ +<# +.SYNOPSIS + Run this script in Windows PowerShell to package OpenClawPrecheck.ps1 into an EXE. + +.DESCRIPTION + 1. Automatically detects and installs the PS2EXE module. + 2. Compiles OpenClawPrecheck.ps1 into a console-less EXE. +#> + +$ErrorActionPreference = "Stop" + +# Get the directory of the current script +$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$sourceFile = Join-Path $scriptDir "OpenClawPrecheck.ps1" +$targetFile = Join-Path $scriptDir "OpenClawPrecheck.exe" + +Write-Host "`n[1/3] Checking environment..." -ForegroundColor Cyan + +# Check source file +if (-not (Test-Path $sourceFile)) { + Write-Error "Error: Source file not found: $sourceFile`nPlease ensure this script is in the same directory as OpenClawPrecheck.ps1." + exit 1 +} + +# Check and install PS2EXE module +if (-not (Get-Module -ListAvailable -Name PS2EXE)) { + Write-Warning "PS2EXE module not found. Installing... (Internet connection required)" + try { + # Install to current user scope, no admin rights required usually + Install-Module -Name PS2EXE -Scope CurrentUser -Force -SkipPublisherCheck + Write-Host "PS2EXE installed successfully!" -ForegroundColor Green + } catch { + Write-Error "Installation failed. Please try running PowerShell as Administrator.`nError: $_" + exit 1 + } +} + +Write-Host "[2/3] Packaging..." -ForegroundColor Cyan +try { + # -NoConsole: Critical parameter to hide the console window + Invoke-PS2EXE -InputFile $sourceFile ` + -OutputFile $targetFile ` + -NoConsole ` + -Title "OpenClaw Environment Check" ` + -Version "1.0.0.0" ` + -Description "OpenClaw Windows 11 Pre-check Tool" ` + -Verbose +} catch { + Write-Error "Packaging failed: $_" + exit 1 +} + +Write-Host "`n[3/3] Done!" -ForegroundColor Cyan +Write-Host "EXE generated at: $targetFile" -ForegroundColor Green +Write-Host "You can now double-click the EXE to run it." -ForegroundColor Gray diff --git a/openClaw/启动检查工具.bat b/openClaw/启动检查工具.bat deleted file mode 100644 index ce5a625..0000000 --- a/openClaw/启动检查工具.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off -cd /d "%~dp0" -echo. -echo ======================================================================== -echo OpenClaw Precheck Tool is starting... -echo ======================================================================== -echo. -echo [Note] Please do NOT close this window. -echo. -powershell -NoProfile -ExecutionPolicy Bypass -Command "& { .\\OpenClawPrecheck.ps1 }"