mirror of
				https://github.com/vector-im/element-web.git
				synced 2025-11-04 02:02:14 +01:00 
			
		
		
		
	Merge pull request #2556 from vector-im/dbkr/windows_fixes_missed_files
Missed files electron windows fixes
This commit is contained in:
		
						commit
						f7091d2fdd
					
				
							
								
								
									
										
											BIN
										
									
								
								electron/build/install-spinner.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								electron/build/install-spinner.gif
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 4.4 KiB  | 
							
								
								
									
										30
									
								
								electron/src/squirrelhooks.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								electron/src/squirrelhooks.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,30 @@
 | 
				
			|||||||
 | 
					const path = require('path');
 | 
				
			||||||
 | 
					const spawn = require('child_process').spawn;
 | 
				
			||||||
 | 
					const app = require('electron').app;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function run_update_exe(args, done) {
 | 
				
			||||||
 | 
					    const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
 | 
				
			||||||
 | 
					    spawn(updateExe, args, {
 | 
				
			||||||
 | 
					      detached: true
 | 
				
			||||||
 | 
					    }).on('close', done);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function check_squirrel_hooks() {
 | 
				
			||||||
 | 
					    if (process.platform != 'win32') return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const cmd = process.argv[1];
 | 
				
			||||||
 | 
					    const target = path.basename(process.execPath);
 | 
				
			||||||
 | 
					    if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') {
 | 
				
			||||||
 | 
					        run_update_exe(['--createShortcut=' + target + ''], app.quit);
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					    } else if (cmd === '--squirrel-uninstall') {
 | 
				
			||||||
 | 
					        run_update_exe(['--removeShortcut=' + target + ''], app.quit);
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					    } else if (cmd === '--squirrel-obsolete') {
 | 
				
			||||||
 | 
					        app.quit();
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return false;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports = check_squirrel_hooks;
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user