[Index] Simplify system electron and overlay source
This commit is contained in:
		
							parent
							
								
									2ca57c8f6b
								
							
						
					
					
						commit
						4955f5f8cf
					
				
					 1 changed files with 5 additions and 19 deletions
				
			
		
							
								
								
									
										24
									
								
								src/index.js
									
										
									
									
									
								
							
							
						
						
									
										24
									
								
								src/index.js
									
										
									
									
									
								
							|  | @ -4,15 +4,8 @@ global.oaVersion = 'nightly'; | |||
| 
 | ||||
| log('Init', 'OpenAsar', oaVersion); | ||||
| 
 | ||||
| log('Init', 'Resources Path:', process.resourcesPath); | ||||
| if (process.resourcesPath.startsWith('/usr/lib/electron')) { // Using system electron, fix process.resourcesPath
 | ||||
|   log('Init', 'Detected System Electron, fixing paths'); | ||||
|   global.systemElectron = true; | ||||
| 
 | ||||
|   process.resourcesPath = require('path').join(__dirname, '..'); | ||||
| 
 | ||||
|   log('Init', 'Resources Path:', process.resourcesPath); | ||||
| } | ||||
| if (process.resourcesPath.startsWith('/usr/lib/electron')) global.systemElectron = true; // Using system electron, flag for other places
 | ||||
| process.resourcesPath = require('path').join(__dirname, '..'); // Force resourcesPath for system electron
 | ||||
| 
 | ||||
| const appSettings = require('./appSettings'); | ||||
| global.oaConfig = appSettings.getSettings().get('openasar', {}); | ||||
|  | @ -21,16 +14,9 @@ log('Init', 'Loaded config', oaConfig); | |||
| 
 | ||||
| require('./cmdSwitches')(); | ||||
| 
 | ||||
| if (process.argv.includes('--overlay-host')) { | ||||
|   const buildInfo = require('./utils/buildInfo'); | ||||
| 
 | ||||
|   if (buildInfo.newUpdater) { | ||||
|     require('./utils/u2LoadModulePath')(); | ||||
|   } else { | ||||
|     require('./updater/moduleUpdater').initPathsOnly(buildInfo); | ||||
|   } | ||||
| 
 | ||||
|   require('discord_overlay2/standalone_host.js'); | ||||
| if (process.argv.includes('--overlay-host')) { // If overlay
 | ||||
|   require('./utils/u2LoadModulePath')(); // Manually load updater 2 module paths (all modules)
 | ||||
|   require('discord_overlay2/standalone_host.js'); // Start overlay
 | ||||
| } else { | ||||
|   require('./bootstrap')(); // Start bootstrap
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue