- 添加dist/目录到.gitignore,用于排除打包输出的绿色免安装版 - 添加Wails打包过程中的临时文件和自动生成文件到.gitignore - 删除build/windows/installer/wails_tools.nsh自动生成文件 - 添加Windows安装器临时目录和Webview2安装文件到忽略列表 feat(docs): 添加万川平台对接文档和产品素材 - 创建万川平台登录到获取模型信息的流程说明文档 - 添加万川平台对接实施计划文档 - 新增产品图片、公司简介图、宣传海报、教程截图、案例展示等素材文件 refactor(runtime): 扩展通知功能类型定义 - 添加NotificationOptions接口定义 - 添加NotificationAction接口定义 - 添加NotificationCategory接口定义 - 扩展通知相关的运行时API类型声明,包括初始化、发送、注册分类等功能
61 lines
2.7 KiB
PowerShell
61 lines
2.7 KiB
PowerShell
# 自动下载安装 NSIS
|
||
$ErrorActionPreference = "Stop"
|
||
|
||
Write-Host "==> 检查 NSIS 是否已安装..." -ForegroundColor Cyan
|
||
$existingNsis = Get-Command makensis.exe -ErrorAction SilentlyContinue
|
||
if ($existingNsis) {
|
||
Write-Host " NSIS 已安装: $($existingNsis.Source)" -ForegroundColor Green
|
||
Write-Host " 跳过安装,可以直接执行打包命令。" -ForegroundColor Yellow
|
||
exit 0
|
||
}
|
||
|
||
$nsisVersion = "3.10"
|
||
$nsisUrl = "https://sourceforge.net/projects/nsis/files/NSIS%203/$nsisVersion/nsis-$nsisVersion-setup.exe/download"
|
||
$installerPath = "$env:TEMP\nsis-$nsisVersion-setup.exe"
|
||
|
||
Write-Host "==> 下载 NSIS $nsisVersion 安装程序..." -ForegroundColor Cyan
|
||
Write-Host " 从: $nsisUrl" -ForegroundColor Gray
|
||
Write-Host " 到: $installerPath" -ForegroundColor Gray
|
||
|
||
try {
|
||
$ProgressPreference = 'SilentlyContinue'
|
||
Invoke-WebRequest -Uri $nsisUrl -OutFile $installerPath -UseBasicParsing -TimeoutSec 300
|
||
Write-Host " 下载完成 ($('{0:N2}' -f ((Get-Item $installerPath).Length / 1MB)) MB)" -ForegroundColor Green
|
||
} catch {
|
||
Write-Host " 下载失败: $($_.Exception.Message)" -ForegroundColor Red
|
||
Write-Host ""
|
||
Write-Host "请手动下载并安装 NSIS:" -ForegroundColor Yellow
|
||
Write-Host " 1. 访问: https://nsis.sourceforge.io/Download" -ForegroundColor Cyan
|
||
Write-Host " 2. 下载 NSIS 3.10 或更高版本" -ForegroundColor Cyan
|
||
Write-Host " 3. 运行安装程序(默认安装路径即可)" -ForegroundColor Cyan
|
||
exit 1
|
||
}
|
||
|
||
Write-Host ""
|
||
Write-Host "==> 正在安装 NSIS..." -ForegroundColor Cyan
|
||
Write-Host " 安装位置: C:\Program Files (x86)\NSIS" -ForegroundColor Gray
|
||
Write-Host " (如果弹出 UAC 提示,请点击'是'授权)" -ForegroundColor Yellow
|
||
|
||
try {
|
||
Start-Process -FilePath $installerPath -ArgumentList "/S" -Wait -Verb RunAs
|
||
Write-Host " 安装完成" -ForegroundColor Green
|
||
} catch {
|
||
Write-Host " 安装失败: $($_.Exception.Message)" -ForegroundColor Red
|
||
Write-Host " 请手动运行: $installerPath" -ForegroundColor Yellow
|
||
exit 1
|
||
}
|
||
|
||
Write-Host ""
|
||
Write-Host "==> 清理临时文件..." -ForegroundColor Cyan
|
||
Remove-Item $installerPath -Force -ErrorAction SilentlyContinue
|
||
|
||
Write-Host ""
|
||
Write-Host "==> NSIS 安装完成!" -ForegroundColor Green
|
||
Write-Host ""
|
||
Write-Host "下一步操作:" -ForegroundColor Yellow
|
||
Write-Host " 1. 关闭当前 PowerShell 窗口" -ForegroundColor Cyan
|
||
Write-Host " 2. 重新打开 PowerShell(让 PATH 环境变量生效)" -ForegroundColor Cyan
|
||
Write-Host " 3. 执行打包命令: .\打包.bat -Installer" -ForegroundColor Cyan
|
||
Write-Host ""
|
||
Write-Host "打包完成后,安装包会在 build\bin\ 目录,文件名带时间戳" -ForegroundColor Gray
|