diff --git a/.gitignore b/.gitignore index 9c23e84..0c5cc4b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ SquirrelSetup.log .node-version .DS_Store spec/fixtures/app/Update.exe +vendor/7z.dll +vendor/7z.exe diff --git a/.npmignore b/.npmignore index 1ab833d..f48912d 100644 --- a/.npmignore +++ b/.npmignore @@ -5,3 +5,5 @@ appveyor.yml .npmignore .babelrc .eslintrc +vendor/7z.dll +vendor/7z.exe diff --git a/package.json b/package.json index 38505a0..5945cab 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "url": "https://github.com/electron/windows-installer" }, "scripts": { + "install": "node ./script/select-7z-arch.js", "build": "tsc", "prepublish": "npm run build", "lint": "eslint --ext .ts src spec", diff --git a/script/select-7z-arch.js b/script/select-7z-arch.js new file mode 100644 index 0000000..7be25c8 --- /dev/null +++ b/script/select-7z-arch.js @@ -0,0 +1,23 @@ +const fs = require('fs'); +const os = require('os'); + +/** + * Even if we're cross-compiling for a different arch like arm64, + * we still need to use the 7-Zip executable for the host arch + */ +const arch = os.arch; + +console.log('Selecting 7-Zip for arch ' + arch); + +// Copy the 7-Zip executable for the configured architecture. +try { + fs.copyFileSync('vendor/7z-' + arch + '.exe', 'vendor/7z.exe'); +} catch (err) { + throw err; +} + +try { + fs.copyFileSync('vendor/7z-' + arch + '.dll', 'vendor/7z.dll'); +} catch (err) { + throw err; +} diff --git a/vendor/7z-arm64.dll b/vendor/7z-arm64.dll new file mode 100644 index 0000000..7dcf437 Binary files /dev/null and b/vendor/7z-arm64.dll differ diff --git a/vendor/7z-arm64.exe b/vendor/7z-arm64.exe new file mode 100644 index 0000000..27cbb96 Binary files /dev/null and b/vendor/7z-arm64.exe differ diff --git a/vendor/7z.dll b/vendor/7z-x64.dll similarity index 100% rename from vendor/7z.dll rename to vendor/7z-x64.dll diff --git a/vendor/7z.exe b/vendor/7z-x64.exe similarity index 100% rename from vendor/7z.exe rename to vendor/7z-x64.exe diff --git a/vendor/Setup.exe b/vendor/Setup.exe index cea18ed..8c62c5c 100644 Binary files a/vendor/Setup.exe and b/vendor/Setup.exe differ diff --git a/vendor/Setup.pdb b/vendor/Setup.pdb index e5818d5..1780984 100644 Binary files a/vendor/Setup.pdb and b/vendor/Setup.pdb differ diff --git a/vendor/Squirrel-Mono.exe b/vendor/Squirrel-Mono.exe index dbfb68d..49fec85 100644 Binary files a/vendor/Squirrel-Mono.exe and b/vendor/Squirrel-Mono.exe differ diff --git a/vendor/Squirrel-Mono.pdb b/vendor/Squirrel-Mono.pdb index bde7964..294566f 100644 Binary files a/vendor/Squirrel-Mono.pdb and b/vendor/Squirrel-Mono.pdb differ diff --git a/vendor/Squirrel.exe b/vendor/Squirrel.exe index 2788d77..93108de 100644 Binary files a/vendor/Squirrel.exe and b/vendor/Squirrel.exe differ diff --git a/vendor/Squirrel.pdb b/vendor/Squirrel.pdb index 5fa93b3..331310a 100644 Binary files a/vendor/Squirrel.pdb and b/vendor/Squirrel.pdb differ diff --git a/vendor/StubExecutable.exe b/vendor/StubExecutable.exe index afc8cf3..32c8c6b 100644 Binary files a/vendor/StubExecutable.exe and b/vendor/StubExecutable.exe differ diff --git a/vendor/SyncReleases.exe b/vendor/SyncReleases.exe index e7c5d7e..861598d 100644 Binary files a/vendor/SyncReleases.exe and b/vendor/SyncReleases.exe differ diff --git a/vendor/SyncReleases.pdb b/vendor/SyncReleases.pdb index a1d881d..84a2432 100644 Binary files a/vendor/SyncReleases.pdb and b/vendor/SyncReleases.pdb differ diff --git a/vendor/WriteZipToSetup.exe b/vendor/WriteZipToSetup.exe index 9cd71ab..2bc3170 100644 Binary files a/vendor/WriteZipToSetup.exe and b/vendor/WriteZipToSetup.exe differ diff --git a/vendor/WriteZipToSetup.pdb b/vendor/WriteZipToSetup.pdb index d4d8482..bf2f2ec 100644 Binary files a/vendor/WriteZipToSetup.pdb and b/vendor/WriteZipToSetup.pdb differ diff --git a/vendor/template.wxs b/vendor/template.wxs index 91dde45..22d6d69 100644 --- a/vendor/template.wxs +++ b/vendor/template.wxs @@ -1,8 +1,9 @@ - + - - + + + @@ -11,21 +12,21 @@ - - + + - - + + - + - +