From 2e32dba02632f73ae8069463060e3148637d6373 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 28 Jun 2022 08:37:43 +0200 Subject: [PATCH] Allow running multiple instances of script --- .gitignore | 2 +- README.md | 2 -- api/opusnt.py | 2 +- run.py | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 21e23bf..761373f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ __pycache__/ hmods-*/ path/ -tmp/ \ No newline at end of file +tmp.*/ \ No newline at end of file diff --git a/README.md b/README.md index d2d16b2..9843bc7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ ## Opus-NT A windows homebrew kit and collection of mods. Can mod .WIM (this is where main-support is) and offline windows installations. Mods are written for 7 and up, but are likely to work with Vista and up. **Certain parts are still untested, so bear with me.** -**DON'T RUN MULTIPLE INSTANCES OF THIS SCRIPT.** - ## Mods [View mod documentation](docs/index.md) - Can also be viewed locally, in a browser (index.html). diff --git a/api/opusnt.py b/api/opusnt.py index 1e7f349..0d8d8dd 100644 --- a/api/opusnt.py +++ b/api/opusnt.py @@ -39,7 +39,7 @@ target = { } tmpPath = "tmp" -regTmpPath = "HKEY_LOCAL_MACHINE\\opus-nt_" +regTmpPath = "HKEY_LOCAL_MACHINE\\opus-nt." +str(os.getpid())+ "_" def runReg(cmd,check = True): if target["type"] == "online": diff --git a/run.py b/run.py index 7d35bc8..2391d7a 100644 --- a/run.py +++ b/run.py @@ -141,7 +141,7 @@ def main(): opusnt.target["type"] = "offline" opusnt.target["path"] = arglist["path"] - opusnt.tmpPath = p(sp,"tmp") + opusnt.tmpPath = p(sp,"tmp." +str(os.getpid())) if "tmp" in arglist: opusnt.tmpPath = arglist["tmp"] if os.path.isdir(opusnt.tmpPath): subprocess.run(["rmdir","/s","/q",opusnt.tmpPath],check=True,shell=True)