portable/isolation mode

portable/isolation mode

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

portable/isolation mode

Post by knorke »

I installed test version spring_0.82.3-2365-g82c3187.exe, with [x]portable checked, into a new folder.
I start spring.exe and was actually expecting it not to find any mods/maps, yet it finds some files in "my documents\"
Those were probally put there by an older install of zeroK lobby.

Looking outside its install directory is not really what I am expecting from a portable/isolation mode program.
The reason why it matters is, that some day I would like to make a .zip or installer of my game and its map list should not be mixed by other installed Spring games. In the same way I dont want my game to "pollute" the maplist of other games either.

In springsettings.cfg it says
SpringData=

I've heard that checking [x]portable in the installer is actually not the real isolation mode, how do I enable this mode then?
And what are the differences?

What I would like to do is basically zip the whole Spring folder, with all map & mods .sdz included, and players just unzip it.
After deleting that folder all traces of the game should be gone.
Is that technically possible with 0.83 Spring and also which lobby would work this way?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: portable/isolation mode

Post by hoijui »

you have to define the env var SPRING_ISOLATED.

SL.bat (windows)

Code: Select all

SET SPRING_ISOLATED=1
./springlobby.exe
SL.sh (linux & mac)

Code: Select all

#!/bin/sh
export SPRING_ISOLATED=1
./springlobby
not a very nice/clean way i guess, but for testing it should be enough, and it would also meet your criteria.
Last edited by hoijui on 30 Jun 2011, 17:11, edited 3 times in total.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: portable/isolation mode

Post by knorke »

so .bat files are the only way, there is no setting for this?
Hm, if that works it is ok I guess.
If springlobby is set to isolated mode this way, will it also have effect on the spring.exe that is launched by SL?
Or would I have to make a spring.bat and set SL to start this instead of spring.exe?
What about springsettings?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: portable/isolation mode

Post by hoijui »

this env var is read by unitsync and the engine, not by SL.
if springsettings uses unitsync, then it will also use the correct data-dirs of course.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: portable/isolation mode

Post by Forboding Angel »

Not happy about it. Should have been done via an empty file in the install directory.

Changes made using the SET command are NOT permanent, they apply to the current CMD prompt only and remain only until the CMD window is closed.
Last edited by Forboding Angel on 30 Jun 2011, 11:30, edited 1 time in total.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: portable/isolation mode

Post by Forboding Angel »

hoijui wrote:you have to define the env var SPRING_ISOLATED.

SL.bat

Code: Select all

SET SPRING_ISOLATED=1
./springlobby.exe
Is not valid. Needs to be:

Code: Select all

SET SPRING_ISOLATED 1
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: portable/isolation mode

Post by knorke »

At least in win xp it is with the = sign
Pretty sure it was like that in previous windowses too.
I hope it did not change but I could not google any windows 7 or vista guide to check that.

btw iirc if you use setx, the change will be permanent (saved in registry) but i think it only works with some service packs or something. also would influence other spring installs so probally better not use that.
---
Anyway, it does work.
Now would be nice to have this in springsettings.cfg, it seems most logical.
Both "empty file in the install directory" or env variables seem a bit hackish.
But I guess this env variables thing is just for testing anway?

Out of interesst, does "portable install" have any function at all?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: portable/isolation mode

Post by Forboding Angel »

Isolation mode is what portable mode should have been all along.

With this method that isolation uses, it is necessary to use both isolation and portable mode (portable mode being the failsafe).

It appears I was mistaken. SETX will not take =, but SET will.

No, Isolation is to be used for production environments, which is why imo an environment var is so offputting.
knorke wrote:
Both "empty file in the install directory" ... seem a bit hackish.
A 0kb file? I doubt that it would cause a stink.

From what I am told, using SET, child processes gain the environment var even if the cmd window is closes, same goes for grandchild processes (spring.exe would be a grandchild process). I have no real way to test this currently though.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: portable/isolation mode

Post by knorke »

its not about filesize...
otherwise there might as well be a fullscreen.txt, no_audio.txt and reverse_mousewheel.txt

/edit
setx is without = because it is an extra programm while set is native part of the OS (or something like that)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: portable/isolation mode

Post by Forboding Angel »

Ah come on, that's just silly exaggeration and you know it, but for things like this it actually makes sense.

On a sidenote, the extensions could be left off of the filename.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: portable/isolation mode

Post by hoijui »

please stop repeating the same stuff in every thread that somehow touched portable or isolation mode.
portable means, you can copy it around, and it still works.
isolation means, it does not look for stuff in external dirs.
isolation mode naturally "includes" portable mode.
just cause you want isolation mode and not portable mode, does not make portable mode useless, or badly implemented.
Post Reply

Return to “Engine”