Skip to content

Custom user folder by command-line parameter: Incomplete implementation

LaputianBirdLaputianBird Member Posts: 107
edited March 2018 in General Discussions NWN:EE
I have this insane belief that a location named "My Documents" should be meant for *my* *documents*, not for some game assets or whatever else Windows encourages developers to use it for. While I patiently wait for Microsoft to listen to reason and change the approach on a world-wide level across their products, I've been using the excellent alternative option that Beamdog has provided us though command-line parameter to specify a custom user folder.

Both the game and the toolset support the parameter, but there is an oversight in the toolset implementation: if you use F9 to quickly test the module you're working on in the toolset, the game is launched without the custom folder parameter, and defaults to looking for your module and related resources in the My Documents folder.

To fix it, the toolset should store the user folder as a variable and apply it when calling the game executable from inside the toolset itself. Or some other solution to the same effect.

Pretty please? Without this fix using a custom user folder is almost useless

[edit] I'm not sure if this should be labeled as a feature request or a bug fix, and if it should go on the trello tickets discussion board, but here it is. Feel free to move it else where if necessary

Comments

  • SherincallSherincall Member Posts: 387
    As a workaround, you should be able to create a shortcut in "c:\users\xxx\Documents\Neverwinter Nights" and point it to your real primary user directory. You'll still have the entry polluting your documents folder, but at least you can keep the files where you want them.
  • LaputianBirdLaputianBird Member Posts: 107

    As a workaround, you should be able to create a shortcut in "c:\users\xxx\Documents\Neverwinter Nights" and point it to your real primary user directory. You'll still have the entry polluting your documents folder, but at least you can keep the files where you want them.

    True, just asking for a long-term clean solution, as it looks like it was a simple oversight when implementing the command-line feature
  • PlokPlok Member Posts: 106
    While I agree that the toolset should respect the directories you give it in all circumstances, I just want to comment on your "My Documents for My Documents" schtick.

    There's good reasons why developers do this. From Windows Vista onwards Microsoft really tightened up security on who is allowed to write to certain directory. If you want to write to a folder like Program Files you need to be an Admin (or go through those annoying UAC popups).

    IIRC the "correct" place for developers to put all their program junk is in C:\Users\$user_name\AppData\ but few people actually use it because it's hidden by default and not available from the various Libraries like Documents. On top of that, most people nowadays access their User directories via Libraries and never actually see the root user folder - if you want your files to be messed with you pretty much have to put them in My Documents, My Pictures, My Videos or My Music. A lot of game developers have adopted a gentlemen's agreement to use My Documents\My Games to deal with the problems you're having.

    No matter what, you definitely want to be writing into C:\Users\$user_name\. It gives you the ability to have different users with different configurations for free. It's also standard practice in the Linux world to have your /home/ directory (Unix-derived OS version of C:\Users) to be on a different hard drive/partition so you can just nuke your OS install at any time with no consequences (most distros make it stupid easy to do this when you install Linux on your PC). I personally mount my /home/ to a RAID mirrored array of hard drives so I don't have to worry too much about hard drive failure. Unfortunately Windows - being the redheaded stepchild of the OS world - makes it really, really hard to do this. :(

    As a workaround, you should be able to create a shortcut in "c:\users\xxx\Documents\Neverwinter Nights" and point it to your real primary user directory. You'll still have the entry polluting your documents folder, but at least you can keep the files where you want them.

    You'll want a symbolic link rather than a shortcut. In Windows a shortcut is a special .lnk file that most programs don't really know how to deal with (programs accessing My Documents\foo won't see the shortcut because its actual file path is My Documents\foo.lnk). A symbolic link appears as a normal folder to any program that doesn't explicitly interogate it.

    You can create symbolic links in Windows from Vista onwards but it's hidden in cmd and requires admin privelidges (WHY!?). I personally use Link Shell Extension to do it from the GUI via right click.

    Dunno how to do them on Mac OS X (I've never liked OS X - do I Cmd C or CTRL C in this particular program to Copy and Paste?), but it's as simple as right clicking on most Linux GUIs.
  • LaputianBirdLaputianBird Member Posts: 107
    Plok said:

    While I agree that the toolset should respect the directories you give it in all circumstances, I just want to comment on your "My Documents for My Documents" schtick.

    There's good reasons why developers do this. From Windows Vista onwards Microsoft really tightened up security on who is allowed to write to certain directory. If you want to write to a folder like Program Files you need to be an Admin (or go through those annoying UAC popups).

    I'm fully aware of this, that is why I wrote:

    While I patiently wait for Microsoft to listen to reason

    I'm clearly not blaming Beamdog for it, and my tone regarding Microsoft changing their global policy is clearly in jest.
  • raz651raz651 Member Posts: 175
    What version of windows are you using? In windows 10 it is just called "Documents" now.
  • LaputianBirdLaputianBird Member Posts: 107
    raz651 said:

    What version of windows are you using? In windows 10 it is just called "Documents" now.

    Windows 7ish. Is this relevant? The original post is not a request for help with finding a workaround, which I can handle in multiple ways, it's about pointing out an oversight in the implementation and requesting a fix.
  • SherincallSherincall Member Posts: 387
    I'd say this belongs on redmine as a regular bug.
  • raz651raz651 Member Posts: 175

    raz651 said:

    What version of windows are you using? In windows 10 it is just called "Documents" now.

    Windows 7ish. Is this relevant? The original post is not a request for help with finding a workaround, which I can handle in multiple ways, it's about pointing out an oversight in the implementation and requesting a fix.
    I was just pointing out that Microsoft no longer calls it "My Documents" in Windows 10. It is just called Documents. Microsoft is doing away with Win 7.
  • shadguyshadguy Member Posts: 154
    I filed a possibly related RedMine ticket here 3 months or so ago: https://support.baldursgate.com/issues/34175#change-211147

    At this point, I'm not sure if I was seeing a real bug or if I was just expecting behavior more like what you have requested.

    -Dave
  • LaputianBirdLaputianBird Member Posts: 107
    Could be. What happens is that when F9-launched from the toolset, the game expects the user folder to be in My Documents, and if it's missing, it creates it on the fly, with a new ini file set to the default values, and unable to find the module to load for the quick testing
  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 22,724
    Let's focus on this issue in the Redmine ticket @shadguy links. Everyone - feel free to add your ideas there. If the team then decide it's more than a Redmine ticket and has to get a Trello card, it'll be arranged.
Sign In or Register to comment.