Преглед на файлове

CI: Set Windows packaging to default to zip (#101)

The current code either packages a .msi or generates a .zip.
Many users prefer the zip, especially for portable installs.
A zip also mitigates code signing warnings.
This change always generates the .zip file.
If -BuildInstaller is specified then it will also build a .msi file.
Paul Peavyhouse преди 1 година
родител
ревизия
bd1d6c7a6b
променени са 1 файла, в които са добавени 12 реда и са изтрити 11 реда
  1. 12 11
      .github/scripts/Package-Windows.ps1

+ 12 - 11
.github/scripts/Package-Windows.ps1

@@ -64,10 +64,20 @@ function Package {
 
 
     Remove-Item @RemoveArgs
     Remove-Item @RemoveArgs
 
 
+    Log-Group "Archiving ${ProductName}..."
+    $CompressArgs = @{
+        Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
+        CompressionLevel = 'Optimal'
+        DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
+        Verbose = ($Env:CI -ne $null)
+    }
+    Compress-Archive -Force @CompressArgs
+    Log-Group
+
     if ( ( $BuildInstaller ) ) {
     if ( ( $BuildInstaller ) ) {
         Log-Group "Packaging ${ProductName}..."
         Log-Group "Packaging ${ProductName}..."
-        $IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"
 
 
+        $IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"
         if ( ! ( Test-Path -Path $IsccFile ) ) {
         if ( ! ( Test-Path -Path $IsccFile ) ) {
             throw 'InnoSetup install script not found. Run the build script or the CMake build and install procedures first.'
             throw 'InnoSetup install script not found. Run the build script or the CMake build and install procedures first.'
         }
         }
@@ -79,18 +89,9 @@ function Package {
         Invoke-External iscc ${IsccFile} /O"${ProjectRoot}/release" /F"${OutputName}-Installer"
         Invoke-External iscc ${IsccFile} /O"${ProjectRoot}/release" /F"${OutputName}-Installer"
         Remove-Item -Path Package -Recurse
         Remove-Item -Path Package -Recurse
         Pop-Location -Stack BuildTemp
         Pop-Location -Stack BuildTemp
-    } else {
-        Log-Group "Archiving ${ProductName}..."
-        $CompressArgs = @{
-            Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
-            CompressionLevel = 'Optimal'
-            DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
-            Verbose = ($Env:CI -ne $null)
-        }
 
 
-        Compress-Archive -Force @CompressArgs
+        Log-Group
     }
     }
-    Log-Group
 }
 }
 
 
 Package
 Package