FIx compatibility with Windows 10, compiles to .exe
This commit is contained in:
parent
1e2e035310
commit
d86a842917
37
installer.py
37
installer.py
@ -15,36 +15,39 @@ homedir = os.path.expanduser("~")
|
|||||||
#we find the minecraft folder in this section.
|
#we find the minecraft folder in this section.
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
print("Operating system detected: Linux")
|
print("Operating system detected: Linux")
|
||||||
|
global mcfolder
|
||||||
|
global modfolder
|
||||||
|
os.chdir(homedir + '/.minecraft')
|
||||||
|
mcfolder = Path.cwd()
|
||||||
|
modfolder = homedir + '/.minecraft/mods'
|
||||||
|
os.chdir(mcfolder)
|
||||||
|
print("Changed current working directory to '" + str(mcfolder) + "'")
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
elif platform.system() == "Windows":
|
elif platform.system() == "Windows":
|
||||||
print("Operating system detected: Windows")
|
print("Operating system detected: Windows")
|
||||||
|
os.chdir(homedir)
|
||||||
elif platform.system() == "Darwin":
|
os.chdir("AppData")
|
||||||
print("Operating system detected: MacOS")
|
os.chdir("Roaming")
|
||||||
print("fuck you.")
|
os.chdir(".minecraft")
|
||||||
#needs function
|
mcfolder = Path.cwd()
|
||||||
|
os.chdir("mods")
|
||||||
os.chdir(homedir + '/.minecraft')
|
modfolder = Path.cwd
|
||||||
mcfolder = Path.cwd()
|
os.chdir(mcfolder)
|
||||||
|
print("Changed current working directory to '" + str(mcfolder) + "'")
|
||||||
modfolder = homedir + '/.minecraft/mods'
|
time.sleep(2)
|
||||||
|
|
||||||
os.chdir(mcfolder)
|
os.chdir(mcfolder)
|
||||||
|
|
||||||
print("Changed current working directory to '" + str(mcfolder) + "'")
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#begin mod backup and deletion
|
#begin mod backup and deletion
|
||||||
#THIS DOESN'T CURRENTLY BACK UP EXISTING MODS.
|
#THIS DOESN'T CURRENTLY BACK UP EXISTING MODS.
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(modfolder)
|
shutil.rmtree(str("mods"))
|
||||||
print("Cleared previous mods.")
|
print("Cleared previous mods.")
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print("Error: %s - %s." % (e.filename, e.strerror))
|
print("Error: %s - %s." % (e.filename, e.strerror))
|
||||||
|
|
||||||
os.mkdir(modfolder)
|
os.mkdir(str("mods"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user