Sorry I haven't been answering. I've been meaning to, but I keep forgetting to get around to it.
Anyway, unfortunately I don't think I'll ever be able to create a Mac version, as this is written in Windows Batch and I don't have any knowledge of programming languages such as C++ or Objective C.
@crazzn: That's a really awesome script, thanks. The only problem I can see there is that you would lose all your data (technically, it would still be in the temp folder) if your computer shut down mid-game. Can't really see how you could avoid this, though, unless it would be possible to sync the files every 5 minutes or so.
Thank you for getting around to answering. So you can make a direct mac version but would you be able to write a java version, or do you not know java
Sorry I haven't been answering. I've been meaning to, but I keep forgetting to get around to it.
Anyway, unfortunately I don't think I'll ever be able to create a Mac version, as this is written in Windows Batch and I don't have any knowledge of programming languages such as C++ or Objective C.
@crazzn: That's a really awesome script, thanks. The only problem I can see there is that you would lose all your data (technically, it would still be in the temp folder) if your computer shut down mid-game. Can't really see how you could avoid this, though, unless it would be possible to sync the files every 5 minutes or so.
Thank you for getting around to answering. So you can make a direct mac version but would you be able to write a java version, or do you not know java
I could probably try to learn java, but even then, I don't think it would work. The whole concept revolves around temporarily setting a system variable (the AppData path) so Minecraft saves to a different place. AFAIK, Java doesn't have this ability, and if it did, I have no idea how you'd begin to do it on a Mac. What might be possible, though, is to mod the launcher (or minecraft.jar). I'll have to try it and see how it turns out.
Rollback Post to RevisionRollBack
mcmapDZ: Simple, lightning-fast interactive web maps.
@crazzn: That's a really awesome script, thanks. The only problem I can see there is that you would lose all your data (technically, it would still be in the temp folder) if your computer shut down mid-game. Can't really see how you could avoid this, though, unless it would be possible to sync the files every 5 minutes or so.
Yeah. I changed the .bat since my last post (I was just too lazy to upload it tho), so I can specify any directory I want. I'll upload it inabit, after I tidy it up.
Update:
Kay here's the code. Be sure to change the "tempo", "savedir", "javarun", and "minerun" locations. The one's I have in the batch are the directories for my Minecraft.
You will need : Minecraft.exe (From the main site)
Java Runtime Files (From Page1 of this thread)
MCFS (This puts all the save data into one file, so it dramatically cuts down copying time)
(http://www.minecraftforum.net/viewtopic.php?f=25&t=58184)
@echo off
pushd\
::%cd% means the root location of my USB stick, so for example: F:\
::Use this to specify the directory that you want Minecraft to temporarily copy to.
set tempo=C:\Users\%USERNAME%\Desktop
::Use this to specify the directory that your .minecraft save folder is. By default, I put it as my Dropbox folder,
::So I can save the game into my cloud.
set savedir=%cd%Software\Dropbox\.config\data\Documents\My Dropbox\Minecraft
::Use this to specify the directory of your portable Java runtime files. I have it default set to the same folder as the batch
set javarun=%cd%Games\Minecraft\java
::use this to specify the directory of your Minecraft.exe. I have it default set to /bin, which is in same folder as batch
set minerun=%cd%Games\Minecraft\bin
::This is just a small edit that changes the size of the CMD window
mode con:cols=61 lines=3
::User Message
echo.
echo "Now copying essential startup files."
::copies the minecraft data to a temporary folder so it doesnt lag when playing
pushd\
robocopy "%savedir%" "%tempo%" /E /XO | find "\data\" > nul
popd
::temporarily sets APPDATA (in-game variable) to the temporary folder
set APPDATA=%tempo%
Runs Minecraft under Java.exe. This ensures portability if remote computer doesnt have Java
%javarun%\bin\java.exe -jar "%minerun%\Minecraft.exe"
::This is a loop to check if the game is running.
:no2
cls
echo.
echo "The game is now running. Please leave this window open."
ping -n 2 127.0.0.1 | find "Reply" > nul
tasklist /FI "IMAGENAME eq javaw.exe" 2>NUL | find /I /N "javaw.exe">NUL
if "%ERRORLEVEL%"=="0" goto no2
::Copies the save files back
pushd\
cls
echo.
echo "Now saving essential data. Please do not close this window"
robocopy %tempo%\.minecraft "%savedir%\.minecraft" /MIR /XO | find "\data\" > nul
popd
::YOU CAN COMMENT THIS OUT, IF YOU DONT WANT THE TEMPORARY SAVE FOLDER TO BE DELETED
rd %tempo%\.minecraft /q /s
cls
echo.
echo "Completed. Press any button to exit."
pause | find "continue" > nul
goto end
:end
This also has a "failsafe" of sorts that prevents data from being lost if your computer suddenly crashes (as long as you dont put it in the %temp% folder, at least). Basically I just added a parameter (If you scroll down, the parameter is /XO) to the copying code that prevents the old save file from overwriting a newer save file. This means that if your computer crashes, then the next time you load up the batch, you'll keep the save file from before your CPU crashed.
ALSO : If you scroll down the code, there is a line that says "rd %tempo%\.minecraft /q /s" This line deletes the temporary save folderafter you turn off the game. If you want to keep the temporary folder, or manually delete the temporary folder yourself, then add two colons in front if it, "::rd %tempo%\.minecraft /q /s"
It'd be nice if you could integrate something like this into your program. It was a hassle writing this up
@crazzn: That's a really awesome script, thanks. The only problem I can see there is that you would lose all your data (technically, it would still be in the temp folder) if your computer shut down mid-game. Can't really see how you could avoid this, though, unless it would be possible to sync the files every 5 minutes or so.
Yeah. I changed the .bat since my last post (I was just too lazy to upload it tho), so I can specify any directory I want. I'll upload it inabit, after I tidy it up.
Update:
Kay here's the code. Be sure to change the "tempo", "savedir", "javarun", and "minerun" locations. The one's I have in the batch are the directories for my Minecraft.
You will need : Minecraft.exe (From the main site)
Java Runtime Files (From Page1 of this thread)
MCFS (This puts all the save data into one file, so it dramatically cuts down copying time)
(http://www.minecraftforum.net/viewtopic.php?f=25&t=58184)
@echo off
pushd\
::%cd% means the root location of my USB stick, so for example: F:\
::Use this to specify the directory that you want Minecraft to temporarily copy to.
set tempo=C:\Users\%USERNAME%\Desktop
::Use this to specify the directory that your .minecraft save folder is. By default, I put it as my Dropbox folder,
::So I can save the game into my cloud.
set savedir=%cd%Software\Dropbox\.config\data\Documents\My Dropbox\Minecraft
::Use this to specify the directory of your portable Java runtime files. I have it default set to the same folder as the batch
set javarun=%cd%Games\Minecraft\java
::use this to specify the directory of your Minecraft.exe. I have it default set to /bin, which is in same folder as batch
set minerun=%cd%Games\Minecraft\bin
::This is just a small edit that changes the size of the CMD window
mode con:cols=61 lines=3
::User Message
echo.
echo "Now copying essential startup files."
::copies the minecraft data to a temporary folder so it doesnt lag when playing
pushd\
robocopy "%savedir%" "%tempo%" /E /XO | find "\data\" > nul
popd
::temporarily sets APPDATA (in-game variable) to the temporary folder
set APPDATA=%tempo%
Runs Minecraft under Java.exe. This ensures portability if remote computer doesnt have Java
%javarun%\bin\java.exe -jar "%minerun%\Minecraft.exe"
::This is a loop to check if the game is running.
:no2
cls
echo.
echo "The game is now running. Please leave this window open."
ping -n 2 127.0.0.1 | find "Reply" > nul
tasklist /FI "IMAGENAME eq javaw.exe" 2>NUL | find /I /N "javaw.exe">NUL
if "%ERRORLEVEL%"=="0" goto no2
::Copies the save files back
pushd\
cls
echo.
echo "Now saving essential data. Please do not close this window"
robocopy %tempo%\.minecraft "%savedir%\.minecraft" /MIR /XO | find "\data\" > nul
popd
::YOU CAN COMMENT THIS OUT, IF YOU DONT WANT THE TEMPORARY SAVE FOLDER TO BE DELETED
rd %tempo%\.minecraft /q /s
cls
echo.
echo "Completed. Press any button to exit."
pause | find "continue" > nul
goto end
:end
This also has a "failsafe" of sorts that prevents data from being lost if your computer suddenly crashes (as long as you dont put it in the %temp% folder, at least). Basically I just added a parameter (If you scroll down, the parameter is /XO) to the copying code that prevents the old save file from overwriting a newer save file. This means that if your computer crashes, then the next time you load up the batch, you'll keep the save file from before your CPU crashed.
ALSO : If you scroll down the code, there is a line that says "rd %tempo%\.minecraft /q /s" This line deletes the temporary save folderafter you turn off the game. If you want to keep the temporary folder, or manually delete the temporary folder yourself, then add two colons in front if it, "::rd %tempo%\.minecraft /q /s"
It'd be nice if you could integrate something like this into your program. It was a hassle writing this up
I cannot express how thankful I am for this, cheers. Minecraft Portable is essentially just a .bat wrapper, so I'll integrate this if I can. I also see if I can automatically patch MCFS in.
Rollback Post to RevisionRollBack
mcmapDZ: Simple, lightning-fast interactive web maps.
Well, at least it works by letting you carry your worlds around with you, but don't play it from your thumb drive! Not only is it really laggy, but it came close to crashing my work computer the other day
Thank god I got it to unfreeze before my boss got back... THAT's when you know you're addicted
Rollback Post to RevisionRollBack
I painted a creeper on my car and it blew up. True story.
Due to wanting a cleaned up and 'everything i none place' edition of minecraft I've been using this pretty exclusively and have had no problems (other than what a new video card and topping off ramp (box can only used 2 gig) wouldn't help. Also as major updates roll along i've been making backup zip files in case an update borks something.
However is there anything that could help preformance that you could do or suggest that directly involves your exe when running the whole thing off a computer's harddrive??
Rollback Post to RevisionRollBack
Cheapie Theatre
Want something to read? Got ten minutes to kill? Here you go!
When I fire up the launcher, nothing happens. Hourglass shows up, then disappears. I tried this on my school library's laptop, though, but the connection was made to an unsecured network, which means it shouldn't be going through any sort of proxy server/filter. Any suggestion??
OK, new version of Minecraft Portable. This is completely rewritten, automatically patches/uses MCFS, is compatible with USB devices (thanks to craznn, huge help), and has a new icon (from JohnSmith's Textures pack). You can find more info and a download in the first post. There's also a new, debug version, which brings up the command console and displays progress.
@Dupilicated: I've actually got no idea what's happening there, sorry. Try the new version, and see if that works.
Rollback Post to RevisionRollBack
mcmapDZ: Simple, lightning-fast interactive web maps.
Does this portable version act slow for anyone else or is it just me? Seems like everything takes a while to load
My guess is because its via USB - which would also lead me to assume my USB is a bit dated or its my computer being lame.
Input?
Gameplay slow, or startup slow?
The recent update should have fixed any slowdowns from gameplay. It might take a while to start up and close, because the newest version has to copy the save data over and back. Download the debug version, and see for yourself ;
-----------------------------------
EDIT: For NotTarts. It seems as if the program has a few issues with saving data? I was testing the debug version on the usb, and I noticed that my save data would frequently get deleted. Any comments?
I started using Minecraft portable 2.0 today. I can see that it saved my game because it created the folder for it but It does not show up as a load option when i restart minecraft portable. Any ideas?
Thank you for this great way to run Minecraft!
In a 24 hour period of moving files in and out of the .jar via my USB stick - .minecraft deleted itself 14 times.
I know that sounds crazy but im being serious. Randomly when replacing terrain.png, it would hang up and then disappear because it would instantly be deleted.
Now, the slowness of updating the files has led me to not wanting to use minecraft through usb, but, for everyone else you might want to look into this I guess.
For everyone having problems, try this version and see if it still has issues. I changes a few variables in the copying code that might have caused problems on some paths.
Quote from craznn »
Hey.. You guys mind trying this? I just wanna see if it's because of my .bat file or if it's because of a different cause.
I didn't actually use any part of your bat (apart from the loop that checks for the java executable), just based my own off your ideas. Would you be able to check it and see if there're any errors I've missed?
@ECHO OFF
::--------------------------------
::- Various paths we need to set -
::--------------------------------
set CURRENTDIR=%~1
set MYFILES=%~dp0
set APPDATA=%TEMP%\MinecraftPortable_temp
set MINEBIN=%APPDATA%\.minecraft\bin
set JAVAPATH=%CURRENTDIR%\java\bin\javaw.exe
set LOGFILE=%CURRENTDIR%\minecraftp.log
mkdir "%APPDATA%"
::----------------
::- Main program -
::----------------
echo Minecraft Portable v2.0
echo by NotTarts and crazzn
echo.
echo.
echo Starting process.
echo.
call :CheckTemp
call :ExtractAllData
call :PatchMCFS
call :RunMinecraft
call :ProcessCheck
call :CleanUp
goto :End
:End
echo Process finished.
::-------------
::- Functions -
::-------------
:ExtractAllData
echo Extracting data files...
7za.exe x data.7z -aoa > NUL
echo - Done.
echo.
goto :EOF
::-----------
:PatchMCFS
echo [MCFS Patcher] Checking for Minecraft executable...
IF EXIST "%MINEBIN%\minecraft.jar" (
echo - Minecraft executable found, patching in MCFS
cd "%MINEBIN%"
) ELSE (
echo - 'minecraft.jar' not found, please log in and restart Minecraft.
goto :PatchEnd
)
ren minecraft.jar minecraft.zip
"%MYFILES%\7za.exe" a "%MINEBIN%\minecraft.zip" "%MYFILES%\mcfs\*" > NUL
"%MYFILES%\7za.exe" d "%MINEBIN%\minecraft.zip" -r "META-INF\*.DSA" "META-INF\*.SF" > NUL
ren minecraft.zip minecraft.jar
:PatchEnd
echo - Done.
echo.
goto :EOF
::-----------
:RunMinecraft
echo Launching Minecraft...
IF EXIST "%JAVAPATH%" (
echo - Java Portable binaries detected.
echo - Launching...
start "" "%JAVAPATH%" -Xms1024M -Xmx1024M -jar "%MYFILES%\minecraft_launcher.jar"
) ELSE (
echo - No Java Portable binaries found.
echo - Launching...
"%MYFILES%\minecraft_launcher.jar"
)
echo - Done.
echo.
goto :EOF
::-----------
:CheckTemp
echo Checking temporary data files...
IF NOT EXIST "%APPDATA%\lastdir" (
echo - No temporary files found, proceeding as normal
echo DO NOT REMOVE THIS FILE > "%APPDATA%\lastdir"
xcopy "%CURRENTDIR%\.minecraft\*.*" "%APPDATA%\.minecraft\*.*" /s /e /c /y > NUL
) ELSE (
echo - Temporary files found, restoring data
xcopy "%APPDATA%\.minecraft\*.*" "%CURRENTDIR%\.minecraft\*.*" /s /e /c /y > NUL
)
echo - Done.
echo.
goto :EOF
::------------
:ProcessCheck
echo Now monitoring Minecraft...
:LoopStart
ping -n 2 127.0.0.1 > NUL
tasklist /FI "IMAGENAME eq javaw.exe" 2>NUL | find /I /N "javaw.exe" >NUL
if "%ERRORLEVEL%"=="0" goto LoopStart
echo - Done.
echo.
goto :EOF
::------------
:CleanUp
echo Cleaning up...
echo - Deleting old files...
rd "%CURRENTDIR%\.minecraft" /Q /S
echo - Restoring data from temporary folder...
xcopy "%APPDATA%\.minecraft\*.*" "%CURRENTDIR%\.minecraft\*.*" /s /e /c /y > NUL
echo - Cleaning up temp folder...
rd "%APPDATA%" /Q /S
rd "%MYFILES%" /Q /S
echo - Done.
echo.
goto :EOF
Rollback Post to RevisionRollBack
mcmapDZ: Simple, lightning-fast interactive web maps.
I've done a bit more testing, and I've just had to come to a conclusion that Minecraft isn't suited to USB sticks, even with the MCFS loader. Assuming you have a rather fast USB stick (say, 20MB/s read and 5MB/s write), then a game with 5 worlds with take at minimum 5 seconds to start up and a whopping 20 seconds to shut down properly. Unless Notch fixes the save system and the harsh read requirements of Minecraft, then I'm afraid that Minecraft Portable will might be useful if you want the game to be self-contained.
Rollback Post to RevisionRollBack
mcmapDZ: Simple, lightning-fast interactive web maps.
I didn't actually use any part of your bat (apart from the loop that checks for the java executable), just based my own off your ideas. Would you be able to check it and see if there're any errors I've missed?
heh.. No can do. To be honest, I know next to nothing about programming. I took a single course in high school, and that was it. The batch I gave you was the result of an hour or two of Googling.
Quote from NotTarts »
I've done a bit more testing, and I've just had to come to a conclusion that Minecraft isn't suited to USB sticks, even with the MCFS loader. Assuming you have a rather fast USB stick (say, 20MB/s read and 5MB/s write), then a game with 5 worlds with take at minimum 5 seconds to start up and a whopping 20 seconds to shut down properly. Unless Notch fixes the save system and the harsh read requirements of Minecraft, then I'm afraid that Minecraft Portable will might be useful if you want the game to be self-contained.
Well this is still a better alternative than having lag every few seconds right? I'm sure 20 seconds to shut off the game is well worth it being portable.
It was something about failing to download the font or something. I removed the ethernet cable from the computer and it would get a different error, bad video drivers (computers at school are oldcat, but it should still run).
I had this problem at school as well. The problem is that when minecraft tries to contact with the server, the school firewall completely messes it up. I solved the problem by downloading a proxy program and rerouting all internet traffic to 127.0.0.1 :tongue.gif:. This effectively stops minecraft from accessing the internet, and lets you play offline (To do this you have to have successfully run minecraft at least once online though. Maybe do that part at home or something).
Thank you for getting around to answering. So you can make a direct mac version but would you be able to write a java version, or do you not know java
I could probably try to learn java, but even then, I don't think it would work. The whole concept revolves around temporarily setting a system variable (the AppData path) so Minecraft saves to a different place. AFAIK, Java doesn't have this ability, and if it did, I have no idea how you'd begin to do it on a Mac. What might be possible, though, is to mod the launcher (or minecraft.jar). I'll have to try it and see how it turns out.
Yeah. I changed the .bat since my last post (I was just too lazy to upload it tho), so I can specify any directory I want. I'll upload it inabit, after I tidy it up.
Update:
Kay here's the code. Be sure to change the "tempo", "savedir", "javarun", and "minerun" locations. The one's I have in the batch are the directories for my Minecraft.
You will need : Minecraft.exe (From the main site)
Java Runtime Files (From Page1 of this thread)
MCFS (This puts all the save data into one file, so it dramatically cuts down copying time)
(http://www.minecraftforum.net/viewtopic.php?f=25&t=58184)
This also has a "failsafe" of sorts that prevents data from being lost if your computer suddenly crashes (as long as you dont put it in the %temp% folder, at least). Basically I just added a parameter (If you scroll down, the parameter is /XO) to the copying code that prevents the old save file from overwriting a newer save file. This means that if your computer crashes, then the next time you load up the batch, you'll keep the save file from before your CPU crashed.
ALSO : If you scroll down the code, there is a line that says "rd %tempo%\.minecraft /q /s" This line deletes the temporary save folderafter you turn off the game. If you want to keep the temporary folder, or manually delete the temporary folder yourself, then add two colons in front if it, "::rd %tempo%\.minecraft /q /s"
It'd be nice if you could integrate something like this into your program. It was a hassle writing this up
I cannot express how thankful I am for this, cheers. Minecraft Portable is essentially just a .bat wrapper, so I'll integrate this if I can. I also see if I can automatically patch MCFS in.
Thank god I got it to unfreeze before my boss got back... THAT's when you know you're addicted
However is there anything that could help preformance that you could do or suggest that directly involves your exe when running the whole thing off a computer's harddrive??
Want something to read? Got ten minutes to kill? Here you go!
@Dupilicated: I've actually got no idea what's happening there, sorry. Try the new version, and see if that works.
My guess is because its via USB - which would also lead me to assume my USB is a bit dated or its my computer being lame.
Input?
Gameplay slow, or startup slow?
The recent update should have fixed any slowdowns from gameplay. It might take a while to start up and close, because the newest version has to copy the save data over and back. Download the debug version, and see for yourself ;
-----------------------------------
EDIT: For NotTarts. It seems as if the program has a few issues with saving data? I was testing the debug version on the usb, and I noticed that my save data would frequently get deleted. Any comments?
Thank you for this great way to run Minecraft!
In a 24 hour period of moving files in and out of the .jar via my USB stick - .minecraft deleted itself 14 times.
I know that sounds crazy but im being serious. Randomly when replacing terrain.png, it would hang up and then disappear because it would instantly be deleted.
Now, the slowness of updating the files has led me to not wanting to use minecraft through usb, but, for everyone else you might want to look into this I guess.
I didn't actually use any part of your bat (apart from the loop that checks for the java executable), just based my own off your ideas. Would you be able to check it and see if there're any errors I've missed?
heh.. No can do. To be honest, I know next to nothing about programming. I took a single course in high school, and that was it. The batch I gave you was the result of an hour or two of Googling.
Well this is still a better alternative than having lag every few seconds right? I'm sure 20 seconds to shut off the game is well worth it being portable.
I had this problem at school as well. The problem is that when minecraft tries to contact with the server, the school firewall completely messes it up. I solved the problem by downloading a proxy program and rerouting all internet traffic to 127.0.0.1 :tongue.gif:. This effectively stops minecraft from accessing the internet, and lets you play offline (To do this you have to have successfully run minecraft at least once online though. Maybe do that part at home or something).