[Registry] Remove util file, turn into one line func
This commit is contained in:
		
							parent
							
								
									4a4c6e2e3a
								
							
						
					
					
						commit
						535214b25a
					
				
					 3 changed files with 5 additions and 5 deletions
				
			
		|  | @ -1,6 +1,6 @@ | |||
| const { join, basename } = require('path'); | ||||
| 
 | ||||
| const reg = require('../utils/registry'); | ||||
| const reg = (a, c) => require('child_process').execFile('reg.exe', a, c); | ||||
| 
 | ||||
| const appName = basename(process.execPath, '.exe'); | ||||
| const queuePrefix = [ 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName ]; | ||||
|  |  | |||
|  | @ -1,3 +0,0 @@ | |||
| const CP = require('child_process'); | ||||
| 
 | ||||
| module.exports = (args, cb) => CP.execFile('reg.exe', args, cb); | ||||
|  | @ -1,6 +1,8 @@ | |||
| const fs = require('fs'); | ||||
| const { join, resolve, basename } = require('path'); | ||||
| 
 | ||||
| const reg = (a, c) => require('child_process').execFile('reg.exe', a, c); | ||||
| 
 | ||||
| const Constants = require('./Constants'); | ||||
| const reg = require('./utils/registry'); | ||||
| 
 | ||||
|  | @ -17,7 +19,8 @@ exports.do = (updater) => { | |||
|   const base = 'HKCU\\Software\\Classes\\' + proto; | ||||
| 
 | ||||
|   for (const x of [ | ||||
|     [base, '/ve', '/d', `URL:${proto} Protocol`], [base, '/v', 'URL Protocol'], | ||||
|     [base, '/ve', '/d', `URL:${proto} Protocol`], | ||||
|     [base, '/v', 'URL Protocol'], | ||||
|     [base + '\\DefaultIcon', '/ve', '/d', `"${exec}",-1`], | ||||
|     [base + '\\shell\\open\\command', '/ve', '/d', `"${exec}" --url -- "%1"`] | ||||
|   ]) reg([ 'add', ...x, '/f' ], e => {}); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue