electron-incremental-update 2.3.6 → 2.3.7
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/README.md +3 -2
- package/dist/{chunk-QKKPETVJ.js → chunk-IVHNGRZY.js} +20 -9
- package/dist/{chunk-QPAKJHVM.js → chunk-PD4EV4MM.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/provider.js +3 -5
- package/dist/utils.cjs +17 -5
- package/dist/utils.d.cts +9 -3
- package/dist/utils.d.ts +9 -3
- package/dist/utils.js +2 -2
- package/dist/vite.js +8 -8
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -433,12 +433,13 @@ function disableHWAccForWin7(): void
|
|
|
433
433
|
*/
|
|
434
434
|
function singleInstance(window?: BrowserWindow): void
|
|
435
435
|
/**
|
|
436
|
-
* Set `
|
|
436
|
+
* Set `userData` dir to the dir of .exe file
|
|
437
437
|
*
|
|
438
438
|
* Useful for portable Windows app
|
|
439
439
|
* @param dirName dir name, default to `data`
|
|
440
|
+
* @param create whether to create dir, default to `true`
|
|
440
441
|
*/
|
|
441
|
-
function
|
|
442
|
+
function setPortableDataPath(dirName?: string, create?: boolean): void
|
|
442
443
|
/**
|
|
443
444
|
* Load `process.env.VITE_DEV_SERVER_URL` when dev, else load html file
|
|
444
445
|
* @param win window
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __require } from './chunk-AAAM44NW.js';
|
|
2
|
-
import fs from '
|
|
3
|
-
import path from '
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
4
|
import electron from 'electron';
|
|
5
5
|
|
|
6
6
|
var isDev = __EIU_IS_DEV__;
|
|
@@ -40,7 +40,7 @@ function setAppUserModelId(id) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function disableHWAccForWin7() {
|
|
43
|
-
if (!__EIU_IS_ESM__ && __require("
|
|
43
|
+
if (!__EIU_IS_ESM__ && __require("os").release().startsWith("6.1")) {
|
|
44
44
|
electron.app.disableHardwareAcceleration();
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -55,13 +55,24 @@ function singleInstance(window) {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
fs.mkdirSync(portablePath);
|
|
58
|
+
function setPortableDataPath(dirName = "data", create = true) {
|
|
59
|
+
if (electron.app.isReady()) {
|
|
60
|
+
throw new Error("Portable app data dir must be setup before app is ready");
|
|
62
61
|
}
|
|
63
|
-
electron.app.
|
|
62
|
+
const portableDir = path.join(path.dirname(electron.app.getPath("exe")), dirName);
|
|
63
|
+
if (create) {
|
|
64
|
+
if (!fs.existsSync(portableDir)) {
|
|
65
|
+
fs.mkdirSync(portableDir);
|
|
66
|
+
} else if (!fs.statSync(portableDir).isDirectory()) {
|
|
67
|
+
fs.rmSync(portableDir);
|
|
68
|
+
fs.mkdirSync(portableDir);
|
|
69
|
+
}
|
|
70
|
+
} else if (!fs.existsSync(portableDir)) {
|
|
71
|
+
throw new Error("Portable app data dir does not exists");
|
|
72
|
+
}
|
|
73
|
+
electron.app.setPath("userData", portableDir);
|
|
64
74
|
}
|
|
75
|
+
var setPortableAppDataPath = setPortableDataPath;
|
|
65
76
|
function loadPage(win, htmlFilePath = "index.html") {
|
|
66
77
|
if (isDev) {
|
|
67
78
|
win.loadURL(process.env.VITE_DEV_SERVER_URL + htmlFilePath);
|
|
@@ -108,4 +119,4 @@ function reloadOnPreloadScriptChanged() {
|
|
|
108
119
|
}
|
|
109
120
|
}
|
|
110
121
|
|
|
111
|
-
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance };
|
|
122
|
+
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, setPortableDataPath, singleInstance };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isUpdateJSON } from './chunk-AAAM44NW.js';
|
|
2
|
-
import crypto from '
|
|
2
|
+
import crypto from 'crypto';
|
|
3
3
|
import electron from 'electron';
|
|
4
|
-
import zlib from '
|
|
4
|
+
import zlib from 'zlib';
|
|
5
5
|
|
|
6
6
|
function hashBuffer(data, length) {
|
|
7
7
|
const hash = crypto.createHash("SHA256").update(data).digest("binary");
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { isDev, getEntryVersion, getAppVersion, getPathFromAppNameAsar, restartApp } from './chunk-
|
|
1
|
+
import { isDev, getEntryVersion, getAppVersion, getPathFromAppNameAsar, restartApp } from './chunk-IVHNGRZY.js';
|
|
2
2
|
import { isUpdateJSON, __require } from './chunk-AAAM44NW.js';
|
|
3
|
-
import fs from '
|
|
4
|
-
import path from '
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
5
|
import electron2 from 'electron';
|
|
6
|
-
import { EventEmitter } from '
|
|
6
|
+
import { EventEmitter } from 'events';
|
|
7
7
|
|
|
8
8
|
// src/entry/types.ts
|
|
9
9
|
var UpdaterError = class extends Error {
|
package/dist/provider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defaultVerifySignature, defaultUnzipFile, defaultDownloadUpdateJSON, defaultDownloadAsar, defaultDownloadText, resolveJson } from './chunk-
|
|
2
|
-
export { defaultDownloadAsar, defaultDownloadText, defaultDownloadUpdateJSON, downloadUtil, getHeader, resolveJson } from './chunk-
|
|
1
|
+
import { defaultVerifySignature, defaultUnzipFile, defaultDownloadUpdateJSON, defaultDownloadAsar, defaultDownloadText, resolveJson } from './chunk-PD4EV4MM.js';
|
|
2
|
+
export { defaultDownloadAsar, defaultDownloadText, defaultDownloadUpdateJSON, downloadUtil, getHeader, resolveJson } from './chunk-PD4EV4MM.js';
|
|
3
3
|
import { defaultIsLowerVersion } from './chunk-AAAM44NW.js';
|
|
4
|
-
import { URL } from '
|
|
4
|
+
import { URL } from 'url';
|
|
5
5
|
|
|
6
6
|
// src/provider/base.ts
|
|
7
7
|
var BaseProvider = class {
|
|
@@ -149,8 +149,6 @@ var GitHubAtomProvider = class extends BaseGitHubProvider {
|
|
|
149
149
|
return `releases/download/v${tag}/${versionPath}`;
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
-
|
|
153
|
-
// src/provider/github/file.ts
|
|
154
152
|
var GitHubProvider = class extends BaseGitHubProvider {
|
|
155
153
|
name = "GithubProvider";
|
|
156
154
|
/**
|
package/dist/utils.cjs
CHANGED
|
@@ -266,13 +266,24 @@ function singleInstance(window) {
|
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
fs__default.default.mkdirSync(portablePath);
|
|
269
|
+
function setPortableDataPath(dirName = "data", create = true) {
|
|
270
|
+
if (electron2__default.default.app.isReady()) {
|
|
271
|
+
throw new Error("Portable app data dir must be setup before app is ready");
|
|
273
272
|
}
|
|
274
|
-
electron2__default.default.app.
|
|
273
|
+
const portableDir = path__default.default.join(path__default.default.dirname(electron2__default.default.app.getPath("exe")), dirName);
|
|
274
|
+
if (create) {
|
|
275
|
+
if (!fs__default.default.existsSync(portableDir)) {
|
|
276
|
+
fs__default.default.mkdirSync(portableDir);
|
|
277
|
+
} else if (!fs__default.default.statSync(portableDir).isDirectory()) {
|
|
278
|
+
fs__default.default.rmSync(portableDir);
|
|
279
|
+
fs__default.default.mkdirSync(portableDir);
|
|
280
|
+
}
|
|
281
|
+
} else if (!fs__default.default.existsSync(portableDir)) {
|
|
282
|
+
throw new Error("Portable app data dir does not exists");
|
|
283
|
+
}
|
|
284
|
+
electron2__default.default.app.setPath("userData", portableDir);
|
|
275
285
|
}
|
|
286
|
+
var setPortableAppDataPath = setPortableDataPath;
|
|
276
287
|
function loadPage(win, htmlFilePath = "index.html") {
|
|
277
288
|
if (isDev) {
|
|
278
289
|
win.loadURL(process.env.VITE_DEV_SERVER_URL + htmlFilePath);
|
|
@@ -367,4 +378,5 @@ exports.resolveJson = resolveJson;
|
|
|
367
378
|
exports.restartApp = restartApp;
|
|
368
379
|
exports.setAppUserModelId = setAppUserModelId;
|
|
369
380
|
exports.setPortableAppDataPath = setPortableAppDataPath;
|
|
381
|
+
exports.setPortableDataPath = setPortableDataPath;
|
|
370
382
|
exports.singleInstance = singleInstance;
|
package/dist/utils.d.cts
CHANGED
|
@@ -60,12 +60,18 @@ declare function disableHWAccForWin7(): void;
|
|
|
60
60
|
*/
|
|
61
61
|
declare function singleInstance(window?: BrowserWindow): void;
|
|
62
62
|
/**
|
|
63
|
-
* Set `
|
|
63
|
+
* Set `userData` dir to the dir of .exe file
|
|
64
64
|
*
|
|
65
65
|
* Useful for portable Windows app
|
|
66
66
|
* @param dirName dir name, default to `data`
|
|
67
|
+
* @param create whether to create dir, default to `true`
|
|
67
68
|
*/
|
|
68
|
-
declare function
|
|
69
|
+
declare function setPortableDataPath(dirName?: string, create?: boolean): void;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated
|
|
72
|
+
* @alias {@link setPortableDataPath}
|
|
73
|
+
*/
|
|
74
|
+
declare const setPortableAppDataPath: typeof setPortableDataPath;
|
|
69
75
|
/**
|
|
70
76
|
* Load `process.env.VITE_DEV_SERVER_URL` when dev, else load html file
|
|
71
77
|
* @param win window
|
|
@@ -120,4 +126,4 @@ declare function getPathFromEntryAsar(...paths: string[]): string;
|
|
|
120
126
|
declare function handleUnexpectedErrors(callback: (err: unknown) => void): void;
|
|
121
127
|
declare function reloadOnPreloadScriptChanged(): void;
|
|
122
128
|
|
|
123
|
-
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance };
|
|
129
|
+
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, setPortableDataPath, singleInstance };
|
package/dist/utils.d.ts
CHANGED
|
@@ -60,12 +60,18 @@ declare function disableHWAccForWin7(): void;
|
|
|
60
60
|
*/
|
|
61
61
|
declare function singleInstance(window?: BrowserWindow): void;
|
|
62
62
|
/**
|
|
63
|
-
* Set `
|
|
63
|
+
* Set `userData` dir to the dir of .exe file
|
|
64
64
|
*
|
|
65
65
|
* Useful for portable Windows app
|
|
66
66
|
* @param dirName dir name, default to `data`
|
|
67
|
+
* @param create whether to create dir, default to `true`
|
|
67
68
|
*/
|
|
68
|
-
declare function
|
|
69
|
+
declare function setPortableDataPath(dirName?: string, create?: boolean): void;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated
|
|
72
|
+
* @alias {@link setPortableDataPath}
|
|
73
|
+
*/
|
|
74
|
+
declare const setPortableAppDataPath: typeof setPortableDataPath;
|
|
69
75
|
/**
|
|
70
76
|
* Load `process.env.VITE_DEV_SERVER_URL` when dev, else load html file
|
|
71
77
|
* @param win window
|
|
@@ -120,4 +126,4 @@ declare function getPathFromEntryAsar(...paths: string[]): string;
|
|
|
120
126
|
declare function handleUnexpectedErrors(callback: (err: unknown) => void): void;
|
|
121
127
|
declare function reloadOnPreloadScriptChanged(): void;
|
|
122
128
|
|
|
123
|
-
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance };
|
|
129
|
+
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, setPortableDataPath, singleInstance };
|
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance } from './chunk-
|
|
2
|
-
export { aesDecrypt, aesEncrypt, defaultDownloadAsar, defaultDownloadText, defaultDownloadUpdateJSON, defaultSignature, defaultUnzipFile, defaultVerifySignature, defaultZipFile, downloadUtil, getHeader, hashBuffer, resolveJson } from './chunk-
|
|
1
|
+
export { beautifyDevTools, disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromMain, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, importNative, isDev, isLinux, isMac, isWin, loadPage, reloadOnPreloadScriptChanged, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, setPortableDataPath, singleInstance } from './chunk-IVHNGRZY.js';
|
|
2
|
+
export { aesDecrypt, aesEncrypt, defaultDownloadAsar, defaultDownloadText, defaultDownloadUpdateJSON, defaultSignature, defaultUnzipFile, defaultVerifySignature, defaultZipFile, downloadUtil, getHeader, hashBuffer, resolveJson } from './chunk-PD4EV4MM.js';
|
|
3
3
|
export { defaultIsLowerVersion, defaultVersionJsonGenerator, isUpdateJSON, parseVersion } from './chunk-AAAM44NW.js';
|
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import fs5 from '
|
|
2
|
-
import path5 from '
|
|
1
|
+
import fs5 from 'fs';
|
|
2
|
+
import path5 from 'path';
|
|
3
3
|
import { isCI } from 'ci-info';
|
|
4
4
|
export { isCI } from 'ci-info';
|
|
5
5
|
import { getPackageInfoSync, loadPackageJSON } from 'local-pkg';
|
|
@@ -10,11 +10,11 @@ import { notBundle } from 'vite-plugin-electron/plugin';
|
|
|
10
10
|
import ElectronSimple from 'vite-plugin-electron/simple';
|
|
11
11
|
import Asar from '@electron/asar';
|
|
12
12
|
import MagicString from 'magic-string';
|
|
13
|
-
import cp from '
|
|
13
|
+
import cp from 'child_process';
|
|
14
14
|
import * as babel from '@babel/core';
|
|
15
|
-
import { builtinModules } from '
|
|
16
|
-
import crypto from '
|
|
17
|
-
import zlib from '
|
|
15
|
+
import { builtinModules } from 'module';
|
|
16
|
+
import crypto from 'crypto';
|
|
17
|
+
import zlib from 'zlib';
|
|
18
18
|
import { generate } from 'selfsigned';
|
|
19
19
|
|
|
20
20
|
// src/vite/index.ts
|
|
@@ -696,7 +696,7 @@ async function filterErrorMessageStartup(args, filter) {
|
|
|
696
696
|
function fixWinCharEncoding(fn) {
|
|
697
697
|
return async (...args) => {
|
|
698
698
|
if (process.platform === "win32") {
|
|
699
|
-
(await import('
|
|
699
|
+
(await import('child_process')).spawnSync("chcp", ["65001"]);
|
|
700
700
|
}
|
|
701
701
|
await fn(...args);
|
|
702
702
|
};
|
|
@@ -895,7 +895,7 @@ async function electronWithUpdater(options) {
|
|
|
895
895
|
...electronPluginOptions,
|
|
896
896
|
updater: { buildAsarOption, buildEntryOption, buildVersionOption }
|
|
897
897
|
},
|
|
898
|
-
(key, value) =>
|
|
898
|
+
(key, value) => key === "privateKey" || key === "cert" ? shouldShowKey ? value : `<${key.toUpperCase()}>` : value,
|
|
899
899
|
2
|
|
900
900
|
),
|
|
901
901
|
{ timestamp: true }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-incremental-update",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.7",
|
|
5
5
|
"description": "Electron incremental update tools with Vite plugin, support bytecode protection",
|
|
6
6
|
"author": "subframe7536",
|
|
7
7
|
"license": "MIT",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@electron/asar": "*"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@babel/core": "^7.27.
|
|
62
|
+
"@babel/core": "^7.27.4",
|
|
63
63
|
"@babel/plugin-transform-arrow-functions": "^7.27.1",
|
|
64
64
|
"@babel/plugin-transform-template-literals": "^7.27.1",
|
|
65
65
|
"@subframe7536/type-utils": "^0.2.0",
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
"vite-plugin-electron": "^0.29.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@subframe7536/eslint-config": "^1.
|
|
73
|
+
"@subframe7536/eslint-config": "^1.3.1",
|
|
74
74
|
"@types/babel__core": "^7.20.5",
|
|
75
|
-
"@types/node": "^22.15.
|
|
76
|
-
"@vitest/eslint-plugin": "^1.1
|
|
77
|
-
"bumpp": "^10.1.
|
|
75
|
+
"@types/node": "^22.15.30",
|
|
76
|
+
"@vitest/eslint-plugin": "^1.2.1",
|
|
77
|
+
"bumpp": "^10.1.1",
|
|
78
78
|
"electron": "36.2.0",
|
|
79
79
|
"esbuild": "^0.25.4",
|
|
80
|
-
"eslint": "^9.
|
|
81
|
-
"tsup": "^8.
|
|
80
|
+
"eslint": "^9.28.0",
|
|
81
|
+
"tsup": "^8.5.0",
|
|
82
82
|
"typescript": "^5.8.3",
|
|
83
83
|
"vite": "^6.3.5",
|
|
84
84
|
"vite-plugin-electron": "^0.29.0",
|
|
85
|
-
"vitest": "^3.
|
|
85
|
+
"vitest": "^3.2.2"
|
|
86
86
|
},
|
|
87
87
|
"pnpm": {
|
|
88
88
|
"overrides": {
|