Can one run rptools via a thumb drive?

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
gripnick
Kobold
Posts: 5
Joined: Wed Dec 01, 2010 9:56 pm

Can one run rptools via a thumb drive?

Post by gripnick »

Can one run rptools via a thumb drive?

User avatar
patoace
Dragon
Posts: 313
Joined: Mon Sep 24, 2007 6:10 pm
Location: Rancagua - Chile

Re: RPtools blocked at work

Post by patoace »

Yes, one can.

Just unzip in a thumb drive directory named "Maptool", and add a file named mt.cfg in that directory, with this content:

Code: Select all

MAXMEM=512
MINMEM=64
STACKSIZE=2
JVM=javaw -DMAPTOOL_DATADIR=\Maptool\Data
PROMPT=true


And all your backups and assets will be in your thumb drive.

Also, you need the host PC to run Java, but there are portable builds for that too.

User avatar
Azhrei
Site Admin
Posts: 12058
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Can one run rptools via a thumb drive?

Post by Azhrei »

(Split from the original thread regarding accessing RPTools from work as it has nothing to do with that!)

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: RPtools blocked at work

Post by Phergus »

patoace wrote:Just unzip in a thumb drive directory named "Maptool", and add a file named mt.cfg in that directory, with this content:

No reason to create the mt.cfg file by hand as the MT launcher will do it the first time it runs and will prompt you for the settings to use.

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Can one run rptools via a thumb drive?

Post by jfrazierjr »

Don't you need to deal with the "home" folder in some way? that way the settings are saved onto the drive and not the local machine running Maptool itself. I know there is a system property for setting the home directory that can be passed to the JVM, something like java -Duser.home=e:\ -jar Maptool* or something like that in the batch file. Of course, you would ahve to modify that per machine in case the drive letters change (or write something a bit more flexible)...
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Can one run rptools via a thumb drive?

Post by Phergus »

That's an issue if you want it to carry the various info that is stored in your .maptool directory. Of course preferences are stored in the registry (on Windows) so nothing you can do about that.

User avatar
patoace
Dragon
Posts: 313
Joined: Mon Sep 24, 2007 6:10 pm
Location: Rancagua - Chile

Re: Can one run rptools via a thumb drive?

Post by patoace »

Don't know much more, but with that configuration, the folders autosave, assetcache, resource and others are stored in the data folder, in the drive.

I guess some data is left in the PC registry, but Maptool can work.

User avatar
aliasmask
Deity
Posts: 8653
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Can one run rptools via a thumb drive?

Post by aliasmask »

Assuming Maptools is not on target machine, the thumb can auto load some things to specify it's current drive and also run a .reg file to set registry properties (whatever those are).

It would be a nice project if someone could compile that all in to one download.

edit: I was just taking a look at the things in the registry. Looks like all the campaign preferences, server settings, interface values, resource locations, global macros and some cached info is stored there. I'm wondering which of those values are really required. My thought is none, in the hopes that it would load default info.

I guess I should play around with it and see what is required or what happens without the reg keys.

User avatar
Azhrei
Site Admin
Posts: 12058
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Can one run rptools via a thumb drive?

Post by Azhrei »

patoace wrote:Don't know much more, but with that configuration, the folders autosave, assetcache, resource and others are stored in the data folder, in the drive.

I guess some data is left in the PC registry, but Maptool can work.

Yep, you've got it correct. The MAPTOOL_DATADIR overrides the user.home setting. This is needed because some platforms don't allow the home directory to be changed.

Unfortunately, there is still the problem of the TinyLAF Defaults.theme still being searched for in the home directory. I don't know of a good way around that (it would be nice if the TinyLAF would accept an InputStream so that MapTool could search for the file itself; sounds like a bug report/feature request to those folks is called for).

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Can one run rptools via a thumb drive?

Post by Phergus »

Azhrei wrote:Unfortunately, there is still the problem of the TinyLAF Defaults.theme still being searched for in the home directory.

Won't TinyLAF will also load a default theme from the current directory if it finds one?

User avatar
Azhrei
Site Admin
Posts: 12058
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Can one run rptools via a thumb drive?

Post by Azhrei »

Phergus wrote:
Azhrei wrote:Unfortunately, there is still the problem of the TinyLAF Defaults.theme still being searched for in the home directory.

Won't TinyLAF will also load a default theme from the current directory if it finds one?

Yes, I believe so. But there's no portable way to set the current directory from inside the application and there is no plan to correct this.

That means using an environment variable that can be read from inside the application is a good alternative. Except setting Java properties must be done on the command line, which means it can't be done from the GUI without a user knowing what they're doing (and most users don't have a clue, nor should they need one).

So what I'd like to do is have MapTool find the theme file on its own and pass the InputStream to the TinyLAF code. Or at least pass a File object. But they don't accept any parameters and simply have a list of places they check. And IIRC there isn't any good way to fix this using subclassing (I believe the method doing the search is private static, but there may have been some other problem). For maximum flexibility they should use a callback function to retrieve the InputStream. Lacking that, they should add a parameterized constructor and/or setter method that takes an InputStream (preferred) or File object.

Sigh.

Hman
Kobold
Posts: 1
Joined: Thu Jan 12, 2012 10:32 pm

Re: Can one run rptools via a thumb drive?

Post by Hman »

I know this topic has been dead for a while but I figured I'd add something to it for the OP, if he's still around, or anyone else who have this question.

I do not have Java installed on my PCs. Simply because a large majority of malware use java as their backdoor into your system. Don't install it don't have to worry about it. Except these particular programs, you aren't missing much.

To run programs like this I use (this isn't advertising its just how I get it to work, besides its free open source) Portableapps. It is a portable thumb drive application with many neat functions. One is jPortable which is a portable version of Java that comes packaged with a launcher allowing you to run most java programs with little difficulty.

Unfortunately, one of the programs that doesn't work well with the portable launcher is maptools. Now I'm not a programmer and I know very little of java language. But, this is due to the manner maptools applies its configuration. For some reason the mt.cfg will not be applied to the .jar file simply launching it with the launcher. After several hours I figured a solution, probably one many of you may have been able to figure out much faster.

To get the configuration to work correctly I needed to get a batch file to launch the file. But, I can't launch bat files with the launcher and Java isn't installed on my PC. To get around this I simply added in the directory of my flash drive and the portable java program into the batch file. Opened like a charm with all the memory and stack sizes I needed. Only problem I can see is to edit configuration you have to go into the batch file every time. Also if your thumb drive gets a new directory label, you'll have to edit that in the batch as well.

I don't know how to overcome the home directory issue, but as I don't have one on my PC all the settings automatically get stored on the themb drives portable java folder. So this is not a problem for me.

You can save the maptools on your thumbdrive or on your PC and it will work either way with no problem (at least none I've encountered yet). Giving you a portable version of Maptools. Now I can work on my campaigns on my desktop at home then save them to the thumb drive and load them on my laptop when I meet my fellow gamers, without Java ever touching my PC or laptop system files.

Post Reply

Return to “MapTool”