Author Topic: How weidu determine "My Documents" location at Windows OS?  (Read 4096 times)

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
How weidu determine "My Documents" location at Windows OS?
« on: September 27, 2014, 12:42:16 PM »
Hello,
How weidu determine "My Documents" location at Windows OS? I'm assuming that it uses environment variable called %HOME%, right?

EDIT: I'm looking at the doc and see: http://www.weidu.org/~thebigg/README-WeiDU.html#htoc56
Quote
SAVE_DIRECTORY evaluates to the directory in which the current game type stores its saved games. This is "./save" on non-BG: EE games. On Windows BG: EE games this is "%PATH%\Baldur’s Gate - Enhanced Edition\save", where PATH is the user’s personal directory as read from the Windows registry. On OS X BG: EE games this is "$HOME/Documents/Baldur’s Gate - Enhanced Edition/save", where HOME is the user’s home directory, as retrieved by uid from the user database. On Windows BGII: EE games this is "%PATH%\Baldur’s Gate II - Enhanced Edition\save" and on OS X BGII: EE games, this is "$HOME/Documents/Baldur’s Gate II - Enhanced Edition/save".

MPSAVE_DIRECTORY evaluates to the directory in which the current game type stores its multiplayer saved games. The determination is done the same way as with the save directory, but for the directory mpsave instead.

USER_DIRECTORY evaluates to the directory in which user files are kept. This is the game path on non-BG: EE games. On Windows BG: EE games this is "%PATH%\Baldur’s Gate - Enhanced Edition". On OS X BG: EE games this is "$HOME/Documents/Baldur’s Gate - Enhanced Edition". On Windows BGII: EE games this is "%PATH%\Baldur’s Gate II - Enhanced Edition". On OS X BGII: EE games this is "$HOME/Documents/Baldur’s Gate II - Enhanced Edition".

What value %PATH% has when WeiDU get it?
« Last Edit: September 27, 2014, 12:53:01 PM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: How weidu determine "My Documents" location at Windows OS?
« Reply #1 on: September 27, 2014, 01:02:22 PM »
I don't know. It depends on what it says in the registry. WeiDU reads whatever is called "Personal" at HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", expands the result and uses that.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
Re: How weidu determine "My Documents" location at Windows OS?
« Reply #2 on: September 27, 2014, 01:12:03 PM »
I'm using Windows 8.1, full admin rights, UAC and AV off. My "Personal" folder is set to "D:\Dokumenty" And i'm getting this:

Code: [Select]
BACKUP ~1/backup~
AUTHOR ~1~

BEGIN "1"
MKDIR ~%USER_DIRECTORY%/1~
Quote
Install Component [1]?
nstall, or [N]ot Install or [Q]uit?
Installing [1]
Creating 1 directory
Problem Unix.Unix_error(1, "mkdir", "D:") on D:: util.ml

but the folder is created so why error and why "D:"?
« Last Edit: September 27, 2014, 01:13:56 PM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline The Imp

  • Planewalker
  • *****
  • Posts: 288
  • Gender: Male
Re: How weidu determine "My Documents" location at Windows OS?
« Reply #3 on: September 27, 2014, 01:56:23 PM »
:great whistle:
« Last Edit: September 27, 2014, 05:02:08 PM by The Imp »

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
Re: How weidu determine "My Documents" location at Windows OS?
« Reply #4 on: September 27, 2014, 02:17:40 PM »
MKDIR is a regular WeiDU action.

I'm getting the same error message on my system (Windows 7). Executing this script:
Code: [Select]
BACKUP ~test/backup~
AUTHOR ~Argent77~

BEGIN ~Test component~
  PRINT ~My documents folder is "%USER_DIRECTORY%".~
  MKDIR  ~%USER_DIRECTORY%/1~
produces the following result:
Quote
[D:\Games\Baldur's Gate II Enhanced Edition\Data\00783\setup-test.exe] WeiDU version 23600

Using lang\en_us/dialog.tlk

Install Component [Test component]?
nstall, or [N]ot Install or [Q]uit? i

Installing [Test component]

My documents folder is "C:\Users\argent77\Documents/Baldur's Gate II - Enhanced Edition".
Creating 1 directory
Problem Unix.Unix_error(1, "mkdir", "C:") on C:: util.ml



SUCCESSFULLY INSTALLED      Test component

Press ENTER to exit.

The folder has been created however, and the mod appears to be installed successfully.

Edit: Only access to drive C: (regardless of path) is affected on my system. MKDIR works fine on all of my other drives. Correction: After further testing it looks like the error message is displayed whenever the path is pointing to a drive that is different from the game's path. For example, paths pointing to drive C: or E: are causing errors if setup-xxx.exe is executed somewhere on drive D:.
« Last Edit: September 27, 2014, 03:12:04 PM by Argent77 »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: How weidu determine "My Documents" location at Windows OS?
« Reply #5 on: September 27, 2014, 02:20:50 PM »
I'll look into the error. The error code should mean "permission denied", whatever that's supposed to mean.

Can't reproduce. FWIW, Win 7, UAC on, regular account, WeiDU is not running elevated (through the use of the manifest file included in the Windows download), Documents folder is on D:, though I don't remember what method I used to move it.
« Last Edit: September 27, 2014, 02:36:59 PM by Wisp »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: How weidu determine "My Documents" location at Windows OS?
« Reply #6 on: October 05, 2014, 08:26:50 AM »
Okay, I can reproduce this if I run setup-mymod.exe elevated, but not otherwise. I'm not going to do anything about it because it appears to be harmless, involve Windows stupidity, I don't know what, if anything, I can do about it, and I'm more interesting in fixing the usage pattern instead.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
Re: How weidu determine "My Documents" location at Windows OS?
« Reply #7 on: October 05, 2014, 09:04:36 AM »
Documents folder is on D:\
If you someway use HOME environment variable, on Windows OS it is a drive letter of the "Personal" folder (D:\ in our case) , not the full path. But since this minor warring is harmless, It's ok.
« Last Edit: October 05, 2014, 09:08:59 AM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: