Path Values for Saves and Screenshots
-
Howdy,
Adoxa (or anyone) did you guys find where the path strings are for the locations of save files and when a screenshot is taken? They are obviously reading environment variables, and I can adjust these with volatile environment variables, but I just want to know where they are and how flexible these are.
Also any other paths that use environment variables.
Just so I can map everything out for a truly portable FL.My original proof of concept works OK, however I am going with an instanced approach with my launcher to make it easy to create instances of FL.
-
I’m guessing you’re trying to relocate the save/screenshot location? Adoxa has already solved that issue with the following code:
File: Common.dll 0A2FB1: C7 06 2E 2E 00 00 EB 0E [ 56 6A 00 6A 00 68 05 80 ] 0A300A: 0C [ 21 ] 0A3018: 7C [ 13 ] 0A30BE: C7 06 2E 2E 00 00 EB 0E [ 56 6A 00 6A 00 68 27 80 ] 142690: "Saves" 00 [ "My Gam" ]
This will relocate the save files/screenshots into the dir of the FL install. I think every mod should do this really as it removes the bug of crashing because of an incorrect restart.fl when switching between mods.
(replace the codes on the right with the ones on the left.)
-
That problem is gone because each instance starts with a session based environment variable. Currently FL points to the users documents folder to place the saved game files.
I can hijack those into a folder for each instance.
Every instance for example can have separate display settings and control mappings and saved game files. Each instance can have it’s own mod applied.
I know that’s essentially what this exe hack produces, but I have it done externally right now.
So you could have a folder for Vanilla, Discovery, Void etc etc.
It will be manageable in a custom launcher I am building in Node-Webkit right now. You’ll be able to just browse from a vertical menu on the left and see which mod has been applied on the right side, with appropriate play/launch button.
-
The path doesn’t contain a reference to an environment variable because that’s not how C++ works. They call a special function to get the Documents folder (probably [c]SHGetFolderPath[/c]), so you’d have to hack that piece of code and change it (can base yourself off adoxa’s code shown above).
Also, I strongly recommend not storing user data in the same folder as program data. That’s against Microsoft’s recommendations and will conflict with security features related to privilege escalation in application folders.
-
Yeah, I agree.
I wouldn’t have considered putting it in the games folders anyways.
However, the location of FL will not be fixed, it will be capable of being dragged around the filesystem, dropped into a USB pen etc.Unless I am misunderstanding the issues you are referring to FF are UAC related yes?
They got so much more restrictive in Windows 10 as far as I saw. You can’t even create a folder in C:/ with that crap turned on, as an administrator. At least that’s how it was when I first tried it when it came out.
FriendlyFire wrote:
The path doesn’t contain a reference to an environment variable because that’s not how C++ works. They call a special function to get the Documents folder (probably [c]SHGetFolderPath[/c]), so you’d have to hack that piece of code and change it (can base yourself off adoxa’s code shown above).Also, I strongly recommend not storing user data in the same folder as program data. That’s against Microsoft’s recommendations and will conflict with security features related to privilege escalation in application folders.
-
Yes, UAC is the largest part. The goal is to prevent unauthorized privileged operations by programs that do not explicitly request administrative permissions. It’s a very, very good thing, but it does mean antiquated programs (or antiquated developers) that attempt to store modifiable data in the same location as the program will run into issues.
I understand that you want to make a portable install, but that goes against fundamental security principles.
-
I don’t think there’s going to be issues, but I also don’t see if there’s really an audience for a portable install these days. Gaming is no longer about going to a friend’s house with a USB key or a burned CD and share some games. People are fine with actually installing things.
A simplified/streamlined Freelancer installer which installs other things (1.1 patch, JFLP, etc.) would probably be more welcome/useful than a portable install in my mind.
-
I’d personally like to combine both.
A central launcher with direct ties to community news, websites, a discord chat (we have one over at Void) with the ability to create multiple instances of FL each with different mods applied (featured mods could be all the big ones, discovery etc) would be useful even to new players.
I did have the thought of integrating some elements of git for version control (obviously not the base install) to create a pseudo-auto-updater. I know that could be abused to download full copies of the game if someone wanted to. But that will be on them, not me.
Also had thoughts of replacing some of the tools out there with a plugin system to the launcher, to accomplish tasks. Like save editor, MPID backup etc.
And also had thoughts to build in an experimental mod creation system, fill in a form, click create (ship, gun) and have it dropped into a testpack for easy testing.
I have lots of thoughts surrounding the capabilities of this.