@adecore/shell 0.49.1 → 0.49.3
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/dist/updater.d.ts +1 -0
- package/dist/updater.js +6 -1
- package/package.json +4 -4
- package/src/updater.ts +7 -1
package/dist/updater.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface UpdaterOptions {
|
|
|
12
12
|
publish: (state: UpdateState) => void;
|
|
13
13
|
beforeCheck?: () => void;
|
|
14
14
|
onQuit?: (quitting: boolean) => void;
|
|
15
|
+
silentInstall?: boolean;
|
|
15
16
|
log?: (message: string, error: unknown) => void;
|
|
16
17
|
setInterval?: (run: () => void, ms: number) => unknown;
|
|
17
18
|
}
|
package/dist/updater.js
CHANGED
|
@@ -106,7 +106,12 @@ export const createUpdater = (options) => {
|
|
|
106
106
|
installing = true;
|
|
107
107
|
options.onQuit?.(true);
|
|
108
108
|
try {
|
|
109
|
-
|
|
109
|
+
if (options.silentInstall) {
|
|
110
|
+
updater.quitAndInstall(true, true);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
updater.quitAndInstall();
|
|
114
|
+
}
|
|
110
115
|
return true;
|
|
111
116
|
}
|
|
112
117
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/shell",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.3",
|
|
4
4
|
"description": "The main process of an Electron app: its menu, its updater and the guards around its page.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"author": "Bas Milius",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "bun scripts/build.ts",
|
|
37
|
-
"typecheck": "
|
|
37
|
+
"typecheck": "bun check --no-script",
|
|
38
38
|
"test": "bun test"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/bun": "^1.4.4",
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"electron": "^45.
|
|
54
|
+
"@types/node": "^26.6.6",
|
|
55
|
+
"electron": "^45.2.0",
|
|
56
56
|
"electron-updater": "^6.8.11",
|
|
57
57
|
"typescript": "^7.0.2"
|
|
58
58
|
}
|
package/src/updater.ts
CHANGED
|
@@ -38,6 +38,8 @@ export interface UpdaterOptions {
|
|
|
38
38
|
* windows learns the quit is coming: pass `windows.quitForUpdate`.
|
|
39
39
|
*/
|
|
40
40
|
onQuit?: (quitting: boolean) => void;
|
|
41
|
+
/* Installs without the installer's windows and starts the app again after. Only Windows reads it. */
|
|
42
|
+
silentInstall?: boolean;
|
|
41
43
|
log?: (message: string, error: unknown) => void;
|
|
42
44
|
setInterval?: (run: () => void, ms: number) => unknown;
|
|
43
45
|
}
|
|
@@ -148,7 +150,11 @@ export const createUpdater = (options: UpdaterOptions) => {
|
|
|
148
150
|
options.onQuit?.(true);
|
|
149
151
|
|
|
150
152
|
try {
|
|
151
|
-
|
|
153
|
+
if (options.silentInstall) {
|
|
154
|
+
updater.quitAndInstall(true, true);
|
|
155
|
+
} else {
|
|
156
|
+
updater.quitAndInstall();
|
|
157
|
+
}
|
|
152
158
|
|
|
153
159
|
return true;
|
|
154
160
|
} catch (e) {
|