Today I had the fun experience of dealing with Windows, and the also-fun experience of dealing with poorly-written Windows programs.
The reason for this, and the reason I didn’t just say “not my problem” and give up, was that I wanted to play Baldur’s Gate II. Specifically, I wanted to play it multiplayer, and my dad only lets my siblings use his computer under a limited account (the right thing to do), so I had to find a way to make it play. Installing could be done under an admin account, of course, but playing had to be done under a limited.
This is where the poorly-written bit became a problem. You see, Baldur’s Gate II, like about 97% of windows programs, violates the standards of what things go where in windows. This of course was not a surprise to me, just an annoyance. So I was determined to find a way around it.
The first, most obvious problem, was that it needed to write to files in the program files directory (like, e.g., save files. They’re not supposed to go there! They’re supposed to go in the Application Data folder in the user’s account! I’m not even a windows
developer and I know that!), which limited accounts aren’t allowed to do. Easy fix: Change the permissions on all those files to let anyone write to them. Roadblock to the easy fix: XP home doesn’t have the advanced security tab that lets you control the access control lists. Doh. So with about 10 minutes searching online, I finally found out about the
cacls command, which can be run from the command line even in home edition. I got the funness of finding out by trial and error that without the
/E switch, it will remove the entire list when you do
/P, even though it says it’ll “replace the user’s” permissions. Luckily I’d listed them all out before and still had them on screen. Final command for that:
cd installdir; cacls "BGII - SoA" /T /E /P Users:F
Then, it still didn’t run. When you started up the game in the limited account, it still, for some reason, thought it needed to be installed. I had thought (from reading support things on the official website) that making baldur.ini writable would fix that, but I was wrong. So: It must be a registry issue. Long story short, because I’m getting tired of writing about Windows: It was. /HKLM/SOFTWARE/Microsoft/Currentversion/App Paths/BG2Main.exe was readable by the limited user, but apparently, no, it needed to be writable as well, because the programmers were stupid and used the wrong registry call. (Thanks to regmon for helping me find that out). Fix: go in as admin, right click on that key, and there’s some properties that let you make it writable by all. Problem fixed, everything works now.
This all is just one of the many reasons I hate windows.