33 * This file is used by both the main process and the build script
44 */
55
6+ const { systemPreferences } = require ( "electron" ) ;
7+
68// Create configuration factory function
79function createConfig ( isDev = false , buildConfig = { } ) {
810 return {
@@ -28,39 +30,23 @@ function createConfig(isDev = false, buildConfig = {}) {
2830 // Add parameters for update endpoint
2931 if ( endpoint === 'update' ) {
3032 const params = new URLSearchParams ( ) ;
31-
33+ systemInfo = '' ;
3234 // Add OS information
33- console . log ( '[CONFIG] Adding OS parameter:' , process . platform ) ;
34- params . append ( 'os' , process . platform ) ;
35+ platform = process . platform || 'unknown' ;
36+ systemInfo += platform ;
3537
3638 // Add architecture information (ensure it's not undefined)
3739 const arch = process . arch || 'unknown' ;
38- console . log ( '[CONFIG] Adding ARCH parameter:' , arch ) ;
39- params . append ( 'arch' , arch ) ;
40-
41- // Add packaging method from build configuration (Windows only)
42- console . log ( '[CONFIG] Platform check:' , process . platform ) ;
43- console . log ( '[CONFIG] Build config:' , JSON . stringify ( this . build , null , 2 ) ) ;
44-
40+ arch = process . arch || 'unknown' ;
41+ systeminfo += `-${ arch } ` ;
42+
4543 if ( process . platform === 'win32' && this . build && this . build . packagingMethod ) {
46- console . log ( '[CONFIG] Adding METHOD parameter:' , this . build . packagingMethod ) ;
47- params . append ( 'method' , this . build . packagingMethod ) ;
48- } else {
49- console . log ( '[CONFIG] METHOD parameter NOT added. Reasons:' ) ;
50- console . log ( ' - Platform is Windows:' , process . platform === 'win32' ) ;
51- console . log ( ' - Build config exists:' , ! ! this . build ) ;
52- console . log ( ' - Packaging method exists:' , ! ! ( this . build && this . build . packagingMethod ) ) ;
44+ method = this . build . packagingMethod || 'installed' ;
45+ systemInfo += `-${ method } ` ;
5346 }
54-
55- // Log all parameters before creating URL
56- console . log ( '[CONFIG] All URL parameters:' ) ;
57- for ( const [ key , value ] of params ) {
58- console . log ( ` ${ key } = ${ value } ` ) ;
59- }
60-
61- const finalUrl = `${ baseUrl } ?${ params . toString ( ) } ` ;
62- console . log ( '[CONFIG] Final generated URL:' , finalUrl ) ;
63-
47+
48+ params . append ( 'info' , systemInfo ) ;
49+
6450 return finalUrl ;
6551 }
6652
0 commit comments