diff --git a/packages/electron-builder-squirrel-windows/src/squirrelPack.ts b/packages/electron-builder-squirrel-windows/src/squirrelPack.ts index bce8f692b2c..2475b612646 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 ` 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(` @@ -241,8 +241,7 @@ async function encodedZip(archive: any, dir: string, prefix: string, vendorPath: return } - // 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, diff --git a/test/out/windows/__snapshots__/squirrelWindowsTest.js.snap b/test/out/windows/__snapshots__/squirrelWindowsTest.js.snap index 2cc38c11610..ad6800f232c 100644 --- a/test/out/windows/__snapshots__/squirrelWindowsTest.js.snap +++ b/test/out/windows/__snapshots__/squirrelWindowsTest.js.snap @@ -77,8 +77,8 @@ Array [ "lib/net45/node.dll", "lib/net45/pdf_viewer_resources.pak", "lib/net45/snapshot_blob.bin", - "lib/net45/Test%20App%20%C3%9FW.exe", - "lib/net45/Test%20App%20%C3%9FW_ExecutionStub.exe", + "lib/net45/Test App ßW.exe", + "lib/net45/Test App ßW_ExecutionStub.exe", "lib/net45/ucrtbase.dll", "lib/net45/ui_resources_200_percent.pak", "lib/net45/Update.exe", @@ -175,8 +175,8 @@ Array [ "lib/net45/node.dll", "lib/net45/pdf_viewer_resources.pak", "lib/net45/snapshot_blob.bin", - "lib/net45/Test%20App%20%C3%9FW.exe", - "lib/net45/Test%20App%20%C3%9FW_ExecutionStub.exe", + "lib/net45/Test App ßW.exe", + "lib/net45/Test App ßW_ExecutionStub.exe", "lib/net45/ucrtbase.dll", "lib/net45/ui_resources_200_percent.pak", "lib/net45/Update.exe",