@loongdotjs/electron-winstaller 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +95 -0
- package/.editorconfig +9 -0
- package/.eslintrc.json +30 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/dependabot.yml +6 -0
- package/.github/workflows/add-to-project.yml +29 -0
- package/.github/workflows/semantic.yml +26 -0
- package/.gitignore +18 -0
- package/.releaserc.json +9 -0
- package/LICENSE +20 -0
- package/README.md +189 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.js +350 -0
- package/lib/index.js.map +1 -0
- package/lib/options.d.ts +219 -0
- package/lib/options.js +6 -0
- package/lib/options.js.map +1 -0
- package/lib/sign.d.ts +15 -0
- package/lib/sign.js +189 -0
- package/lib/sign.js.map +1 -0
- package/lib/spawn-promise.d.ts +3 -0
- package/lib/spawn-promise.js +54 -0
- package/lib/spawn-promise.js.map +1 -0
- package/lib/temp-utils.d.ts +3 -0
- package/lib/temp-utils.js +32 -0
- package/lib/temp-utils.js.map +1 -0
- package/package.json +69 -0
- package/resources/install-spinner.gif +0 -0
- package/script/select-7z-arch.js +33 -0
- package/spec/convert-version-spec.ts +14 -0
- package/spec/fixtures/app/LICENSE +0 -0
- package/spec/fixtures/app/chromiumcontent.dll +0 -0
- package/spec/fixtures/app/d3dcompiler_47.dll +0 -0
- package/spec/fixtures/app/ffmpegsumo.dll +0 -0
- package/spec/fixtures/app/icudtl.dat +0 -0
- package/spec/fixtures/app/locales/en.pak +0 -0
- package/spec/fixtures/app/msvcp120.dll +0 -0
- package/spec/fixtures/app/msvcr120.dll +0 -0
- package/spec/fixtures/app/myapp.exe +0 -0
- package/spec/fixtures/app/natives_blob.bin +0 -0
- package/spec/fixtures/app/resources/app/package.json +7 -0
- package/spec/fixtures/app/snapshot_blob.bin +0 -0
- package/spec/fixtures/app/swiftshader/libEGL.dll +0 -0
- package/spec/fixtures/app/swiftshader/libGLESv2.dll +0 -0
- package/spec/fixtures/app/vccorlib120.dll +0 -0
- package/spec/fixtures/app/vk_swiftshader.dll +0 -0
- package/spec/fixtures/app/vk_swiftshader_icd.json +0 -0
- package/spec/fixtures/app/xinput1_3.dll +0 -0
- package/spec/helpers/helpers.ts +12 -0
- package/spec/helpers/windowsSignHook.js +8 -0
- package/spec/installer-spec.ts +70 -0
- package/spec/sign-spec.ts +48 -0
- package/src/index.ts +271 -0
- package/src/options.ts +228 -0
- package/src/sign.ts +89 -0
- package/src/spawn-promise.ts +55 -0
- package/src/temp-utils.ts +9 -0
- package/template.nuspectemplate +30 -0
- package/tsconfig.json +21 -0
- package/typedoc.json +4 -0
- package/vendor/7z-arm64.dll +0 -0
- package/vendor/7z-arm64.exe +0 -0
- package/vendor/7z-x64.dll +0 -0
- package/vendor/7z-x64.exe +0 -0
- package/vendor/Microsoft.Deployment.Resources.dll +0 -0
- package/vendor/Microsoft.Deployment.WindowsInstaller.dll +0 -0
- package/vendor/Setup.exe +0 -0
- package/vendor/Setup.pdb +0 -0
- package/vendor/Squirrel-Mono.exe +0 -0
- package/vendor/Squirrel-Mono.pdb +0 -0
- package/vendor/Squirrel.com +0 -0
- package/vendor/Squirrel.exe +0 -0
- package/vendor/Squirrel.pdb +0 -0
- package/vendor/StubExecutable.exe +0 -0
- package/vendor/SyncReleases.exe +0 -0
- package/vendor/SyncReleases.pdb +0 -0
- package/vendor/WixNetFxExtension.dll +0 -0
- package/vendor/WriteZipToSetup.exe +0 -0
- package/vendor/WriteZipToSetup.pdb +0 -0
- package/vendor/candle.exe +0 -0
- package/vendor/candle.exe.config +18 -0
- package/vendor/darice.cub +0 -0
- package/vendor/light.exe +0 -0
- package/vendor/light.exe.config +18 -0
- package/vendor/nuget.exe +0 -0
- package/vendor/rcedit.exe +0 -0
- package/vendor/signtool.exe +0 -0
- package/vendor/template.wxs +39 -0
- package/vendor/wconsole.dll +0 -0
- package/vendor/winterop.dll +0 -0
- package/vendor/wix.dll +0 -0
- package/yarn.lock +2008 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
+
};
|
|
64
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
+
exports.createWindowsInstaller = exports.convertVersion = void 0;
|
|
66
|
+
var asar = __importStar(require("@electron/asar"));
|
|
67
|
+
var temp_utils_1 = require("./temp-utils");
|
|
68
|
+
var fs = __importStar(require("fs-extra"));
|
|
69
|
+
var path = __importStar(require("path"));
|
|
70
|
+
var os = __importStar(require("os"));
|
|
71
|
+
var child_process_1 = require("child_process");
|
|
72
|
+
var spawn_promise_1 = __importDefault(require("./spawn-promise"));
|
|
73
|
+
var lodash_1 = require("lodash");
|
|
74
|
+
var sign_1 = require("./sign");
|
|
75
|
+
var log = require('debug')('electron-windows-installer:main');
|
|
76
|
+
/**
|
|
77
|
+
* A utility function to convert SemVer version strings into NuGet-compatible
|
|
78
|
+
* version strings.
|
|
79
|
+
* @param version A SemVer version string
|
|
80
|
+
* @returns A NuGet-compatible version string
|
|
81
|
+
* @see {@link https://semver.org/ | Semantic Versioning specification}
|
|
82
|
+
* @see {@link https://learn.microsoft.com/en-us/nuget/concepts/package-versioning?tabs=semver20sort | NuGet versioning specification}
|
|
83
|
+
*/
|
|
84
|
+
function convertVersion(version) {
|
|
85
|
+
var parts = version.split('+')[0].split('-');
|
|
86
|
+
var mainVersion = parts.shift();
|
|
87
|
+
if (parts.length > 0) {
|
|
88
|
+
return [mainVersion, parts.join('-').replace(/\./g, '')].join('-');
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return mainVersion;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.convertVersion = convertVersion;
|
|
95
|
+
function checkIfCommandExists(command) {
|
|
96
|
+
var checkCommand = os.platform() === 'win32' ? 'where' : 'which';
|
|
97
|
+
return new Promise(function (resolve) {
|
|
98
|
+
(0, child_process_1.exec)("".concat(checkCommand, " ").concat(command), function (error) {
|
|
99
|
+
resolve(error ? false : true);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* This package's main function, which creates a Squirrel.Windows executable
|
|
105
|
+
* installer and optionally code-signs the output.
|
|
106
|
+
*
|
|
107
|
+
* @param options Options for installer generation and signing
|
|
108
|
+
* @see {@link https://github.com/Squirrel/Squirrel.Windows | Squirrel.Windows}
|
|
109
|
+
*/
|
|
110
|
+
function createWindowsInstaller(options) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
var useMono, monoExe, wineExe, _a, hasWine, hasMono, appDirectory, outputDirectory, loadingGif, vendorPath, vendorUpdate, appUpdate, cmd_1, args_1, defaultLoadingGif, certificateFile, certificatePassword, remoteReleases, signWithParams, remoteToken, windowsSign, metadata, appResources, asarFile, appMetadata, templatePath, templateData, _i, _b, f, nuspecContent, nugetOutput, targetNuspecPath, cmd, args, _c, nupkgPath, _d, _e, setupPath, unfixedSetupPath, msiPath, unfixedMsiPath;
|
|
113
|
+
return __generator(this, function (_f) {
|
|
114
|
+
switch (_f.label) {
|
|
115
|
+
case 0:
|
|
116
|
+
useMono = false;
|
|
117
|
+
monoExe = 'mono';
|
|
118
|
+
wineExe = ['arm64', 'x64'].includes(process.arch) ? 'wine64' : 'wine';
|
|
119
|
+
if (!(process.platform !== 'win32')) return [3 /*break*/, 2];
|
|
120
|
+
useMono = true;
|
|
121
|
+
return [4 /*yield*/, Promise.all([
|
|
122
|
+
checkIfCommandExists(wineExe),
|
|
123
|
+
checkIfCommandExists(monoExe)
|
|
124
|
+
])];
|
|
125
|
+
case 1:
|
|
126
|
+
_a = _f.sent(), hasWine = _a[0], hasMono = _a[1];
|
|
127
|
+
if (!hasWine || !hasMono) {
|
|
128
|
+
throw new Error('You must install both Mono and Wine on non-Windows');
|
|
129
|
+
}
|
|
130
|
+
log("Using Mono: '".concat(monoExe, "'"));
|
|
131
|
+
log("Using Wine: '".concat(wineExe, "'"));
|
|
132
|
+
_f.label = 2;
|
|
133
|
+
case 2:
|
|
134
|
+
appDirectory = options.appDirectory, outputDirectory = options.outputDirectory, loadingGif = options.loadingGif;
|
|
135
|
+
outputDirectory = path.resolve(outputDirectory || 'installer');
|
|
136
|
+
vendorPath = options.vendorDirectory || path.join(__dirname, '..', 'vendor');
|
|
137
|
+
vendorUpdate = path.join(vendorPath, 'Squirrel.exe');
|
|
138
|
+
appUpdate = path.join(appDirectory, 'Squirrel.exe');
|
|
139
|
+
return [4 /*yield*/, fs.copy(vendorUpdate, appUpdate)];
|
|
140
|
+
case 3:
|
|
141
|
+
_f.sent();
|
|
142
|
+
if (!(options.setupIcon && (options.skipUpdateIcon !== true))) return [3 /*break*/, 5];
|
|
143
|
+
cmd_1 = path.join(vendorPath, 'rcedit.exe');
|
|
144
|
+
args_1 = [
|
|
145
|
+
appUpdate,
|
|
146
|
+
'--set-icon', options.setupIcon
|
|
147
|
+
];
|
|
148
|
+
if (useMono) {
|
|
149
|
+
args_1.unshift(cmd_1);
|
|
150
|
+
cmd_1 = wineExe;
|
|
151
|
+
}
|
|
152
|
+
return [4 /*yield*/, (0, spawn_promise_1.default)(cmd_1, args_1)];
|
|
153
|
+
case 4:
|
|
154
|
+
_f.sent();
|
|
155
|
+
_f.label = 5;
|
|
156
|
+
case 5:
|
|
157
|
+
defaultLoadingGif = path.join(__dirname, '..', 'resources', 'install-spinner.gif');
|
|
158
|
+
loadingGif = loadingGif ? path.resolve(loadingGif) : defaultLoadingGif;
|
|
159
|
+
certificateFile = options.certificateFile, certificatePassword = options.certificatePassword, remoteReleases = options.remoteReleases, signWithParams = options.signWithParams, remoteToken = options.remoteToken, windowsSign = options.windowsSign;
|
|
160
|
+
metadata = {
|
|
161
|
+
description: '',
|
|
162
|
+
iconUrl: 'https://raw.githubusercontent.com/electron/electron/main/shell/browser/resources/win/electron.ico'
|
|
163
|
+
};
|
|
164
|
+
if (!(options.usePackageJson !== false)) return [3 /*break*/, 10];
|
|
165
|
+
appResources = path.join(appDirectory, 'resources');
|
|
166
|
+
asarFile = path.join(appResources, 'app.asar');
|
|
167
|
+
appMetadata = void 0;
|
|
168
|
+
return [4 /*yield*/, fs.pathExists(asarFile)];
|
|
169
|
+
case 6:
|
|
170
|
+
if (!_f.sent()) return [3 /*break*/, 7];
|
|
171
|
+
appMetadata = JSON.parse(asar.extractFile(asarFile, 'package.json').toString());
|
|
172
|
+
return [3 /*break*/, 9];
|
|
173
|
+
case 7: return [4 /*yield*/, fs.readJson(path.join(appResources, 'app', 'package.json'))];
|
|
174
|
+
case 8:
|
|
175
|
+
appMetadata = _f.sent();
|
|
176
|
+
_f.label = 9;
|
|
177
|
+
case 9:
|
|
178
|
+
Object.assign(metadata, {
|
|
179
|
+
exe: "".concat(appMetadata.name, ".exe"),
|
|
180
|
+
title: appMetadata.productName || appMetadata.name
|
|
181
|
+
}, appMetadata);
|
|
182
|
+
_f.label = 10;
|
|
183
|
+
case 10:
|
|
184
|
+
Object.assign(metadata, options);
|
|
185
|
+
if (!metadata.authors) {
|
|
186
|
+
if (typeof (metadata.author) === 'string') {
|
|
187
|
+
metadata.authors = metadata.author;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
metadata.authors = (metadata.author || {}).name || '';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
metadata.owners = metadata.owners || metadata.authors;
|
|
194
|
+
metadata.version = convertVersion(metadata.version);
|
|
195
|
+
metadata.copyright = metadata.copyright ||
|
|
196
|
+
"Copyright \u00A9 ".concat(new Date().getFullYear(), " ").concat(metadata.authors || metadata.owners);
|
|
197
|
+
metadata.additionalFiles = metadata.additionalFiles || [];
|
|
198
|
+
return [4 /*yield*/, fs.pathExists(path.join(appDirectory, 'swiftshader'))];
|
|
199
|
+
case 11:
|
|
200
|
+
if (_f.sent()) {
|
|
201
|
+
metadata.additionalFiles.push({ src: 'swiftshader\\**', target: 'lib\\net45\\swiftshader' });
|
|
202
|
+
}
|
|
203
|
+
return [4 /*yield*/, fs.pathExists(path.join(appDirectory, 'vk_swiftshader_icd.json'))];
|
|
204
|
+
case 12:
|
|
205
|
+
if (_f.sent()) {
|
|
206
|
+
metadata.additionalFiles.push({ src: 'vk_swiftshader_icd.json', target: 'lib\\net45' });
|
|
207
|
+
}
|
|
208
|
+
templatePath = options.nuspecTemplate || path.join(__dirname, '..', 'template.nuspectemplate');
|
|
209
|
+
return [4 /*yield*/, fs.readFile(templatePath, 'utf8')];
|
|
210
|
+
case 13:
|
|
211
|
+
templateData = _f.sent();
|
|
212
|
+
if (path.sep === '/') {
|
|
213
|
+
templateData = templateData.replace(/\\/g, '/');
|
|
214
|
+
for (_i = 0, _b = metadata.additionalFiles; _i < _b.length; _i++) {
|
|
215
|
+
f = _b[_i];
|
|
216
|
+
f.src = f.src.replace(/\\/g, '/');
|
|
217
|
+
f.target = f.target.replace(/\\/g, '/');
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
nuspecContent = (0, lodash_1.template)(templateData)(metadata);
|
|
221
|
+
log("Created NuSpec file:\n".concat(nuspecContent));
|
|
222
|
+
return [4 /*yield*/, (0, temp_utils_1.createTempDir)('si-')];
|
|
223
|
+
case 14:
|
|
224
|
+
nugetOutput = _f.sent();
|
|
225
|
+
targetNuspecPath = path.join(nugetOutput, metadata.name + '.nuspec');
|
|
226
|
+
return [4 /*yield*/, fs.writeFile(targetNuspecPath, nuspecContent)];
|
|
227
|
+
case 15:
|
|
228
|
+
_f.sent();
|
|
229
|
+
cmd = path.join(vendorPath, 'nuget.exe');
|
|
230
|
+
args = [
|
|
231
|
+
'pack', targetNuspecPath,
|
|
232
|
+
'-BasePath', appDirectory,
|
|
233
|
+
'-OutputDirectory', nugetOutput,
|
|
234
|
+
'-NoDefaultExcludes'
|
|
235
|
+
];
|
|
236
|
+
if (useMono) {
|
|
237
|
+
args.unshift(cmd);
|
|
238
|
+
cmd = monoExe;
|
|
239
|
+
}
|
|
240
|
+
// Call NuGet to create our package
|
|
241
|
+
_c = log;
|
|
242
|
+
return [4 /*yield*/, (0, spawn_promise_1.default)(cmd, args)];
|
|
243
|
+
case 16:
|
|
244
|
+
// Call NuGet to create our package
|
|
245
|
+
_c.apply(void 0, [_f.sent()]);
|
|
246
|
+
nupkgPath = path.join(nugetOutput, "".concat(metadata.name, ".").concat(metadata.version, ".nupkg"));
|
|
247
|
+
if (!remoteReleases) return [3 /*break*/, 18];
|
|
248
|
+
cmd = path.join(vendorPath, 'SyncReleases.exe');
|
|
249
|
+
args = ['-u', remoteReleases, '-r', outputDirectory];
|
|
250
|
+
if (useMono) {
|
|
251
|
+
args.unshift(cmd);
|
|
252
|
+
cmd = monoExe;
|
|
253
|
+
}
|
|
254
|
+
if (remoteToken) {
|
|
255
|
+
args.push('-t', remoteToken);
|
|
256
|
+
}
|
|
257
|
+
_d = log;
|
|
258
|
+
return [4 /*yield*/, (0, spawn_promise_1.default)(cmd, args)];
|
|
259
|
+
case 17:
|
|
260
|
+
_d.apply(void 0, [_f.sent()]);
|
|
261
|
+
_f.label = 18;
|
|
262
|
+
case 18:
|
|
263
|
+
cmd = path.join(vendorPath, 'Squirrel.exe');
|
|
264
|
+
args = [
|
|
265
|
+
'--releasify', nupkgPath,
|
|
266
|
+
'--releaseDir', outputDirectory,
|
|
267
|
+
'--loadingGif', loadingGif
|
|
268
|
+
];
|
|
269
|
+
if (useMono) {
|
|
270
|
+
args.unshift(path.join(vendorPath, 'Squirrel-Mono.exe'));
|
|
271
|
+
cmd = monoExe;
|
|
272
|
+
}
|
|
273
|
+
// Legacy codesign options
|
|
274
|
+
return [4 /*yield*/, (0, sign_1.resetSignTool)()];
|
|
275
|
+
case 19:
|
|
276
|
+
// Legacy codesign options
|
|
277
|
+
_f.sent();
|
|
278
|
+
if (!signWithParams) return [3 /*break*/, 20];
|
|
279
|
+
args.push('--signWithParams');
|
|
280
|
+
if (!signWithParams.includes('/f') && !signWithParams.includes('/p') && certificateFile && certificatePassword) {
|
|
281
|
+
args.push("".concat(signWithParams, " /a /f \"").concat(path.resolve(certificateFile), "\" /p \"").concat(certificatePassword, "\""));
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
args.push(signWithParams);
|
|
285
|
+
}
|
|
286
|
+
return [3 /*break*/, 23];
|
|
287
|
+
case 20:
|
|
288
|
+
if (!(certificateFile && certificatePassword)) return [3 /*break*/, 21];
|
|
289
|
+
args.push('--signWithParams');
|
|
290
|
+
args.push("/a /f \"".concat(path.resolve(certificateFile), "\" /p \"").concat(certificatePassword, "\""));
|
|
291
|
+
return [3 /*break*/, 23];
|
|
292
|
+
case 21:
|
|
293
|
+
if (!windowsSign) return [3 /*break*/, 23];
|
|
294
|
+
args.push('--signWithParams');
|
|
295
|
+
args.push('windows-sign');
|
|
296
|
+
return [4 /*yield*/, (0, sign_1.createSignTool)(options)];
|
|
297
|
+
case 22:
|
|
298
|
+
_f.sent();
|
|
299
|
+
_f.label = 23;
|
|
300
|
+
case 23:
|
|
301
|
+
if (options.setupIcon) {
|
|
302
|
+
args.push('--setupIcon');
|
|
303
|
+
args.push(path.resolve(options.setupIcon));
|
|
304
|
+
}
|
|
305
|
+
if (options.noMsi) {
|
|
306
|
+
args.push('--no-msi');
|
|
307
|
+
}
|
|
308
|
+
if (options.noDelta) {
|
|
309
|
+
args.push('--no-delta');
|
|
310
|
+
}
|
|
311
|
+
if (options.frameworkVersion) {
|
|
312
|
+
args.push('--framework-version');
|
|
313
|
+
args.push(options.frameworkVersion);
|
|
314
|
+
}
|
|
315
|
+
_e = log;
|
|
316
|
+
return [4 /*yield*/, (0, spawn_promise_1.default)(cmd, args)];
|
|
317
|
+
case 24:
|
|
318
|
+
_e.apply(void 0, [_f.sent()]);
|
|
319
|
+
if (!(options.fixUpPaths !== false)) return [3 /*break*/, 29];
|
|
320
|
+
log('Fixing up paths');
|
|
321
|
+
if (!(metadata.productName || options.setupExe)) return [3 /*break*/, 26];
|
|
322
|
+
setupPath = path.join(outputDirectory, options.setupExe || "".concat(metadata.productName, "Setup.exe"));
|
|
323
|
+
unfixedSetupPath = path.join(outputDirectory, 'Setup.exe');
|
|
324
|
+
log("Renaming ".concat(unfixedSetupPath, " => ").concat(setupPath));
|
|
325
|
+
return [4 /*yield*/, fs.rename(unfixedSetupPath, setupPath)];
|
|
326
|
+
case 25:
|
|
327
|
+
_f.sent();
|
|
328
|
+
_f.label = 26;
|
|
329
|
+
case 26:
|
|
330
|
+
if (!(metadata.productName || options.setupMsi)) return [3 /*break*/, 29];
|
|
331
|
+
msiPath = path.join(outputDirectory, options.setupMsi || "".concat(metadata.productName, "Setup.msi"));
|
|
332
|
+
unfixedMsiPath = path.join(outputDirectory, 'Setup.msi');
|
|
333
|
+
return [4 /*yield*/, fs.pathExists(unfixedMsiPath)];
|
|
334
|
+
case 27:
|
|
335
|
+
if (!_f.sent()) return [3 /*break*/, 29];
|
|
336
|
+
log("Renaming ".concat(unfixedMsiPath, " => ").concat(msiPath));
|
|
337
|
+
return [4 /*yield*/, fs.rename(unfixedMsiPath, msiPath)];
|
|
338
|
+
case 28:
|
|
339
|
+
_f.sent();
|
|
340
|
+
_f.label = 29;
|
|
341
|
+
case 29: return [4 /*yield*/, (0, sign_1.resetSignTool)()];
|
|
342
|
+
case 30:
|
|
343
|
+
_f.sent();
|
|
344
|
+
return [2 /*return*/];
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
exports.createWindowsInstaller = createWindowsInstaller;
|
|
350
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAuC;AACvC,2CAA6C;AAC7C,2CAA+B;AAE/B,yCA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,mBAAY,gBAAgB,iBAAO,SAAS,CAAE,CAAC,CAAC;oBACpD,qBAAM,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAA;;oBAA5C,SAA4C,CAAC;;;yBAG3C,CAAA,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAA,EAAxC,yBAAwC;oBACpC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,QAAQ,IAAI,UAAG,QAAQ,CAAC,WAAW,cAAW,CAAC,CAAC;oBAC7F,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;oBAC3D,qBAAM,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAA;;yBAAnC,SAAmC,EAAnC,yBAAmC;oBACrC,GAAG,CAAC,mBAAY,cAAc,iBAAO,OAAO,CAAE,CAAC,CAAC;oBAChD,qBAAM,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,EAAA;;oBAAxC,SAAwC,CAAC;;yBAK/C,qBAAM,IAAA,oBAAa,GAAE,EAAA;;oBAArB,SAAqB,CAAC;;;;;CACvB;AA3ND,wDA2NC"}
|
package/lib/options.d.ts
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { SignToolOptions } from '@electron/windows-sign';
|
|
2
|
+
export interface SquirrelWindowsOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The folder path of your Electron app
|
|
5
|
+
*/
|
|
6
|
+
appDirectory: string;
|
|
7
|
+
/**
|
|
8
|
+
* The folder path of Squirrel windows
|
|
9
|
+
*/
|
|
10
|
+
vendorDirectory?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The folder path to create the .exe installer in.
|
|
13
|
+
*
|
|
14
|
+
* @defaultValue an `installer` folder at the project root.
|
|
15
|
+
*/
|
|
16
|
+
outputDirectory?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The path to the .nuspectemplate file used by Squirrel.exe.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue the bundled {@link https://github.com/electron/windows-installer/blob/main/template.nuspectemplate | template.nuspectemplate}.
|
|
21
|
+
*/
|
|
22
|
+
nuspecTemplate?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The local path to a `.gif` file to display during install.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue the bundled {@link https://github.com/electron/windows-installer/blob/main/resources/install-spinner.gif | install-spinner.gif}
|
|
27
|
+
*/
|
|
28
|
+
loadingGif?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The `authors` value for the NuGet package metadata.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue the `author` field from your app's package.json file
|
|
33
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
34
|
+
* @see {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec | the Microsoft .nuspec reference}.
|
|
35
|
+
*/
|
|
36
|
+
authors?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The `owners` value for the NuGet package metadata.
|
|
39
|
+
*
|
|
40
|
+
* @defaultValue the `authors` field from your app's package.json file
|
|
41
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
42
|
+
* @see {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec | the Microsoft .nuspec reference}.
|
|
43
|
+
*/
|
|
44
|
+
owners?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The `copyright` value for the NuGet package metadata.
|
|
47
|
+
*
|
|
48
|
+
* @defaultValue a generated copyright with {@link SquirrelWindowsOptions.authors | authors}
|
|
49
|
+
* or {@link SquirrelWindowsOptions.owners | owners}.
|
|
50
|
+
* @see {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec | the Microsoft .nuspec reference}.
|
|
51
|
+
*/
|
|
52
|
+
copyright?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The name of your app's main `.exe` file.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue the `name` field in your app's package.json file with an added `.exe` extension
|
|
57
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
58
|
+
*/
|
|
59
|
+
exe?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The `description` value for the NuGet package metadata.
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue the `description` field from your app's package.json file
|
|
64
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
65
|
+
* @see {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec | the Microsoft .nuspec reference}.
|
|
66
|
+
*/
|
|
67
|
+
description?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The `version` value for the Nuget package metadata.
|
|
70
|
+
*
|
|
71
|
+
* @defaultValue the `version` field from your app's package.json file
|
|
72
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
73
|
+
* @see {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec | the Microsoft .nuspec reference}.
|
|
74
|
+
*/
|
|
75
|
+
version?: string;
|
|
76
|
+
/**
|
|
77
|
+
* The `title` value for the nuget package metadata.
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue the `productName` field and then the `name` field from your app's package.json
|
|
80
|
+
* file unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
81
|
+
* @see {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec | the Microsoft .nuspec reference}.
|
|
82
|
+
*/
|
|
83
|
+
title?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Windows Application Model ID (appId).
|
|
86
|
+
*
|
|
87
|
+
* @defaultValue the `name` field in your app's package.json file
|
|
88
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
89
|
+
* @see {@link https://learn.microsoft.com/en-us/windows/win32/shell/appids | Microsoft's Application User Model IDs documentation}.
|
|
90
|
+
*/
|
|
91
|
+
name?: string;
|
|
92
|
+
/**
|
|
93
|
+
* The path to an Authenticode Code Signing Certificate.
|
|
94
|
+
*
|
|
95
|
+
* This is a legacy parameter provided for backwards compatibility.
|
|
96
|
+
* For more comprehensive support of various codesigning scenarios
|
|
97
|
+
* like EV certificates, see the
|
|
98
|
+
* {@link SquirrelWindowsOptions.windowsSign | windowsSign} parameter.
|
|
99
|
+
*/
|
|
100
|
+
certificateFile?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The password to decrypt the certificate given in `certificateFile`
|
|
103
|
+
*
|
|
104
|
+
* This is a legacy parameter provided for backwards compatibility.
|
|
105
|
+
* For more comprehensive support of various codesigning scenarios
|
|
106
|
+
* like EV certificates, see the
|
|
107
|
+
* {@link SquirrelWindowsOptions.windowsSign | windowsSign} parameter.
|
|
108
|
+
*/
|
|
109
|
+
certificatePassword?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Params to pass to signtool.
|
|
112
|
+
*
|
|
113
|
+
* Overrides {@link SquirrelWindowsOptions.certificateFile | certificateFile}
|
|
114
|
+
* and {@link SquirrelWindowsOptions.certificatePassword | certificatePassword}`.
|
|
115
|
+
*
|
|
116
|
+
* This is a legacy parameter provided for backwards compatibility.
|
|
117
|
+
* For more comprehensive support of various codesigning scenarios
|
|
118
|
+
* like EV certificates, see the
|
|
119
|
+
* {@link SquirrelWindowsOptions.windowsSign | windowsSign} parameter.
|
|
120
|
+
*/
|
|
121
|
+
signWithParams?: string;
|
|
122
|
+
/**
|
|
123
|
+
* A publicly accessible, fully qualified HTTP(S) URL to an ICO file, used as the application icon
|
|
124
|
+
* displayed in Control Panel ➡ Programs and Features. The icon is retrieved at install time.
|
|
125
|
+
* Example: http://example.com/favicon.ico
|
|
126
|
+
*
|
|
127
|
+
* Does not accept `file:` URLs.
|
|
128
|
+
*
|
|
129
|
+
* @defaultValue the Electron icon.
|
|
130
|
+
*/
|
|
131
|
+
iconUrl?: string;
|
|
132
|
+
/**
|
|
133
|
+
* The ICO file to use as the icon for the generated Setup.exe
|
|
134
|
+
*/
|
|
135
|
+
setupIcon?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The name to use for the generated Setup.exe file
|
|
138
|
+
* @defaultValue the `productName` field from your app's package.json file
|
|
139
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
140
|
+
*/
|
|
141
|
+
setupExe?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The name to use for the generated Setup.msi file
|
|
144
|
+
* @defaultValue the `productName` field from your app's package.json file
|
|
145
|
+
* unless {@link SquirrelWindowsOptions.usePackageJson | usePackageJson} is false.
|
|
146
|
+
*/
|
|
147
|
+
setupMsi?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Enable this flag to prevent Squirrel.Windows from creating an MSI installer.
|
|
150
|
+
* @defaultValue false
|
|
151
|
+
*/
|
|
152
|
+
noMsi?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Enable this flag to prevent Squirrel.Windows from creating delta packages (disable only if necessary, they are a Good Thing).
|
|
155
|
+
* @defaultValue false
|
|
156
|
+
*/
|
|
157
|
+
noDelta?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* A URL to your existing updates. If given, these will be downloaded to create delta updates.
|
|
160
|
+
*/
|
|
161
|
+
remoteReleases?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Authentication token for remote updates using {@link SquirrelWindowsOptions.remoteReleases | remoteReleases}
|
|
164
|
+
*/
|
|
165
|
+
remoteToken?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Whether or not to infer metadata options from your app's package.json file.
|
|
168
|
+
* @defaultValue true
|
|
169
|
+
*/
|
|
170
|
+
usePackageJson?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Set the required .NET framework version (e.g. `net461`).
|
|
173
|
+
*/
|
|
174
|
+
frameworkVersion?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Attempt to create more descriptive installer names using metadata parameters.
|
|
177
|
+
* @defaultValue false
|
|
178
|
+
*/
|
|
179
|
+
fixUpPaths?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Enable this flag to skip setting a custom icon for `Update.exe`
|
|
182
|
+
* @defaultValue false
|
|
183
|
+
*/
|
|
184
|
+
skipUpdateIcon?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Requires Node.js 18 or newer.
|
|
187
|
+
*
|
|
188
|
+
* Sign your app with `@electron/windows-sign`, allowing for full customization
|
|
189
|
+
* of the code-signing process - and supports more complicated scenarios like
|
|
190
|
+
* cloud-hosted EV certificates, custom sign pipelines, and per-file overrides.
|
|
191
|
+
* It also supports all existing "simple" codesigning scenarios, including
|
|
192
|
+
* just passing a certificate file and password.
|
|
193
|
+
*
|
|
194
|
+
* @see {@link https://github.com/electron/windows-sign | @electron/windows-sign documentation}
|
|
195
|
+
* for all possible configuration options.
|
|
196
|
+
*/
|
|
197
|
+
windowsSign?: SignToolOptions;
|
|
198
|
+
}
|
|
199
|
+
export interface PersonMetadata {
|
|
200
|
+
name: string;
|
|
201
|
+
email?: string;
|
|
202
|
+
url?: string;
|
|
203
|
+
}
|
|
204
|
+
export interface AdditionalFile {
|
|
205
|
+
src: string;
|
|
206
|
+
target: string;
|
|
207
|
+
}
|
|
208
|
+
export interface Metadata {
|
|
209
|
+
name?: string;
|
|
210
|
+
productName?: string;
|
|
211
|
+
version?: string;
|
|
212
|
+
copyright?: string;
|
|
213
|
+
author?: string | PersonMetadata;
|
|
214
|
+
authors?: string | PersonMetadata[];
|
|
215
|
+
owners?: string | PersonMetadata[];
|
|
216
|
+
description?: string;
|
|
217
|
+
iconUrl?: string;
|
|
218
|
+
additionalFiles?: AdditionalFile[];
|
|
219
|
+
}
|
package/lib/options.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Originally from @types/electron-winstaller@2.6.2
|
|
3
|
+
// Original definitions by: Brendan Forster <https://github.com/shiftkey>, Daniel Perez Alvarez <https://github.com/unindented>
|
|
4
|
+
// Original definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";AAAA,mDAAmD;AACnD,+HAA+H;AAC/H,2EAA2E"}
|
package/lib/sign.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SquirrelWindowsOptions } from './options';
|
|
2
|
+
/**
|
|
3
|
+
* This method uses @electron/windows-sign to create a fake signtool.exe
|
|
4
|
+
* that can be called by Squirrel - but then just calls @electron/windows-sign
|
|
5
|
+
* to actually perform the signing.
|
|
6
|
+
*
|
|
7
|
+
* That's useful for users who need a high degree of customization of the signing
|
|
8
|
+
* process but still want to use @electron/windows-installer.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createSignTool(options: SquirrelWindowsOptions): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Ensure that signtool.exe is actually the "real" signtool.exe, not our
|
|
13
|
+
* fake substitute.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resetSignTool(): Promise<void>;
|