Re: [email] [GD-General] RE: A portable preferences library
Brought to you by:
vexxed72
From: Dan T. <da...@ar...> - 2003-12-04 23:38:33
|
> Because when push comes to shove, Windows is *still* just DOS - it still > requires a PATH environment variable of ";" seperated directory names to > search - in fact, with the latest versions of Windows, Microsoft is > disparaging the idea of putting your DLL's into the system directory, but > they don't give adequate documentation or support of the API's required to > insert directories into the search path. Hmm.. Sooo.. you can't do something like LoadLibrary(MyExeLocation + \\MyLibrary.dll); ?? > Putting DLL's next to the application that Joe User has to "click to start" > makes them a candidate for Joe Jr to trash them (actually, its more likely > the reverse). Only if he's an admin(which is the root of so many problems..), and if he is, he can screw up many more things. > There *are* registry tricks you can do to auto-force directories into the > search path, but then there are known bugs where if the path gets too long, > it all goes *poof*. > > I believe that Application Manifests give you scope to have explicit path > specs, but that means you need to *write* those at install time and that > precludes moving things around. Maybe its my primarily windows upbringing, but I still don't see how that affects anything when your library is in your executable path. > Actually you *can't* have many independent instances of an application if > you are going to respond to double-clicks on a document. This is the part > that I feel hasn't been picked up on by developers, and I think its probably > because no-one wants to admit that Apple's *LISA* did these things better > than anyone else. Documents, and Document Templates are whats important, > not applications. > > Why not have your preferences as the main *ICON* (ie, file) you click to to > enter your game? Feel free to stick it where you like, copy it around if > you like, but understand that its your config. That's a fun idea, there. For the adventurous type, you could use the hash that email uses for binary attachments and shove it all into a human readable xml file. Could get big, though...(MD5, I think?). Might be fun to try out in someone's small puzzle type game. oo, oo... if you wanted real fun you could Zip the xml, so humans who wanted to read it would just WinZip it and life would be good. Hmmmm.. > For a better user experience, you should do the same with Save Games, and > they should have a soft-pointer internally to the preferences document so > that you can restore the users state when they click on this DOCUMENT. That, or shove it into the XML file as above. > Of course, on Windows, this means needing unique file types (since thats how > the registry maps files to apps), but on MacOS it works beautifully. Better go look up how MacOS works... > The truly innovative could, however, write a tiny app that functioned as a > LAUNCHER, that stored the preferences back into itself as resources, and > passed values on perhaps through environment variables, a command-line > option or a temporary file. That'd be a fun SourceForge project I bet. > (But, of course, it makes Brian's life a helluva lot harder to write a > generic prefs class ;-) Poor Brian. He raises the Noble Cause of a generic preferences class, and we go off on all sorts of random stuff. -Dan |