RBZ installation on MAC OS
-
I am generating my RBZ file using a Powershell script on my Windows PC, by collecting all plugin files, doing scrambling and then zip the files and rename to RBZ
[pre:14foiw11][Reflection.Assembly]::LoadWithPartialName( "System.IO.Compression.FileSystem" )
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
[System.IO.Compression.ZipFile]::CreateFromDirectory( $srcdir, $zipfilename, $compressionLevel, $True)
Copy-ToZip $srcdir -ZipFile $zipFilename[/pre:14foiw11]
Installation of the RBZ file works fine on my Windows PC, but on the MAC it fails.
When I unzip the file and zip it using Winzip, the Installation on the MAC is working.So, I guess, some of my parameters in the Powershell zip routine may be wrong.
Anybody having an idea what is wrong?
Help is very much appreciated!
-
it may be backslashes in your paths...
@unknownuser said:
ZipFile.CreateFromDirectory adds archive entries (ZipArchiveEntry) with back-slash "" in FullName which is not a path separator on Mac. Writing a custom packaging routine with a slash "/" as path separator in FullName fixes the issues: public static void ZipDirectory(string archiveFileName, string directoryPath) { using (var archive = ZipFile.Open(archiveFileName, ZipArchiveMode.Create)) { var rootDirectory = directoryPath.TrimEnd('\'); var files = Directory.GetFiles(rootDirectory, ".", SearchOption.AllDirectories); foreach (var fileName in files) { string relativePath = fileName.Substring(rootDirectory.Length + 1).Replace("\", "/"); ZipArchiveEntry entry = archive.CreateEntry(relativePath); using (var destination = entry.Open()) { using (var source = File.OpenRead(fileName)) { source.CopyTo(destination); } } } } }
WinZip commandline tools should work for both [web 100%,100:35sef4yi]http://www.winzip.com/downcl.html[/web:35sef4yi] as they even have a mac edition...
john
-
Hi John,
many thanks for your quick reply.It was really helpful. I am now using the command line of winzip in my Powershell script, as you have proposed. The generated RBZ file is now working on my MAC also.
Thanks a lot for your help.
Sonja
Advertisement