Problem with ZIP files created with PowerShell

Hello,

I have one small problem.
I did my own automated tool to build ZIP files for VoltBuilder.
Everything work’s well if i create the Zip with 7Zip or Winrar.
But not i create the Zip with Powershell (files cannot be read when i upload the file)

I have the following code:
[Reflection.Assembly]::LoadWithPartialName(‘System.IO.Compression.FileSystem’) | Out-Null
[io.compression.zipfile]::CreateFromDirectory($OutputDir, $ZipName)

Could you share a zip file that doesn’t work (with private information removed)?

Hello,

Thanks.

I put the file here : http://www.lorrainepresse.com/test/quangame_ios_release.zip

I tried to edit files inside, and don’t work with Builder.
Only way is to rebuild the Zip with 7Zip or Winrar.

Extract from VoltBuilder log:


VoltBuilder run started at 2020-11-01 12:05:30.568821
Plan: Indy
Preflight Check
iOS Distribution .p12 not found. Put it in your certificates folder.
iOS Distribution mobileprovision not found. Put it in your certificates folder.
Build 18e89a49-da9d-4c1d-af73-7a46b710a487 failed

It looks like you don’t actually have files in a certificates folder. Here’s what I see in your zip file:

Archive:  quangame_ios_release.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       12  2020-11-01 18:05   config.xml
      343  2020-11-01 18:03   voltbuilder.json
        5  2020-11-01 18:03   certificates\distribution.cer
        5  2020-11-01 18:03   certificates\distribution.pem
        5  2020-11-01 18:03   certificates\generate.bat
        5  2020-11-01 18:04   certificates\hooliapps.certSigningRequest
        5  2020-11-01 18:04   certificates\hooliapps.key
        5  2020-11-01 18:04   certificates\QuanGame_Distribution.mobileprovision
        5  2020-11-01 18:03   certificates\QuanGame_Distribution.p12
---------                     -------
      390                     9 files

Here’s excerpt from a working zip file:

        0  2020-05-19 11:09   certificates/
     3189  2020-05-19 10:50   certificates/ios_development.p12
     7331  2020-05-19 08:53   certificates/distribution.mobileprovision
     2124  2020-04-03 10:29   certificates/android.keystore
     3237  2020-05-19 10:48   certificates/ios_distribution.p12
     7532  2020-05-19 08:51   certificates/development.mobileprovision
     7120  2020-08-06 09:52   config.xml

Notice how the slashes are forward slashes as opposed to back slashes, and the directory has a line by itself?

Thanks for response.

So, the problem come from my Powershell script.

I tried with the following codes but i don’t know how to correct this problem.

#[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') | Out-Null
#[io.compression.zipfile]::CreateFromDirectory($OutputDir, $ZipName) 
#Get-ChildItem -Path $OutputDir | % {
#	$Compress = @{
#		LiteralPath = $_.FullName.Replace('\\', '/')
#		CompressionLevel = 'Optimal'
#		DestinationPath = $ZipName
#	}
#	Compress-Archive @Compress -Update
#}

I don’t know much about PowerShell, so I can’t help there. Have you considered using the Windows version of 7zip as a command line utility?