From b1382fd0a7e20a1ed793c49b084c90e8d7bd02cc Mon Sep 17 00:00:00 2001
From: Ralf Kistner <ralf@journeyapps.com>
Date: Tue, 6 Feb 2018 15:11:35 +0200
Subject: [PATCH 1/2] Remove encodeUri from squirrel-windows packaging

Since Squirrel.Windows 1.7.x, Squirrel doesn't do URI encoding or decoding of pathnames anymore. Having encodeUri in here leaves the filenames in the escaped form after installation, which causes some issues.
---
 .../electron-builder-squirrel-windows/src/squirrelPack.ts   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/electron-builder-squirrel-windows/src/squirrelPack.ts b/packages/electron-builder-squirrel-windows/src/squirrelPack.ts
index bce8f692b2c..cc434b9af0b 100644
--- a/packages/electron-builder-squirrel-windows/src/squirrelPack.ts
+++ b/packages/electron-builder-squirrel-windows/src/squirrelPack.ts
@@ -165,7 +165,7 @@ async function pack(options: SquirrelOptions, directory: string, updateFile: str
   </metadata>
 </package>`
   debug(`Created NuSpec file:\n${nuspecContent}`)
-  archive.append(nuspecContent.replace(/\n/, "\r\n"), {name: `${encodeURI(options.name).replace(/%5B/g, "[").replace(/%5D/g, "]")}.nuspec`})
+  archive.append(nuspecContent.replace(/\n/, "\r\n"), {name: `${options.name}.nuspec`})
 
   //noinspection SpellCheckingInspection
   archive.append(`<?xml version="1.0" encoding="utf-8"?>
@@ -242,7 +242,7 @@ async function encodedZip(archive: any, dir: string, prefix: string, vendorPath:
       }
 
       // GBK file name encoding (or Non-English file name) caused a problem
-      const relativeSafeFilePath = encodeURI(file.substring(dir.length + 1).replace(/\\/g, "/")).replace(/%5B/g, "[").replace(/%5D/g, "]")
+      const relativeSafeFilePath = file.substring(dir.length + 1).replace(/\\/g, "/"))
       archive._append(file, {
         name: relativeSafeFilePath,
         prefix,
@@ -266,4 +266,4 @@ async function encodedZip(archive: any, dir: string, prefix: string, vendorPath:
     }
   })
   archive.finalize()
-}
\ No newline at end of file
+}

From deb29e7ce07bbb625ddd92da8271757464ff4697 Mon Sep 17 00:00:00 2001
From: Ralf Kistner <ralf@journeyapps.com>
Date: Tue, 6 Feb 2018 15:16:51 +0200
Subject: [PATCH 2/2] Update squirrelPack.ts

Fix typo.
---
 packages/electron-builder-squirrel-windows/src/squirrelPack.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/electron-builder-squirrel-windows/src/squirrelPack.ts b/packages/electron-builder-squirrel-windows/src/squirrelPack.ts
index cc434b9af0b..7b968f1a91f 100644
--- a/packages/electron-builder-squirrel-windows/src/squirrelPack.ts
+++ b/packages/electron-builder-squirrel-windows/src/squirrelPack.ts
@@ -242,7 +242,7 @@ async function encodedZip(archive: any, dir: string, prefix: string, vendorPath:
       }
 
       // GBK file name encoding (or Non-English file name) caused a problem
-      const relativeSafeFilePath = file.substring(dir.length + 1).replace(/\\/g, "/"))
+      const relativeSafeFilePath = file.substring(dir.length + 1).replace(/\\/g, "/")
       archive._append(file, {
         name: relativeSafeFilePath,
         prefix,