feat(updates): verify and install launcher releases
Check the versioned release channel, verify the signed manifest and installer digest, and open the installer only after confirmation. Verified type checks, the Windows package, and an upgrade handoff from a local release fixture, including tampering and interrupted downloads.
This commit is contained in:
1 parent
31b38518f8
commit
746b74c564
24 files changed
+638
-28
No files matched your search
@@ -24,6 +24,8 @@ export const IPC_CHANNEL_PREFIXES = [
|
||||
'settings:',
|
||||
/** Adaptation packs: the active patch set, update checks, installing a newer pack. */
|
||||
'patches:',
|
||||
/** Checking, downloading and installing a launcher release. */
|
||||
'updates:',
|
||||
/** The launcher window itself (it draws its own title bar). */
|
||||
'window:',
|
||||
] as const;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from 'zod';
|
||||
import { AppReleaseVersionSchema, AppUpdateCheckSchema, AppUpdateProgressSchema } from '../schemas/app-update.ts';
|
||||
import { BackgroundPictureSchema } from '../schemas/background.ts';
|
||||
import {
|
||||
CopiesSchema,
|
||||
@@ -34,6 +35,7 @@ export const ipcContract = {
|
||||
version: z.string(),
|
||||
electron: z.string(),
|
||||
development: z.boolean(),
|
||||
appUpdatesSupported: z.boolean(),
|
||||
/** The operating system's preferred language, as Electron reports it (e.g. "zh-CN"). */
|
||||
systemLocale: z.string(),
|
||||
userDataPath: z.string(),
|
||||
@@ -270,6 +272,18 @@ export const ipcContract = {
|
||||
input: z.void(),
|
||||
output: ActivePatchSetSchema,
|
||||
},
|
||||
'updates:check': {
|
||||
input: z.void(),
|
||||
output: AppUpdateCheckSchema,
|
||||
},
|
||||
'updates:download': {
|
||||
input: z.object({ version: AppReleaseVersionSchema }),
|
||||
output: AppUpdateCheckSchema,
|
||||
},
|
||||
'updates:install': {
|
||||
input: z.object({ version: AppReleaseVersionSchema }),
|
||||
output: z.void(),
|
||||
},
|
||||
'window:minimize': {
|
||||
input: z.void(),
|
||||
output: z.void(),
|
||||
@@ -283,6 +297,7 @@ export const ipcContract = {
|
||||
export const ipcEvents = {
|
||||
'event:settings-changed': SettingsSchema,
|
||||
'event:install-progress': InstallProgressSchema,
|
||||
'event:app-update-progress': AppUpdateProgressSchema,
|
||||
'event:launch-state': LaunchStateSchema,
|
||||
'event:copies-changed': CopiesSchema,
|
||||
'event:copy-maintenance': MaintenanceProgressSchema,
|
||||
|
||||
Reference in new issue
Block a user