Skip to content

Instantly share code, notes, and snippets.

@EntityReborn
Created June 16, 2011 22:53
Show Gist options
  • Save EntityReborn/1030501 to your computer and use it in GitHub Desktop.
Save EntityReborn/1030501 to your computer and use it in GitHub Desktop.
def launchUpdate(updated, user, ticket, appdata=None):
if appdata:
appdata = os.path.abspath(appdata)
if sys.platform == "win32":
os.putenv("APPDATA", appdata)
else:
os.environ["HOME"] = appdata
url = "minecraft.jar?user={0}&ticket={1}".format(user, ticket)
line = r'java -cp "{0}/.minecraft/bin/minecraft_launcher.jar" ' + \
r'-Djava.library.path="{0}/.minecraft/bin/natives" ' + \
r'net.minecraft.GameUpdater "{1}" "{2}"'
line = line.format(appdata, updated, url)
mc = subprocess.Popen(line, env=os.environ)
mc.wait()
the function is sent data from the login, as well as the directory where you want stuff stored (portability)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment