Environment variables with ScummVM

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

Environment variables with ScummVM

Post by giovpres »

Hello!
I made a little batch file with this commands:

if not exist "%AppData%\ScummVM" md "%AppData%\ScummVM"
if not exist "%AppData%\ScummVM\scummvm.ini" copy scummvm.ini "%AppData%\ScummVM\"
if not exist "%AppData%\ScummVM\ScummVM_Saves" md "%AppData%\ScummVM\ScummVM_Saves"
set sizeSRC=%~z1
for %%R in ("%AppData%\ScummVM\scummvm.ini") do if %%~zR equ 0 copy scummvm.ini "%AppData%\ScummVM\"
cmd /c start scummvm.exe --config=scummvm.ini

My problem is I'ld like to specify the savepath using the %AppData% variable so ScummVM may work in every operating system (I hope).
I tried to add the argument --savepath="%AppData%\ScummVM\ScummVM_Saves" but the program doesn't translates the value of variable, there are a solution?

Very thanks
Collector
Posts: 549
Joined: Sun Oct 30, 2005 6:58 pm
Contact:

Post by Collector »

Just use the GUI to set the save game path.
User avatar
LogicDeLuxe
Posts: 437
Joined: Thu Nov 10, 2005 9:54 pm

Re: Environment variables with ScummVM

Post by LogicDeLuxe »

giovpres wrote:My problem is I'ld like to specify the savepath using the %AppData% variable so ScummVM may work in every operating system (I hope).
I'm pretty sure that this can work in Windows (2000, XP and later) only. That is far from "every operating system".
giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

Post by giovpres »

Collector wrote:Just use the GUI to set the save game path.
I know, but using variables I could save data in every operating system, entering %AppData% should be converted in C:\Document and settings....
instead it remains how is wrote..
User avatar
bobdevis
Posts: 567
Joined: Fri Jan 16, 2009 10:52 am

Post by bobdevis »

Shouldn't you be using %USERPROFILE% instead of %APPDATA% for files that need to be writable by the user?
giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

Post by giovpres »

bobdevis wrote:Shouldn't you be using %USERPROFILE% instead of %APPDATA% for files that need to be writable by the user?
I know, but the problem is I can't use any variable... ScummVM doesn't interpretes them...
User avatar
bobdevis
Posts: 567
Joined: Fri Jan 16, 2009 10:52 am

Post by bobdevis »

giovpres wrote: I know, but the problem is I can't use any variable... ScummVM doesn't interpretes them...
If I am not mistaken it is the OS the interprets that, not ScummVM. This would mean you have some non-ScummVM related problem.

Anyway..... Why not go the oldskool way and just use the C:\Scummvm directory for everything?
Vista allows users by default to make new dirs in C: and Win7 probably too. This won't work on business computers that have the user profile stored remotely but the upside is that you gain Win9x compatibility ;)
giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

Post by giovpres »

bobdevis wrote:
giovpres wrote: I know, but the problem is I can't use any variable... ScummVM doesn't interpretes them...
If I am not mistaken it is the OS the interprets that, not ScummVM. This would mean you have some non-ScummVM related problem.

Anyway..... Why not go the oldskool way and just use the C:\Scummvm directory for everything?
Vista allows users by default to make new dirs in C: and Win7 probably too. This won't work on business computers that have the user profile stored remotely but the upside is that you gain Win9x compatibility ;)
Thanks bobdavis, if u are sure all OS permits to write to C: root I'll put saves folders there so I resolve my problem, I've winXP so I can't test how Vista or Seven works, but if u tell so I belive u ;)
Still thanks
User avatar
bobdevis
Posts: 567
Joined: Fri Jan 16, 2009 10:52 am

Post by bobdevis »

Yeah. I think the general idea is that right management is by default only enforced for dirs that Windows itself made and manages.
You might get in trouble with using C:\ScummVM if more then one user on the same machine tries to run ScummVM.
I get to sit behind a real live Vista computer with UAC on before Monday, so I can test it ;)
giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

Post by giovpres »

bobdevis wrote:Yeah. I think the general idea is that right management is by default only enforced for dirs that Windows itself made and manages.
You might get in trouble with using C:\ScummVM if more then one user on the same machine tries to run ScummVM.
I get to sit behind a real live Vista computer with UAC on before Monday, so I can test it ;)
Ok, I doing this because I'ld like to use ScummVM from dvd, avoiding to copy all files on hard disk, so I may run it on every pc without errors of permissions.
giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

Post by giovpres »

I've seen Vista doesn't permits to write in C: so the universal C:\scumm_saves isn't the right solution..
User avatar
bobdevis
Posts: 567
Joined: Fri Jan 16, 2009 10:52 am

Post by bobdevis »

How odd. I just confined that it does, on a non-privileged account with UAC on, on a fully patched machine, by default ;)
Collector
Posts: 549
Joined: Sun Oct 30, 2005 6:58 pm
Contact:

Post by Collector »

A standard user account on Vista/Win7 with UAC does allow the creation of new base folders on the C: drive. As mentioned, it is the system folders that are protected. If you are unable to do so on a given machine, it must be a locked down machine, like what you would find in a work environment. If you don't have access to the Policy Editor to reset security policies to defaults, you can create a subfolder in your user folder.
hippy dave
Posts: 129
Joined: Mon May 05, 2008 3:37 pm

Post by hippy dave »

i'm well out of the loop with windows' "recent" (vista/7) file securities, so i can't help you there, but might you be better off setting scummvm up on a usb stick instead of a dvd, so you can run scummvm and save games all in place on that?
just a thought :)
Post Reply