[patch] 修改nsis安装流程
This commit is contained in:
@@ -158,30 +158,95 @@ jobs:
|
||||
Write-Host "Step 4.6: Install NSIS";
|
||||
Write-Host "==========================================";
|
||||
|
||||
# Download NSIS 3.09
|
||||
$nsisUrl = "https://sourceforge.net/projects/nsis/files/NSIS%203/3.09/nsis-3.09-setup.exe/download";
|
||||
$nsisInstaller = "$env:TEMP\nsis-setup.exe";
|
||||
# Use current directory for installer to avoid permission issues
|
||||
$nsisInstaller = "$PWD\nsis-setup.exe";
|
||||
|
||||
Write-Host "Downloading NSIS installer...";
|
||||
Write-Host "Target path: $nsisInstaller";
|
||||
|
||||
# Try multiple sources
|
||||
$downloaded = $false;
|
||||
|
||||
# Source 1: Direct download from GitHub mirror
|
||||
try {
|
||||
Invoke-WebRequest -Uri $nsisUrl -OutFile $nsisInstaller -UseBasicParsing -TimeoutSec 300;
|
||||
$nsisUrl = "https://github.com/hsluoyz/NSIS/raw/master/nsis-3.08-setup.exe";
|
||||
Write-Host "Trying source 1: GitHub mirror...";
|
||||
Invoke-WebRequest -Uri $nsisUrl -OutFile $nsisInstaller -UseBasicParsing -TimeoutSec 180;
|
||||
if (Test-Path $nsisInstaller) {
|
||||
$fileSize = (Get-Item $nsisInstaller).Length / 1MB;
|
||||
Write-Host "Downloaded successfully: $([math]::Round($fileSize, 2)) MB";
|
||||
$downloaded = $true;
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Failed to download from SourceForge, trying alternative source...";
|
||||
$nsisUrl = "https://nsis.sourceforge.io/mediawiki/images/4/4a/Nsis-3.09-setup.exe";
|
||||
Write-Host "Source 1 failed: $_";
|
||||
}
|
||||
|
||||
# Source 2: SourceForge
|
||||
if (-not $downloaded) {
|
||||
try {
|
||||
$nsisUrl = "https://sourceforge.net/projects/nsis/files/NSIS%203/3.08/nsis-3.08-setup.exe/download";
|
||||
Write-Host "Trying source 2: SourceForge...";
|
||||
Invoke-WebRequest -Uri $nsisUrl -OutFile $nsisInstaller -UseBasicParsing -TimeoutSec 300;
|
||||
if (Test-Path $nsisInstaller) {
|
||||
$fileSize = (Get-Item $nsisInstaller).Length / 1MB;
|
||||
Write-Host "Downloaded successfully: $([math]::Round($fileSize, 2)) MB";
|
||||
$downloaded = $true;
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Source 2 failed: $_";
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $downloaded) {
|
||||
Write-Host "ERROR: All download sources failed";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Verify file exists and is not empty
|
||||
if (-not (Test-Path $nsisInstaller)) {
|
||||
Write-Host "ERROR: Installer file not found at $nsisInstaller";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
$fileSize = (Get-Item $nsisInstaller).Length;
|
||||
if ($fileSize -lt 1000000) {
|
||||
Write-Host "ERROR: Installer file too small ($fileSize bytes), download may be incomplete";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
Write-Host "Installing NSIS silently...";
|
||||
Start-Process -FilePath $nsisInstaller -ArgumentList "/S" -Wait -NoNewWindow;
|
||||
|
||||
# Wait for installation to complete
|
||||
Start-Sleep -Seconds 5;
|
||||
|
||||
# Add NSIS to PATH
|
||||
$nsisPath = "C:\Program Files (x86)\NSIS";
|
||||
$env:Path += ";$nsisPath";
|
||||
if (-not (Test-Path $nsisPath)) {
|
||||
# Try x64 path
|
||||
$nsisPath = "C:\Program Files\NSIS";
|
||||
}
|
||||
|
||||
if (Test-Path $nsisPath) {
|
||||
$env:Path = "$nsisPath;$env:Path";
|
||||
Write-Host "NSIS path added: $nsisPath";
|
||||
} else {
|
||||
Write-Host "ERROR: NSIS installation directory not found";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
Write-Host "Verifying NSIS installation...";
|
||||
& makensis /VERSION;
|
||||
|
||||
$makensisPath = Join-Path $nsisPath "makensis.exe";
|
||||
if (Test-Path $makensisPath) {
|
||||
& $makensisPath /VERSION;
|
||||
Write-Host "NSIS installed successfully";
|
||||
} else {
|
||||
Write-Host "ERROR: makensis.exe not found at $makensisPath";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Clean up installer
|
||||
Remove-Item $nsisInstaller -ErrorAction SilentlyContinue;
|
||||
Write-Host "";
|
||||
|
||||
# Step 4.7: Build NSIS installer
|
||||
@@ -195,7 +260,11 @@ jobs:
|
||||
|
||||
# Ensure NSIS is in PATH
|
||||
$nsisPath = "C:\Program Files (x86)\NSIS";
|
||||
$env:Path += ";$nsisPath";
|
||||
if (-not (Test-Path $nsisPath)) {
|
||||
$nsisPath = "C:\Program Files\NSIS";
|
||||
}
|
||||
$env:Path = "$nsisPath;$env:Path";
|
||||
Write-Host "Using NSIS from: $nsisPath";
|
||||
|
||||
cd installer;
|
||||
python build_installer.py;
|
||||
|
||||
@@ -42,7 +42,7 @@ VERSION = "1.0"
|
||||
WINDOW_TITLE = "AI回复连接入口-V1.0"
|
||||
|
||||
# 应用版本号(用于版本检查)
|
||||
APP_VERSION = "1.5.2"
|
||||
APP_VERSION = "1.5.3"
|
||||
|
||||
# 平台特定配置
|
||||
PLATFORMS = {
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
[
|
||||
{
|
||||
"version": "1.5.3",
|
||||
"update_type": "patch",
|
||||
"content": "[patch] 解决乱码bug",
|
||||
"author": "Gitea Actions Bot",
|
||||
"commit_hash": "7c0667cb39c2795ce9901e141e1a9ff698a4955b",
|
||||
"commit_short_hash": "7c0667cb",
|
||||
"branch": "develop",
|
||||
"release_time": "2025-10-11 16:09:00",
|
||||
"download_url": "https://ks3-cn-guangzhou.ksyuncs.com/shuidrop-chat-server/installers/ShuiDi_AI_Assistant_Setup_v1.5.3.exe",
|
||||
"stats": {
|
||||
"files_changed": 3,
|
||||
"lines_added": 60,
|
||||
"lines_deleted": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "1.5.2",
|
||||
"update_type": "patch",
|
||||
|
||||
Reference in New Issue
Block a user