@@ -247,13 +247,14 @@ function Compress($software, $browser, $windows, $oshost) {
247
247
LogWrite " Starting Vagrant compression..."
248
248
# Compress Vagrant
249
249
$zipFolder = " $outputPath \VMBuild_$global :buildId \Vagrant\$browser \"
250
- $zipName = " $browser .$windows .Vagrant.zip "
250
+ $zipName = " $browser .$windows .Vagrant.box "
251
251
252
252
$sourceBox = " $global :Path \..\vms\output\Vagrant\edgems.box"
253
253
$source = " $global :Path \..\vms\output\Vagrant\$browser - $windows .box"
254
254
If (Test-Path $sourceBox ) { Move-Item $sourceBox $source - Force }
255
-
256
- Compress-SingleAndMultipart $zipFolder $zipName $source
255
+ # We do NOT want to try and further compress the .box, it is already compressed and
256
+ # adding the extra layer of archiving BREAKS `vagrant box add --name ModernIE https://aka.ms/msedge.win10.vagrant`
257
+ Compress-SingleAndMultipart $zipFolder $zipName $source $skipCompression = $True
257
258
}
258
259
}
259
260
@@ -266,7 +267,7 @@ function Generate-Hashes ($zipsPath, $outputPath) {
266
267
}
267
268
}
268
269
269
- function Compress-SingleAndMultipart ($zipFolder , $zipName , $source ) {
270
+ function Compress-SingleAndMultipart ($zipFolder , $zipName , $source , $skipCompression = $False ) {
270
271
$multipart = $global :Config.GenerateMultipart
271
272
272
273
IF (Test-Path $zipFolder ) {
@@ -276,14 +277,19 @@ function Compress-SingleAndMultipart ($zipFolder, $zipName, $source) {
276
277
277
278
$outputPath = $global :Config.OutputPath
278
279
279
- IF ($multipart -eq $True ) {
280
- LogWrite " Compressing VM to multipart file ZIP $source $zipName in $zipFolder "
281
- & 7z a $zipFolder$zipName $source - tzip - r - v1G - aoa | Out-Null
282
- }
283
-
284
- LogWrite " Compressing VM to single file ZIP $source $zipName in $zipFolder "
285
- & 7z a $zipFolder$zipName $source - tzip - r - aoa | Out-Null
280
+ IF ($skipCompression -eq $False ) {
281
+ IF ($multipart -eq $True ) {
282
+ LogWrite " Compressing VM to multipart file ZIP $source $zipName in $zipFolder "
283
+ & 7z a $zipFolder$zipName $source - tzip - r - v1G - aoa | Out-Null
284
+ }
286
285
286
+ LogWrite " Compressing VM to single file ZIP $source $zipName in $zipFolder "
287
+ & 7z a $zipFolder$zipName $source - tzip - r - aoa | Out-Null
288
+ } else {
289
+ # In the Vagrant case, we just want the .box not a .zip
290
+ Move-Item $source $zipFolder$zipName - Force
291
+ }
292
+
287
293
$md5FolderPath = " $outputPath \md5\VMBuild_$global :buildId "
288
294
LogWrite " Generating File Hashes..."
289
295
Generate- Hashes $zipFolder $md5FolderPath
@@ -642,4 +648,4 @@ If ($GenerateJSON -eq $True -or $Build -eq $True) {
642
648
Prepare- SofwareListJsonToBeNotified
643
649
Send-NotificationEmail
644
650
Remove-OutputFiles
645
- }
651
+ }
0 commit comments