[Added] Portable mode? portable.ini!

Moderator: GZDoom Developers

Portable mode? portable.ini!

Postby maseter » Fri Apr 15, 2016 7:52 pm

Could a portable mode cvar be implemented, which when set to true in gzdoom.ini, will make gzdoom use gzdoom.ini itself as the main configuration file, instead of creating gzdoom-USERNAME.ini? Because if i now put the gzdoom folder on my usb drive, and try to run it on a different PC, it will create and use gzdoom-ANOTHERPC.ini instead of using my already configured config, you see the dilemma?

I don't need a gzdoom-HOME.ini, and gzdoom-WORK.ini, and gzdoom-CYBERCAFE.ini and...

It's also a privacy issue, i thought you Germans don't just use names haphazardly, whatever happened to the whole Wie gut, dass niemand weiß, dass ich Rumpelstilzchen heiß! thing? :) Thanks!

Yes i know about the -config command line parameter, but still.
Last edited by maseter on Wed Apr 27, 2016 4:51 am, edited 1 time in total.
User avatar
maseter
 
Joined: 15 Apr 2015

Re: Portable mode?

Postby NeuralStunner » Sat Apr 16, 2016 12:46 pm

A (G)ZDoom.ini in the program directory will be used as the default configuration. But you can also specify a configuration to use via command line.

You could also use a launcher (like ZDL), or a simple batch script. Here's a one-liner for Windows:
Code: Select allExpand view
@GZDoom -config ".\GZDoom.ini" %*
User avatar
NeuralStunner
not actually a catgirl
 
 
 
Joined: 21 Jul 2009
Location: =o_O=
Discord: NeuralStunner#1293
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Portable mode?

Postby Rachael » Wed Apr 27, 2016 4:27 am

Something you can also do is go into the admin command prompt and type the following commands:

Code: Select allExpand view
move /y gzdoom-%username%.ini gzdoom.ini
mklink gzdoom-%username%.ini gzdoom.ini


The first command is simply a rename (with overwrite) and the second command creates a symbolic link to gzdoom.ini. You can change %username% to all the different usernames you use on your work machines and make symbolic links for each of them.

Symlink functionality is available in Windows Explorer (it will recognize them and display them as shortcut files), but Explorer cannot create them by itself.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Portable mode?

Postby maseter » Wed Apr 27, 2016 4:50 am

Thanks for the tips, i do use -config but still :).

Maybe GZDoom could check for (and use) portable.ini before creating a gzdoom-%username%.ini, problem solved!
User avatar
maseter
 
Joined: 15 Apr 2015

Re: Portable mode?

Postby Graf Zahl » Wed Apr 27, 2016 4:55 am

I think that goes well beyond what he needs.

The reason why I haven't added this is because the config file code is excessively pedantic about PREVENTING the scenario you want. Once it has made up its mind about the config's name it will remain. And it's simply too late when it comes to do the necessary checks because in order to read the value it needs to initialize the config file, and to read the config file it needs to set up its name. And I really don't want to mess around with this any more than necessary because it may break stuff I don't even think about.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Portable mode?

Postby Graf Zahl » Wed Apr 27, 2016 4:55 am

maseter wrote:Thanks for the tips, i do use -config but still :).

Maybe GZDoom could check for (and use) portable.ini before creating a gzdoom-%username%.ini, problem solved!


There I think about the most complex solutions, then this comes up... :mrgreen:
I'd still put a 'zdoom' in the name, just for those who absolutely must put everything into the same directory.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Portable mode? portable.ini!

Postby Graf Zahl » Wed Apr 27, 2016 5:02 am

Ok, done. The filename will be zdoom_portable.ini for ZDoom and gzdoom_portable.ini for GZDoom. I intentionally used an underscore to avoid clashes with people who happen to name their account 'portable', which I do not consider out of the option.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Portable mode? portable.ini!

Postby maseter » Wed Apr 27, 2016 5:12 am

Image
User avatar
maseter
 
Joined: 15 Apr 2015

Re: Portable mode? portable.ini!

Postby maseter » Sun May 01, 2016 5:47 am

Good news, this is now implemented, gzdoom_portable.ini, as of today's build:
http://devbuilds.drdteam.org/gzdoom/gzdoom-g2.2pre-1504-g47064e2.7z

But it does not inherit gzdoom.ini settings, like gzdoom-USER.ini, just fyi, i guess that's intentional?
User avatar
maseter
 
Joined: 15 Apr 2015

Re: Portable mode? portable.ini!

Postby Graf Zahl » Sun May 01, 2016 5:52 am

Yes, that's intentional. How else should it work? The portable ini file needs to be present in order to be used, so that obviously rules out loading the generic one.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests