Skip to content

Commit

Permalink
Fix add-in unpacking issue
Browse files Browse the repository at this point in the history
If an adding package is created on windows, the zip file entries
may contain backslashes. When unpacking on pack, the backslashes
need to be converted to regular slashes.
  • Loading branch information
slluis committed Mar 21, 2017
1 parent d903894 commit 70e9d43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Mono.Addins.Setup/Mono.Addins.Setup/AddinPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ internal override void PrepareInstall (IProgressMonitor monitor, AddinStore serv
using (FileStream fs = new FileStream (packFile, FileMode.Open, FileAccess.Read)) {
ZipFile zip = new ZipFile (fs);
foreach (ZipEntry entry in zip) {
string path = Path.Combine (tempFolder, entry.Name);
string name;
if (Path.PathSeparator == '\\')
name = entry.Name.Replace ('/', '\\');
else
name = entry.Name.Replace ('\\', '/');
string path = Path.Combine (tempFolder, name);
string dir = Path.GetDirectoryName (path);
if (!Directory.Exists (dir))
Directory.CreateDirectory (dir);
Expand Down

0 comments on commit 70e9d43

Please sign in to comment.