Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Chewie on December 26, 2006, 07:21:34 am
-
Hallo everyone!
I played your Freespace 2 builds quite some time, and I recognized something which I don't quite understand:
As this project is about extending the Freespace 2 engine with features for a more up-to-date gameplay feeling, why does the launcher (and possibly the game) still need administrator rights to work properly? I haven't yet looked in the code, but when I click "Apply" in the launcher, I get some errors about data not being set. After checking with RegMon, I saw that data is to be written in HKEY_LOCAL_MACHINE\Software\Volition\FreeSpace2, which on a default windows system is only permitted for administrators.
I know that there are too many users out there working all day as administrators (which is quite a security risk as we all know), but I hope these numbers are shrinking, especially with Windows Vista.
So why do you still insist in writing your data in this path in the registry and don't change to HKEY_CURRENT_USER?
If there already has been a discussion about this topic, I would be glad to get a link to it, because I didn't find one.
Thanks in advance and please don't get me wrong, I truly appreciate the work you guys have done. I'm just conviced that proper integration into the operating system is essential for any application.
-
We're actually moving to ini files instead of using the registry, but that isn't going to happen until after the 3.6.* series of builds. For now we just use what the game was originally written for, and that is HKLM (evil as that may be).
-
Ok, I see.
Will those ini files reside in the program directory or will they be located somewhere under %APPDATA%? Because the first way would be as evil as the HKLM solution ;)
-
Initially in the game directory. We are actually debating the move to %APPDATA% for 3.7. Since we support Linux and OS X, and already have separate read/write directory roots on that side, the code already has everything needed to do this, but there is some debate as to how much trouble this change will be for the Windows users.
So, it will move to an %APPDATA% type thing (the debate is more about whether the write root should be somewhere that is hidden by default, or visible by default) in a few months. But that will happen only after (hopefully, shortly after) the change to ini files, since the new Launcher has to be completed for all of it to actually work.
-
you will need to run the launcher (and the game) in elevated mode in windows vista due to this btw.
-
If by appdata you mean the subfolders under Documents and Settings on XP, I would much rather have it in the game directory. I hate how most programs these days put their files in obscure locations all over the place.
-
If by appdata you mean the subfolders under Documents and Settings on XP, I would much rather have it in the game directory. I hate how most programs these days put their files in obscure locations all over the place.
Well, an obscure location is not necessary, at least %APPDATA%\Freespace2 (maybe c:\Documents and Settings\Application Data\Freespace2) doesn't sound obscure to me. Furthermore, Windows is a multi-user system. So if several users want to use an application, they can all have their own program settings. If you would store your data at a central location, they couldn't.
Or maybe the user could select if he wants to store this information user-based or centrally. But then, this choice also would have to be stored somewhere ;-)
-
To tell you the truth, if it's outside the game directory it's too obscure as far as I'm concerned. :p I'm the only one who uses my machines and I like to be able to copy my game installations between computers while retaining all the configuration data, by just packing up the entire directory and putting it on some sort of removable media. This used to work well several years ago but these days it's often impossible, as the games scatter their files everywhere among the OS directories.
As you said, the best thing would be to just make it the user's choice with a command line flag or something like that. I've seen a few programs that do it that way.
-
1) It's going to happen, because it must ... deal with it
2) It's not going to be optional ... deal with it
:D
-
To tell you the truth, if it's outside the game directory it's too obscure as far as I'm concerned. :p I'm the only one who uses my machines and I like to be able to copy my game installations between computers while retaining all the configuration data, by just packing up the entire directory and putting it on some sort of removable media. This used to work well several years ago but these days it's often impossible, as the games scatter their files everywhere among the OS directories.
I second that emotion.
-
Well, then you are using the wrong operating system ;)
Seperating program binaries and program data (generated by the user) is essential for operating systems like Windows and Unix (Linux/MacOS included).
-
I'm not sure what your definition of essential is, when it's quite possible to put everything in one directory, without creating one registry entry, just like the DOS days. For example, I can run 7zip or µTorrent standalone, or I can choose to "install" them, which I choose not to.
All these OS's are determined to run in a network environment it seems, and so they trip all over themselves dealing with the concomitant security issues. My PC is not networked and never has been, so as far as I'm concerned that's a bunch of wasteful overhead.
I think it's stupid that Windows wants to get on the internet every time I boot. My mother may think it's neat to have automatic updates for every piece of software on her machine but I don't.
I don't see why all the network stuff can't be stripped out of the OS, and let some piece of external hardware deal with the firewalling and virus checking. I don't understand why I can't load some type of stripped down XBox type OS on my PC. I often dream of how fast my machine would be then.
This situation isn't going to change and I know that, but it doesn't mean I don't have the right to think it's stupid. It's no benefit to me when 90% of my patches are related to internet security, and none to performance.
-
I can't see how this even does anything for network security. The only point of it seems to be to accomodate multiple users, which should be (and is already, for the most part) incorporated into the game itself. You could instead have a system where you can switch between multiple configuration profiles through the Launcher (or through pilots, if the command lines and other options eventually get integrated into the game) and store them in a master file, which would be a lot more convenient and flexible than going through the OS user profiles.
At least it won't be any worse than the current system. :p But I agree with Huggybaby that scattering files around like this makes no sense at all.
-
The reason to have two locations is so that one is guaranteed to be writable. On an UNIX for example, you can install the game anywhere on the filesystem, but you will never be able to play it because the game couldn't write pilot files or config files or anything else to disk. File permissions would prevent it. On a properly setup machine, regardless of OS, that is how it should be, you would only be able to modify your own files.
There are already people using the game who can't save files in c:\Games\FreeSpace2, and that number will only grow as Microsoft finally wakes up to basic filesystem security. To their credit, Microsoft has done a pretty good job of move people to a non-retarded way of doing things, however slowly that might be happening. Everyone is still stuck in the DOS days though, but that just isn't how the world works any more, it's not how its worked for quite some time.
-
Well, then you are using the wrong operating system ;)
We have a winner.
-
Everyone is still stuck in the DOS days though, but that just isn't how the world works any more
And another.
-
The reason to have two locations is so that one is guaranteed to be writable. On an UNIX for example, you can install the game anywhere on the filesystem, but you will never be able to play it because the game couldn't write pilot files or config files or anything else to disk. File permissions would prevent it. On a properly setup machine, regardless of OS, that is how it should be, you would only be able to modify your own files.
There are already people using the game who can't save files in c:\Games\FreeSpace2, and that number will only grow as Microsoft finally wakes up to basic filesystem security. To their credit, Microsoft has done a pretty good job of move people to a non-retarded way of doing things, however slowly that might be happening. Everyone is still stuck in the DOS days though, but that just isn't how the world works any more, it's not how its worked for quite some time.
I'm not sure what you mean by "basic filesystem security." I can only think of one reason why the Freespace directory should be write protected on a single-user machine: if it's being run directly off removable media for some reason, but I would think that is very uncommon. Even if it is useful in some cases to store the profiles outside the game folder, why there can't be a choice? For example, why can't FS2 search for the profiles and configuration files in both its own folder and the OS user directory (with some order of precedence, which isn't relevant)? I must be missing something here.
-
Basically, the problem is that things were set up inefficiently in the first place.
Even if you don't use a computer network, having everything "perishable" - ie customized by the user - in a central location means that it's extremely easy to back _everything_ up. Under Linux, all you need to do is copy your home directory someplace else and you've got a full backup of all your critical data - at least in theory.
The problem is that way back in the DOS days, there was no central location. And even these days, it's easier to just stuff everything in the app's folder rather than figure out where it should go. Granted, my forays into my user profile under Windows make me wish for the relatively straightforward Linux home directory, but the merits of a filesystem are probably not the topic of discussion here...
The reason that I can see a FS2 folder being write-protected is if you were going with the Linux style of having everything locked down, when using normal user access, so as to secure the file from some malicious program playing havoc with system or program files, and generally planting itself in various places in devious ways. This is generally the way that Linux distros are set up by default; so that if a virus infects every accessible file on the system when it's run by a normal user, fixing it is simply a matter of purging the virus from the home directory and/or restoring from backups. So it's in the interests of crossplatform compatibility to have fs2_open support separate pilotfile directories. Doing the same thing under Windows is simply standardizing the interface.
From a practical point of view, considering the history of it all, it's arguable; it's hard enough to walk people through fixing bugs in FS2 without having a whole nother set of folders to deal with. But at the same time, it's a step in the direction that most programs should be going.
-
Even if you don't use a computer network, having everything "perishable" - ie customized by the user - in a central location means that it's extremely easy to back _everything_ up. Under Linux, all you need to do is copy your home directory someplace else and you've got a full backup of all your critical data - at least in theory.
Yes, I can see the advantage of that, although it would make individual programs harder to transport. But on XP, there is no one central location for these things. My games put their files in their own folders, in Documents and Settings, in My Documents and even in the Windows system folder. On top of that, the Documents and Settings folder also contains a lot of OS-critical data and you often can't simply dump a backup on top of it without messing something up. In practice, I find it much more convenient to have everything for a given game in one place. Most of the Unreal-based games, for example, are like this (and have nothing in the registry either), which makes them very easy to transfer between computers.
As for write protecting the FS directory just for virus protection, surely that's going a bit too far with it. I think at that point, it would become an inconvenience more than anything else. You might as well write protect the profile folder as well if you're that concerned about viruses. :p
So it's in the interests of crossplatform compatibility to have fs2_open support separate pilotfile directories. Doing the same thing under Windows is simply standardizing the interface.
That makes sense, but why does that imply forcing the game to use separate profile directories?
-
... I can only think of one reason why the Freespace directory should be write protected on a single-user machine ...
That's the issue though, it's not a single-user machine, it's multi-user, whether just one person is using it or not. It's the old DOS/Win9x mentality, where you, the user, is basically God on that machine. On a modern, multi-user OS, you want to be a normal man, and humble man, and just be allowed to mess around with your tiny corner of the world. It's fine to go play God occasion, but it's not really a job that you want full-time.
In other words, you don't really want to run as a user which has the power to do anything. What you want is full control over your tiny bit of the computer and only switch to an admin user when you need to (to add something new to the system, or remove something). System wide files and config can't be changed by you normally, which means that viruses and nasty little spyware programs have great difficulty messing up your computer. Once you start doing this, and get used to it, it's actually kind of nice.
As WMCoolmon said, Windows is still behind the times on this actually being easy. But on my Linux box for instance, I have $HOME on a separate hard drive. All of my own files go there, and programs and system config to on a drive which I don't have write access to as my normal user. When it's time to upgrade to a new OS version I simply erase everything except for $HOME, and install the new OS. When it starts up for the first time I just setup my username that I used before, and all of my settings are just as I left them. This means that I can download a new version of Linux, reboot the computer and install it, reboot the computer to start running it, and that's all, no extra config, nothing. It takes all of 30 minutes and I've switched to a new OS and am immediately back doing e-mail, web browsing, coding, etc.
As for write protecting the FS directory just for virus protection, surely that's going a bit too far with it. I think at that point, it would become an inconvenience more than anything else. You might as well write protect the profile folder as well if you're that concerned about viruses. :p
The point is that the FS directory would be write protected by default. You wouldn't change anything regarding that, it's just how the user permissions would be set, when set properly. Protecting the profile folder wouldn't be an issue though, since it shouldn't contain executable files for viruses to infect. :)
So it's in the interests of crossplatform compatibility to have fs2_open support separate pilotfile directories. Doing the same thing under Windows is simply standardizing the interface.
That makes sense, but why does that imply forcing the game to use separate profile directories?
It can't be selectable by it's very nature. It's all or nothing. But it doesn't really have anything to do with cross-platform support, it has to do with supporting current and future Windows versions. We do it with the Linux and OS X builds because that is simply how it's done. Windows is getting to that point, and is largely there already, so we are just playing catch-up on that side.
-
That's the issue though, it's not a single-user machine, it's multi-user, whether just one person is using it or not. It's the old DOS/Win9x mentality, where you, the user, is basically God on that machine. On a modern, multi-user OS, you want to be a normal man, and humble man, and just be allowed to mess around with your tiny corner of the world. It's fine to go play God occasion, but it's not really a job that you want full-time.
In other words, you don't really want to run as a user which has the power to do anything. What you want is full control over your tiny bit of the computer and only switch to an admin user when you need to (to add something new to the system, or remove something). System wide files and config can't be changed by you normally, which means that viruses and nasty little spyware programs have great difficulty messing up your computer. Once you start doing this, and get used to it, it's actually kind of nice.
I still don't see how this is actually a good thing for a home system though (by single user, I actually meant one physical user). I want to be the full-time god. :p As it stands, I can already keep out viruses and spyware effectively with a decent hardware firewall, occasional AV program runs and some common sense with browsers and email attachments. For me, the miniscule risk of getting a virus through all that is quite acceptable when compared to the alternative, which is to have to switch accounts every time I wanted to change something in a program directory or install/remove programs. I would personally find that an enormous hassle. The "DOS/9x mentality" is the superior and more efficient one for my purposes.
It can't be selectable by it's very nature. It's all or nothing. But it doesn't really have anything to do with cross-platform support, it has to do with supporting current and future Windows versions. We do it with the Linux and OS X builds because that is simply how it's done. Windows is getting to that point, and is largely there already, so we are just playing catch-up on that side.
Well, you have said several times that it's simply done that way, but not why. :p I suppose I'll have to just put up with it if you decide to put the files into Documents and Settings, but it would be one more thing I have to keep track of when transporting my FS2 stuff around, which I actually end up doing fairly often.
-
Well, you have said several times that it's simply done that way, but not why. :p
Because Linux and OS X are true multi-user OSes. Apple usability standards require it on the Mac, and Linux, being a UNIX, is where you don't/can't run as God. Normal accounts and priviledged accounts actually work differently there and programs will actually work differently based on whether you are superuser or not. So, you run as an unpriviledged user, and only switch to admin if you need to change something that you don't otherwise have access to. You'll often find Windows networks setup this way to, with each machine running as an unpriviledged user.
The problem is that Microsoft has always been behind the times here. OS X users made the switch easily (OS9 and below didn't do the same thing btw), but Microsoft has babied it's users too much and now most of them just don't know any better. Modern OSes are just too complicated to run the with the old DOS mentality of security. You can't just protect your computer from outside forces now, you need to protect it from yourself too. Doing otherwise is just stupid at this point. ... Not that I mind it too much though, I make up to $1500 a day fixing stuff like that for other people. :D
-
Honeslty... I don't care where my files are stored, as long as it makes sense. The way Windows is moving makes sense in a network or a multi-user enviornment. My only issue is that ALL operating systems are doing this. It's getting to be that essentially, all operating systems are the same, doing relatively thesame things in a variety of ways. It's like... pick your flavor. I'd like to see a version of Windows or Linux made for a single user.
Gotta love how Microsoft gave up on DOS though, huh? How's that for irony? All OSes are based on Unix now. XD Go figure. Well... except maybe some of the more obscure ones like BeOS. XD Dunno about those.
-
So, it will move to an %APPDATA% type thing
This is a (minor) pain for me with respect to the installer, but I'll make do.
-
So long as you don't throw the data in a folder in My Documents, I'm fine with wherever you decide to put it. Some of Microsoft's games have stored data there in the past, which I find to be utterly asinine. :p
In principle, though, I know I'm a Windows-only n00b, but I'm more inclined to agree with CP on this one. I just don't see how having to switch accounts to perform system-critical tasks is anything more than an annoyance. Like miskat, I'm the only person who uses my computer, and that's the way it'll be until I get rid of the thing (which is hopefully sooner rather than later, but that's another story). Having a separate Administrator account to do things like install programs or change certain settings just seems needlessly inefficient. For instance, my family has Norton Internet Security (and yes, I know how vile a piece of software it is, but at least it does what they need it to do), and I have my brother, myself, and my parents set up as administrators, in case we need to tweak it to perform a certain function. I know I'm probably violating at least ten statutes of safe computing in doing so (especially in that I don't have them password-protected...at least I managed to do that on my own machine), but sometimes you can't fight convenience. As far as I'm concerned, if I make a change to a system file that screws everything up, then I was fooling around with something I shouldn't have been with my current level of knowledge, and I deserve the consequences. :p
-
The problem is that Microsoft has always been behind the times here. OS X users made the switch easily (OS9 and below didn't do the same thing btw), but Microsoft has babied it's users too much and now most of them just don't know any better. Modern OSes are just too complicated to run the with the old DOS mentality of security. You can't just protect your computer from outside forces now, you need to protect it from yourself too. Doing otherwise is just stupid at this point. ... Not that I mind it too much though, I make up to $1500 a day fixing stuff like that for other people. :D
Well, as I described earlier, I have gotten along just fine for the last several years by not protecting anything from myself, so it can't be all that "stupid." :p (besides, it can't exactly be protection when you can still go into the administrator account and mess with things as you please)
Now that I think about it though, since this is a post-3.6.9 thing, it would be at least several months away and my campaign should be finished by then, so this would be less of an issue for me at that point. (the main reason I need to transport the files around is to update my progress and test files with that)
So long as you don't throw the data in a folder in My Documents, I'm fine with wherever you decide to put it. Some of Microsoft's games have stored data there in the past, which I find to be utterly asinine. :p
I have at least 10 games that store their stuff in there. It's a fairly common location, unfortunately.
-
I understand now. How dare a dumbass plebe like me profess to know what I want? I'm glad there are programmers who know better what's good for me. WHEW! What a relief! I feel so safe now!
-
I understand now. How dare a dumbass plebe like me profess to know what I want? I'm glad there are programmers who know better what's good for me. WHEW! What a relief! I feel so safe now!
:lol:
It's not what you want, or even what we want, it's simply how the OSes are designed now. And we have to keep up with it all so that the game will still be working in another 5 years. I mean, if you don't want to have the %APPDATA% thing, then stop using newer builds. No one here is going to stop you from that. It will be next summer at the earliest before the switch is made anyway.
If you have a problem with it then complain to Microsoft, not us.
-
Now that I think about it though, since this is a post-3.6.9 thing, it would be at least several months away and my campaign should be finished by then, so this would be less of an issue for me at that point. (the main reason I need to transport the files around is to update my progress and test files with that)
Bear in mind that the only thing that would have to be in %appdata% are the pilot files. You can simply carry on using the main folder for everything else.
-
Don't get me wrong taylor, my comments are in no way directed to anyone here, I'm just grousing about the situation at large. I fully realize there's nothing you can do about it.
Peace,
Huggybaby
-
if only youre registry settings are bing stored in this file i really dont see a big deal with it. i too have the old dos mentality, hell ive been uisng it a long time. but the settings beign sotred are basic system specific stuff. if you move the game from one computer to another your gonna wanna go through those settings again and set them up for that machine. it may have a different video card or a different native res on the monitor or a different refresh. as for pilot files i really dont care, my pilot has been an ensign for the past 4 years. every time a new build comes out i clone it and toss the original anyway, just to keep my controls config and make sure i dont have any pilot related problems.
i have an aversion twards putting actual data files in my windows docs and settings folder, and perfer to keep them on a seprate drive partition. though this is more a problem with how windows uses those directories than anything else. theres only a couple programs that store settings in that folder that i give a damn about, photoshop being one of them. so when its time to do the os wipe (and with windows you gotta do this alot) its easy to copy the few settings i want to keep over to the data prtition beofe running a format on that drive. problem with windows is that alot of programs dont all follow the same set of rules, while for linux you dont have much of a choice if you want your program to run. there are some brains behind the linux way, i just hope microsoft watches and learns.