@@ -28,7 +28,10 @@ import { createStackDocumentService } from './stack-document.js';
2828import { registerDesktopIpc } from './ipc.js' ;
2929import { registerRendererProtocol } from './protocol.js' ;
3030import { createUpdateAdapter } from './update.js' ;
31- import { resolveDesktopReleaseChannel } from './release-channel.js' ;
31+ import {
32+ resolveDesktopReleaseChannel ,
33+ resolveDesktopReleaseVersion ,
34+ } from './release-channel.js' ;
3235import { desktopUpdateStatePath , resolveDesktopUserDataPath } from './user-data.js' ;
3336import { createLauncherRuntime } from '../../../src/launcher/runtime.js' ;
3437import { resolveRuntimePaths } from '../../../src/platform/paths.js' ;
@@ -104,8 +107,13 @@ async function startDesktop() {
104107 ? { overridePath : process . env . PORTREEVE_DESKTOP_CLI_PATH }
105108 : { } ) ,
106109 } ) ;
107- const releaseChannel = resolveDesktopReleaseChannel (
108- JSON . parse ( await readFile ( resolve ( app . getAppPath ( ) , 'package.json' ) , 'utf8' ) ) ,
110+ const desktopMetadata = JSON . parse (
111+ await readFile ( resolve ( app . getAppPath ( ) , 'package.json' ) , 'utf8' ) ,
112+ ) ;
113+ const releaseChannel = resolveDesktopReleaseChannel ( desktopMetadata ) ;
114+ const desktopVersion = resolveDesktopReleaseVersion (
115+ desktopMetadata ,
116+ app . getVersion ( ) ,
109117 ) ;
110118 diagnose ( 'artifact-verified' , artifact . filename ) ;
111119 const lifecycle = createDesktopLifecycleController ( artifact ) ;
@@ -114,7 +122,7 @@ async function startDesktop() {
114122 console . log (
115123 `PORTREEVE_DESKTOP_SMOKE ${ JSON . stringify ( {
116124 schemaVersion : 1 ,
117- desktopVersion : app . getVersion ( ) ,
125+ desktopVersion,
118126 controllerVersion : lifecycle . compatibility . version ,
119127 artifactVersion : artifact . version ,
120128 mode : status . mode ,
@@ -161,7 +169,7 @@ async function startDesktop() {
161169 const coordinator = createStateCoordinator ( {
162170 artifact : {
163171 ...artifact ,
164- desktopVersion : app . getVersion ( ) ,
172+ desktopVersion,
165173 controller : lifecycle . compatibility ,
166174 } ,
167175 lifecycle,
@@ -180,7 +188,7 @@ async function startDesktop() {
180188 } ) ,
181189 launchers,
182190 updates : createUpdateAdapter ( {
183- desktopVersion : app . getVersion ( ) ,
191+ desktopVersion,
184192 channel : releaseChannel ,
185193 statePath : desktopUpdateStatePath ( app . getPath ( 'userData' ) ) ,
186194 openExternal : ( url ) => shell . openExternal ( url ) ,
0 commit comments