It is currently 16 Apr 2024, 15:34
   
Text Size

Is a Portable Version Possible?

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Is a Portable Version Possible?

Postby pufthemajicdragon » 16 Jan 2017, 02:13

Wow... so much nonsense in this thread... And look at me, resurrecting it from the dead.

1. There are many many reasons why a person would want to make a portable app. Ours is not to question their motives, but simply to answer whether or not it is possible.

2. There are plenty of ways to compile a standalone executable using Java that will not require the JRE in any form. Any of your commercial compilers can do it by default. Simply put, the JDK is mostly just a collection of classes and includes that you can reference in your program but which the JDK compiler does not compile into your program. These are included in the JRE. But there's no reason that they can't be compiled into your program to make a fully functional standalone exe, it just takes longer to compile and makes for a bigger program.

3. Java is perhaps the worst language ever written. Partly because the JRE is one half step above malware, but mostly because the language is just so easy to learn that a whole lot of amateurs pick it up and write immature apps that do really stupid things (like saving data to the user's AppData folder without providing a proper uninstaller).

4. JPortable exists and supposedly works with 3rd party apps. So making a portable Forge is theoretically possible and has apparently even been done. But no instructions exist for anyone trying to figure out the process themselves.

So the question from the OP remains ( 7 years later...) - Is it possible to make a portable version of Forge and how is it done?

I've had no success getting the Windows download of Forge to run using JPortable Java 8 or JPortable Java 7. I've tried just dragging and dropping forge-gui-desktop-1.5.58-jar... onto Java.exe and Javaw.exe, as well as running "java -Xmx1024m -jar forge-gui-desktop-1.5.58-jar-with-dependencies.jar" from the command line within the JPortable folder. In each case literally nothing happens - I don't even get a blip of Java.exe on my task manager.
Would using a portable Java require compiling a custom binary of Forge?
This is the full collection of JPortable downloads.

How about we just make a request that future versions of Forge include a line that searches for a local path to Java (such as .\res\java\bin) when it checks for the JRE?
pufthemajicdragon
 
Posts: 23
Joined: 08 Jan 2013, 04:17
Has thanked: 7 times
Been thanked: 2 times

Re: Is a Portable Version Possible?

Postby Huggybaby » 16 Jan 2017, 14:25

Thanks for the reply. :) This is why we don't lock old threads, because sometimes they deserve a resurrection.
User avatar
Huggybaby
Administrator
 
Posts: 3205
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 696 times
Been thanked: 594 times

Re: Is a Portable Version Possible?

Postby Agetian » 19 Jan 2017, 13:07

For what it's worth, when I was still using Windows a few years ago I was running a custom fully portable version of Forge that I could run off of a flash drive or basically anything at all without being locked to the need of pre-installed Java on that machine.

What I did was I created a folder in the Forge directory called "java" and I copied the Java folder structure there (the "bin" and "lib" folders, in particular). Note that I used standard Java ( 7 or 8 ), not the JPortable version (with which I had no success either).

Then I wrote a simple script (a "batch file" in Windows terms, I guess) that started Forge using Java from that said folder. It's a one-liner:

Code: Select all
@java7\bin\java.exe -Xmx2048m -jar forge-svn.jar
(I used the custom name for the .jar, "forge-svn.jar", but it can be changed to anything, for example, to match the Forge .jar name as used in beta releases). Memory allocation can be tweaked as necessary, too (2048M seems a good balance though unless you're planning to run it on machines with less than 3 GB RAM or so).

To make Forge truly portable, I also edited forge.profile.properties in such as way that it pointed to the folders inside my Forge installation instead of to the default AppData folders (or wherever it was that Forge tried to store stuff by default on Windows). This is easy to do, for starters you can just set userDir and cacheDir to some folders relative to the current path, e.g.:

Code: Select all
userDir=profile
cacheDir=cache
Then, just copy the relevant profile and cache files to those folders and you're done. Voila, one portable Forge ready to be played wherever needed. :)

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Is a Portable Version Possible?

Postby Fizanko » 20 Jan 2017, 21:45

Very interesting, i had no idea it was possible to have a fully portable of Forge as i thought java was required to be installed on the computer for any portable program requiring java to actually work.
I had already my forge properties pointing to a folder inside of Forge for my own ease, but the java thing is new to me.

Thanks Agetian, very usefull information.
probably outdated by now so you should avoid : Innistrad world for Forge (updated 17/11/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
User avatar
Fizanko
Tester
 
Posts: 780
Joined: 07 Feb 2014, 11:24
Has thanked: 155 times
Been thanked: 94 times

Re: Is a Portable Version Possible?

Postby Agetian » 21 Jan 2017, 04:26

Glad to help! :) Yeah, I was surprised too when I first tried it, but it ended up working flawlessly, at least with Forge :)

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Previous

Return to Forge

Who is online

Users browsing this forum: No registered users and 74 guests


Who is online

In total there are 74 users online :: 0 registered, 0 hidden and 74 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 74 guests

Login Form