This commit is contained in:
朱子楚\zhuzi 2023-09-29 17:22:22 +08:00
parent 8e84ea1e3a
commit d8e3cf00b4
3 changed files with 12 additions and 12 deletions

View File

@ -6,7 +6,7 @@
#define MyAppPublisher "ZhuZiChu" #define MyAppPublisher "ZhuZiChu"
#define MyAppURL "https://zhuzichu520.github.io/" #define MyAppURL "https://zhuzichu520.github.io/"
#define MyAppExeName "example.exe" #define MyAppExeName "example.exe"
#define MyAppFileDir "example-win64_msvc2019_64-6.5.0" #define MyAppFileDir "dist"
[Setup] [Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.

View File

@ -15,16 +15,16 @@ Write-Host "scriptDir" $scriptDir
function Main() { function Main() {
New-Item -ItemType Directory $archiveName New-Item -ItemType Directory dist
# 拷贝exe # 拷贝exe
Copy-Item bin\release\* $archiveName\ -Force -Recurse | Out-Null Copy-Item bin\release\* dist\ -Force -Recurse | Out-Null
# 拷贝依赖 # 拷贝依赖
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName windeployqt --qmldir . --plugindir dist\plugins --no-translations --compiler-runtime dist\$targetName
# 删除不必要的文件 # 删除不必要的文件
$excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb") $excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb")
Remove-Item -Path $archiveName -Include $excludeList -Recurse -Force Remove-Item -Path $archiveName -Include $excludeList -Recurse -Force
# 打包zip # 打包zip
Compress-Archive -Path $archiveName $archiveName'.zip' Compress-Archive -Path dist $archiveName'.zip'
} }
if ($null -eq $archiveName || $null -eq $targetName) { if ($null -eq $archiveName || $null -eq $targetName) {

View File

@ -25,22 +25,22 @@ Write-Host "scriptDir" $scriptDir
function Main() { function Main() {
New-Item -ItemType Directory $archiveName New-Item -ItemType Directory dist
# 拷贝exe # 拷贝exe
Copy-Item bin\release\* $archiveName\ -Force -Recurse | Out-Null Copy-Item bin\release\* dist -Force -Recurse | Out-Null
# 拷贝依赖 # 拷贝依赖
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName windeployqt --qmldir . --plugindir dist\plugins --no-translations --compiler-runtime dist\$targetName
# 删除不必要的文件 # 删除不必要的文件
$excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb") $excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb")
Remove-Item -Path $archiveName -Include $excludeList -Recurse -Force Remove-Item -Path dist -Include $excludeList -Recurse -Force
# 拷贝vcRedist dll # 拷贝vcRedist dll
$redistDll="{0}{1}\*.CRT\*.dll" -f $env:vcToolsRedistDir.Trim(),$env:msvcArch $redistDll="{0}{1}\*.CRT\*.dll" -f $env:vcToolsRedistDir.Trim(),$env:msvcArch
Copy-Item $redistDll $archiveName\ Copy-Item $redistDll dist\
# 拷贝WinSDK dll # 拷贝WinSDK dll
$sdkDll="{0}Redist\{1}ucrt\DLLs\{2}\*.dll" -f $env:winSdkDir.Trim(),$env:winSdkVer.Trim(),$env:msvcArch $sdkDll="{0}Redist\{1}ucrt\DLLs\{2}\*.dll" -f $env:winSdkDir.Trim(),$env:winSdkVer.Trim(),$env:msvcArch
Copy-Item $sdkDll $archiveName\ Copy-Item $sdkDll dist\
# 打包zip # 打包zip
Compress-Archive -Path $archiveName $archiveName'.zip' Compress-Archive -Path dist $archiveName'.zip'
} }
if ($null -eq $archiveName || $null -eq $targetName) { if ($null -eq $archiveName || $null -eq $targetName) {