Allow running multiple instances of script

This commit is contained in:
Fierelier 2022-06-28 08:37:43 +02:00
parent cb01674406
commit 2e32dba026
4 changed files with 3 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
__pycache__/
hmods-*/
path/
tmp/
tmp.*/

View File

@ -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).

View File

@ -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":

2
run.py
View File

@ -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)