Running OOLite from USB Flash Drive - Question

News and discussion of the PC port of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
kermit
Average
Average
Posts: 10
Joined: Mon Oct 06, 2008 11:21 am

Running OOLite from USB Flash Drive - Question

Post by kermit »

OK - I remember playing Elite way back on a spectrum, & glad a friend told me about this version

HOWEVER - I'd like to play this 'anywhere' (e.g @ work,home, friends house) by putting it on a USB flash drive - which I have & it runs (abit a little slow on accessing)

The problem is the saving/loading of commanders

I've figured out that I have to alter 'RunOolite.bat' file to point to the drive letter assigned to the USB device on the computer I've plugged it in but depending on the computer - this letter keeps changing

On one PC the flash drive may be assigned as 'D:', on another PC it may be 'F:', on another 'H:' etc etc.

Is there anyway I can get save to the USB drive without having to keep editing the BAT file each time before running Oolite ???

Is there a way I can force a drive letter to the USB (through an Autorun.ini file perhaps? ) once it is plugged in

(I have Oolite stored in '?:\Games\Oolite' folder on the usb drive where ? is whatever the drive letter is given to the USB)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

You're probably simplest in mapping a fixed drive (say "Y" for example) to your USB key, and then always using that for everything relating to Oolite. When you look at My Computer you'll see two drives relating to the key (one D/E/F/whatever the PC auto-picks) and the other always on Y.

You can probably set up the auto-mapping in your autorun.ini or some route like that. Then you should be OK. I routinely run Oolite from an SD card sat in a PCMCIA card, but my machines are all set-up so that drive is always F (two partition hard drives as C and D, then DVD as E, so SD auto-maps to F) and there's little to no speed hit that way vs hard drive. You may have a little more problems with USB speeds, but it should be possible.
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post by Micha »

If you edit the RunOolite.bat file and replace the contents with the following, it'll work:

Code: Select all

@echo off
set BASE=%~dp0
set GNUSTEP_PATH_HANDLING=windows
set GNUSTEP_LOCAL_ROOT=%BASE%
set GNUSTEP_NETWORK_ROOT=%BASE%
set GNUSTEP_SYSTEM_ROOT=%BASE%
set HOMEPATH=%BASE%
%BASE%\oolite.app\oolite.exe %1 %2 %3 %4
This works for the following directory structure, where <x:\path> is the drive and path to your Oolite root directory, in my case "E:\Oolite" but it should work for any path anywhere on your system. This setup allows you to copy your entire Oolite directory to anywhere and still run the .bat file without problems.

Note that in the default setup, save-games and the GNUstep directory are inside the oolite.app directory - personally I don't like that, if you do, all you have to do is append "\oolite.app" after the "%BASE%" bit.

Code: Select all

<x:\path>\
  |-> RunOolite.bat  (and Readme files)
  |-> AddOns\
  |-> oolite-saves\
  |-> GNUstep\
  |-> oolite.app\
    |-> oolite.exe  (and DLL files)
    |-> Resources\
The glass is twice as big as it needs to be.
User avatar
kermit
Average
Average
Posts: 10
Joined: Mon Oct 06, 2008 11:21 am

Post by kermit »

Many thanks for those couple of tips, although Micha - I got a little confused
:? (which isn't that diificult)

I'm guessing that the line 'Set BASE=%~dp0' somehow knows where the BAT file is running from & it's this that is 'put in place' of '%BASE% in the following lines

My path is '?:\Games\Oolite\' so I guess this is what's used

ANYWAY - I did a little experiment & all I did was REMOVE the 'H:' part of each 'SET' line & this seems to of done the trick (I've only tried on 2 computers so far)

So instead of having 'H:\Games\Oolite\Oolite.app' on each line I have instead '\Games\Oolite\Oolite.app'
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post by Micha »

When I tried to remove just the drive-letter part it didn't work for me (it was still trying to access stuff from the C: drive).

The %~dp0 expands to <drive>:<path> of where your batch file is - a little digging through the Windows Help Center found this little trick :) And yes, that's what ends up getting put in place of the %BASE%.

But.. whatever ends up working for you.
The glass is twice as big as it needs to be.
Post Reply