Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
60 user(s) are online (26 user(s) are browsing Forum)

Members: 0
Guests: 60

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +30€

Current balance: -190€
(last updated 04/2017)

Please make a donation if you want to help keeping The-Starport online:

Bitcoin address:
Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 35 users playing Freelancer on 39 servers.
September. 21, 2017

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



Path Values for Saves and Screenshots
Not too shy to talk
Joined:
3/20 14:31
Group:
Registered Users
Posts: 71
Offline
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.

Posted on: 8/13 16:29
Top
Re: Path Values for Saves and Screenshots
Just popping in
Joined:
2016/3/29 21:54
Group:
Registered Users
Posts: 16
Offline
I'm guessing you're trying to relocate the save/screenshot location? Adoxa has already solved that issue with the following code:

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.)

Posted on: 8/13 18:09
Way too ambitious for his own good.
Top
Re: Path Values for Saves and Screenshots
Not too shy to talk
Joined:
3/20 14:31
Group:
Registered Users
Posts: 71
Offline
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.

Posted on: 8/13 18:57
Top
Re: Path Values for Saves and Screenshots
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3446
Offline
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 SHGetFolderPath), 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.

Posted on: 8/13 20:35
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
Re: Path Values for Saves and Screenshots
Not too shy to talk
Joined:
3/20 14:31
Group:
Registered Users
Posts: 71
Offline
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.


Quote:

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 SHGetFolderPath), 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.

Posted on: 8/13 20:44
Top
Re: Path Values for Saves and Screenshots
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3446
Offline
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.

Posted on: 8/13 20:48
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
Re: Path Values for Saves and Screenshots
Not too shy to talk
Joined:
3/20 14:31
Group:
Registered Users
Posts: 71
Offline
What kind of scenarios do you envisage being a problem with a portable install?

Posted on: 8/13 21:03
Top
Re: Path Values for Saves and Screenshots
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3446
Offline
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.

Posted on: 8/13 21:41
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
Re: Path Values for Saves and Screenshots
Not too shy to talk
Joined:
3/20 14:31
Group:
Registered Users
Posts: 71
Offline
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.

Posted on: 8/13 22:03
Top