1
1
Ruben 6 сар өмнө
parent
commit
df0a8e3e03

+ 8 - 4
.github/workflows/BuildWin32.yml

@@ -46,7 +46,7 @@ jobs:
       - name: Install Inno Setup
         run: |
           choco install innosetup -y
-          
+      
       # Step 7 (x64): Compile .ISS to .EXE Installer for x64
       - name: Compile .ISS to .EXE Installer (x64)
         run: |
@@ -54,14 +54,17 @@ jobs:
           $license_file = "${{ github.workspace }}/LICENSE"
           $app_icon = "${{ github.workspace }}/PicView/Icons/Logo.ico"
           
+          New-Item -Path "${{ github.workspace }}\Build\install" -ItemType Directory -Force
+          
           & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' `
             /O+ `
-            /DMyAppVersion=${{steps.get-version.outputs.version}} `
+            /DMyAppVersion="${{steps.get-version.outputs.version}}" `
             /DMyAppOutputDir="${{ github.workspace }}\Build\install" `
             /DMyFileSource="${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64" `
             /DMyAppOutputName="$output_name" `
             /DLicenseFile="$license_file" `
             /DAppIcon="$app_icon" `
+            /DVersionInfoVersion="${{steps.get-version.outputs.clean-version}}" `
             "${{ github.workspace }}\Build\install.iss"
         shell: pwsh
 
@@ -96,12 +99,13 @@ jobs:
           
           & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' `
             /O+ `
-            /DMyAppVersion=${{steps.get-version.outputs.version}} `
+            /DMyAppVersion="${{steps.get-version.outputs.version}}" `
             /DMyAppOutputDir="${{ github.workspace }}\Build\install" `
             /DMyFileSource="${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64" `
             /DMyAppOutputName="$output_name" `
             /DLicenseFile="$license_file" `
             /DAppIcon="$app_icon" `
+            /DVersionInfoVersion="${{steps.get-version.outputs.clean-version}}" `
             "${{ github.workspace }}\Build\install.iss"
         shell: pwsh
 
@@ -111,4 +115,4 @@ jobs:
         with:
           name: PicView-${{steps.get-version.outputs.version}}-installer-arm64
           path: ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-arm64.exe
-          retention-days: 14
+          retention-days: 14

+ 9 - 8
Build/Get-VersionInfo.ps1

@@ -8,13 +8,14 @@ $versionPrefix = $xml.Project.PropertyGroup.VersionPrefix
 $versionSuffix = $xml.Project.PropertyGroup.VersionSuffix
 $fileVersion = $xml.Project.PropertyGroup.FileVersion
 
-# Combine VersionPrefix and VersionSuffix
-$fullVersion = "$versionPrefix-$versionSuffix"
-
-# Replace double dashes with a single dash
-$fullVersion = $fullVersion -replace '--', '-'
-$fileVersion = $fileVersion -replace '--', '-'
+# Combine VersionPrefix and VersionSuffix only if VersionSuffix is not empty
+if ([string]::IsNullOrWhiteSpace($versionSuffix)) {
+    $fullVersion = $versionPrefix
+} else {
+    $fullVersion = "$versionPrefix-$versionSuffix"
+}
 
 # Output the results for GitHub Actions
-Write-Output "::set-output name=version::$fullVersion"
-Write-Output "::set-output name=file-version::$fileVersion"
+echo "version=$fullVersion" >> $env:GITHUB_OUTPUT
+echo "file-version=$fileVersion" >> $env:GITHUB_OUTPUT
+echo "clean-version=$versionPrefix" >> $env:GITHUB_OUTPUT