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.
|
||||
if platform.system() == "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":
|
||||
print("Operating system detected: Windows")
|
||||
|
||||
elif platform.system() == "Darwin":
|
||||
print("Operating system detected: MacOS")
|
||||
print("fuck you.")
|
||||
#needs function
|
||||
|
||||
os.chdir(homedir + '/.minecraft')
|
||||
mcfolder = Path.cwd()
|
||||
|
||||
modfolder = homedir + '/.minecraft/mods'
|
||||
os.chdir(homedir)
|
||||
os.chdir("AppData")
|
||||
os.chdir("Roaming")
|
||||
os.chdir(".minecraft")
|
||||
mcfolder = Path.cwd()
|
||||
os.chdir("mods")
|
||||
modfolder = Path.cwd
|
||||
os.chdir(mcfolder)
|
||||
print("Changed current working directory to '" + str(mcfolder) + "'")
|
||||
time.sleep(2)
|
||||
|
||||
os.chdir(mcfolder)
|
||||
|
||||
print("Changed current working directory to '" + str(mcfolder) + "'")
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
|
||||
#begin mod backup and deletion
|
||||
#THIS DOESN'T CURRENTLY BACK UP EXISTING MODS.
|
||||
try:
|
||||
shutil.rmtree(modfolder)
|
||||
shutil.rmtree(str("mods"))
|
||||
print("Cleared previous mods.")
|
||||
except OSError as e:
|
||||
print("Error: %s - %s." % (e.filename, e.strerror))
|
||||
|
||||
os.mkdir(modfolder)
|
||||
os.mkdir(str("mods"))
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user