Author Topic: Config files on all platforms  (Read 15232 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
Config files on all platforms
I added support for using a config file on Windows instead of the registry for storing configuration data for FSO. I also updated wxLauncher to properly support this behavior when an SDL build is selected.

Test builds: http://www.mediafire.com/download/kmzczw19fn784gq/ConfigTest.7z

That file contains new FSO and wxLauncher builds. To test this, unpack the FSO executables into the game root folder and the wxlauncher-0.10.1 folder to a directory of your choosing (don't overwrite your old launcher!).
First you should check if the new builds don't break any existing behavior. To do that, launch one of the builds the same way as usual (e.g. by using wxLauncher) and verify that all settings are still using the old values (if it doesn't then you will notice pretty soon because FSO will only run in 1024x768). If everything works you can try the updated wxLauncher builds.
Go to <path>/wxlauncher-0.10.1/bin and execute the wxLauncher executable in that directory. Select the build you just unpacked, change some settings (e.g. resolution) and launch FSO. If the changed settings are used, post here! If they are not used, also post here!

EDIT: Please also check if all your pilots are present. They are now stored in a user specific folder and not with in the FSO folder. The launcher will copy the files if they aren't present in the user directory so no pilot should be missing. A portable mode is planned but not currently implemented.
« Last Edit: December 16, 2015, 01:07:41 pm by m!m »

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Config files on all platforms
Do you mean that the SDL build still supports the registry unless some special flag is sent by the launcher telling it that it can read its settings from config files?  So that both the engine and launcher are backwards and forwards compatible?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline m!m

  • 211
Re: Config files on all platforms
The SDL builds will use the registry if no config file is present. If one is found then only the config file is used. The launcher only has to write the config file, no additional command line option is required.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Config files on all platforms
So in a launcherless environment, one would have tto manually create the config file first on windows.  Guess that's the best we can hope for for backwards compatibility.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline m!m

  • 211
Re: Config files on all platforms
If there is no launcher then the code will try to use the registry values so the config handling is fully backwards compatible.
What isn't backwards compatible is the movement from writing stuff into the FSO directory to writing it to a user specific directory (e.g. on Windows that somewhere under Users\...\AppData\Roaming). That needs a launcher to write data to the right place and copy the pilots files when doing the first launch.
As stated in the first post (after the edit) I want to add a portable mode where all data is written to the FSO directory but that is currently not completed.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Config files on all platforms
Just curious.. are there even any legitimate scenarios for a completely launcherless environment? How is that handled on other OS platforms?
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Config files on all platforms
Before wxLauncher, Linux users pretty much had to write config files from scratch.  I think that the configuration system should always be manually editable, but beyond that I don't expect anyone to want to skip using a launcher if one is available.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline m!m

  • 211
Re: Config files on all platforms
The only thing the launcher does that is a little more complicated to do manually is copying the pilot files. I think the users who configure FSO manually probably can handle executing one command to migrate the pilot files (we could even print that command to stdout).

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Config files on all platforms
wxL copies the pilot files? Did it always do that? I don't remember there being code for that when I was an active contributor...

 

Offline m!m

  • 211
Re: Config files on all platforms
That code was added by me because the directory where FSO saves its pilot files has changed. The launcher automatically copies the pilot files when a build requiring that is launched.

 
Re: Config files on all platforms
When I choose build in wxlauncher (installed, not from archive), it shows error:
Application was unable to start correctly (0xc000007b). Click ok to close application.

And advanced settings tab shows:
The executable did not generate flag file.
Make sure that the executable is an FS2 Open executable.


Launcher from archive shows this error:
The program can't start because MSVCP140D.dll is missing from your computer. Try reinstalling the program to fix this problem.

Win7, MVC++ 2015 Redistributable is installed.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Config files on all platforms
Could it be the redist for the wrong arch is installed?  There are x86 and x64 versions of the MSVC redistributable.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline m!m

  • 211
Re: Config files on all platforms
<snip>
Thank you for testing the builds!

I accidentally uploaded a debug build which needs the debug redistributable but that's not included in the standard package. Here is a new release build which should hopefully work better: http://www.mediafire.com/download/2eb4692ktm9349k/ConfigFile.7z

I don't know why FSO is crashing when it's launched, I'll try to reproduce that on my computer.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Config files on all platforms
Had at least two people get exactly the same error (and never found out the cause) with the 64-bit test builds.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline m!m

  • 211
Re: Config files on all platforms
I tried running the build with my installed version of wxLauncher and when I launch the build wxLauncher crashes. However, when I try launching the build using my development version of wxLauncher everything works fine so I have no idea why it is crashing.

 
Re: Config files on all platforms
Now wxlauncher works but executables still crash with the same error.

Never saw this error with custom builds I tried from other topics. :wtf:

edit:
Oh wait. Where is play button? :p
« Last Edit: December 15, 2015, 05:40:43 pm by tomimaki »

 

Offline m!m

  • 211
Re: Config files on all platforms
The layout of the basic settings page is broken and I don't have any idea how to fix it so until wxLauncher works properly with wxWidgets 3.0 this feature will be put on hold.

 

Offline m!m

  • 211
Re: Config files on all platforms
I finally got wxWidgets 2.8 to compile and managed to compile new builds: http://www.mediafire.com/download/kmzczw19fn784gq/ConfigTest.7z

This should not have the layout issues of the older builds.
« Last Edit: December 16, 2015, 01:07:25 pm by m!m »

 
Re: Config files on all platforms
I solved why error 0xc000007b pops up.
Long story short: mess with SDL2.dll for different architectures. :nervous:

Some time ago I tested x64 builds which are linked to SDL2.dll for 64bit.
Now this wxlauncher works with SDL2.dll for 32bit and executables are 32bit too. But exes tried to load dll (named the same for both archs) from root folder. So I deleted dll from fs folder, but executables screamed about missing SDL2.dll, then I copied dll from bin folder to fs folder and error is gone. :)

Anyway after launch it asks to create profile. When I wrote name and pressed enter, I see this:
Selected pilot was created with different language to the currently active language.
Please select different pilot or change language.

It doesn't let me proceed further. I can't create next profile.

Win7 polish and fs english version from GOG.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Config files on all platforms
That's a FSO message. Unfortunately there's language specific data stored in the pilotfiles which means they're not portable between different languages (why did FSO think it was a good idea to use translated intel names as a key...). If you can't create a new pilot then you might have reached the limit of 20 pilots? Or... if you don't have any pilots at all then maybe there's a permissions issue with writing to the pilot file location? I guess m!m will need to post what the new location is to be able to check that, I'd *guess* it'll be under %APPDATA%?
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...