Jelajahi Sumber

Update installer workflow

Ruben 1 tahun lalu
induk
melakukan
651bec8807
2 mengubah file dengan 27 tambahan dan 11 penghapusan
  1. 16 10
      .github/workflows/WinX64.yml
  2. 11 1
      Build/install.iss

+ 16 - 10
.github/workflows/WinX64.yml

@@ -33,10 +33,10 @@ jobs:
       # Step 4: Define paths
       - name: Define paths
         id: paths
-        shell: pwsh
         run: |
-          $outputDir = (Resolve-Path "PicView-v.${{steps.get-version.outputs.file-version}}-win-x64").Path
+          $outputDir = "PicView-v.${{steps.get-version.outputs.file-version}}-win-x64"
           echo "##[set-output name=output_dir;]$outputDir"
+        shell: pwsh
 
       # Step 5: Run dotnet publish
       - name: Publish the project
@@ -83,21 +83,27 @@ jobs:
           path: ${{ steps.paths.outputs.output_dir }}
           retention-days: 14
           
-      # Step 9: Generate the Inno Setup Installer
-      - name: Generate Inno Setup variables
+      # Step 9: Generate the Inno Setup Installer and copy files to the build directory
+      - name: Generate Inno Setup variables and copy files to Build directory
         run: |
-          
-          # Create output directory for installer
-          New-Item -Path ${{ steps.paths.outputs.output_dir }}\install -ItemType Directory -Force
-        
-        shell: pwsh
+            # Create the directory inside 'Build'
+            $buildDir = Join-Path -Path "${{ github.workspace }}" -ChildPath "Build\install"
+            if (Test-Path $buildDir) {
+              Remove-Item -Path $buildDir -Recurse -Force
+            }
+            New-Item -Path $buildDir -ItemType Directory | Out-Null
+
+            # Copy the portable build output to this new directory
+            $outputPath = "${{ steps.paths.outputs.output_dir }}"
+            Copy-Item -Path "$outputPath\*" -Destination $buildDir -Recurse -Force
+          shell: pwsh
 
        # Step 10: Compile .ISS to .EXE Installer
       - name: Compile .ISS to .EXE Installer
         uses: Minionguyjpro/[email protected]
         with:
           path: .\Build\install.iss
-          options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ steps.paths.outputs.output_dir }} /DAppIcon=${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico /DLicenseFile=${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt
+           options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ github.workspace }}\Build\install /DMyFileSource=${{ github.workspace }}\Build\install /DAppIcon=${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico /DLicenseFile=${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt
   
       # Step 11: Upload the Inno Setup Installer as an artifact
       - name: Upload Inno Setup Installer

+ 11 - 1
Build/install.iss

@@ -28,13 +28,23 @@ VersionInfoVersion={#MyAppVersion}
 SetupWindowTitle=Setup - {#MyAppName} v{#MyAppVersion}
 SetupAppTitle=Setup - {#MyAppName} v{#MyAppVersion}
 
+[Languages]
+Name: "en"; MessagesFile: "compiler:Default.isl"
+Name: "de"; MessagesFile: "compiler:Languages\German.isl"
+Name: "da"; MessagesFile: "compiler:Languages\Danish.isl"
+Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl"
+Name: "fr"; MessagesFile: "compiler:Languages\French.isl"
+Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
+Name: "ko"; MessagesFile: "compiler:Languages\Korean.isl"
+Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl"
+
 [Tasks]
 Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
 Name: "openwith"; Description: "Open with {#MyAppName}"; GroupDescription: "Context menu:"; Flags: unchecked
 Name: "browsefolder"; Description: "Browse folder with {#MyAppName}"; GroupDescription: "Context menu:"; Flags: unchecked
 
 [Files]
-Source: "{#MyAppOutputDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: "{#MyFileSource}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
 
 [Icons]
 Name: "{autoprograms}\PicView"; Filename: "{app}\PicView.exe"