Compare commits
3 Commits
3fdc0e7ff5
...
1b363a1701
Author | SHA1 | Date |
---|---|---|
Fierelier | 1b363a1701 | |
Fierelier | 18e7e4f187 | |
Fierelier | ec5c716889 |
|
@ -46,12 +46,30 @@ def runReg(cmd,check = True):
|
|||
cmd[1] = applyRegmap(cmd[1])
|
||||
if cmd[0] == "unload":
|
||||
if not cmd[1].startswith(regTmpPath): return
|
||||
|
||||
doAsShell = False
|
||||
if cmd[0] in ["load","unload"]:
|
||||
doAsShell = True
|
||||
index = 0
|
||||
while index < len(cmd):
|
||||
cmd[index] = cmd[index].replace("&","^&")
|
||||
if " " in cmd[index]:
|
||||
cmd[index] = '"' +cmd[index]+ '"'
|
||||
index += 1
|
||||
cmd = ["reg"] + cmd
|
||||
try:
|
||||
if dummyMode:
|
||||
print(cmd)
|
||||
else:
|
||||
subprocess.run(cmd,stdout=subprocess.DEVNULL,check=True)
|
||||
if not doAsShell:
|
||||
subprocess.run(cmd,stdout=subprocess.DEVNULL,check=True)
|
||||
else:
|
||||
cmdStr = " ".join(cmd)
|
||||
cmdProc = subprocess.Popen(["cmd.exe"],stdin=subprocess.PIPE,stdout=subprocess.DEVNULL)
|
||||
cmdProc.stdin.write((cmdStr + "\nexit\n").encode("utf-8"))
|
||||
cmdProc.stdin.flush()
|
||||
rtn = cmdProc.wait()
|
||||
if rtn != 0: raise Exception
|
||||
except Exception as e:
|
||||
if check == True: raise e
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
quality
|
|
@ -1,2 +1,2 @@
|
|||
@echo off
|
||||
exit /b 13
|
||||
exit /b 14
|
Loading…
Reference in New Issue