Page 1 of 1

FNVEdit: "Fatal: Could not find ini" bug

PostPosted: Tue Jun 03, 2014 12:23 pm
by Prisca Lacour

FNVEdit 3.0.31: "Fatal: Could not find ini" bug

Language: This article uses English Core Diction as defined in the Oxford English Dictionary current at the time of writing in accordance with standard grammar and punctuation (e.g. with square braces denoting text which is not literally part of a quote or intended entry but is present as a guide to what is intended, in context, or what is to be entered in place of the square braces and the text they contain).

Synopsis

Although FNVEdit reaches a large user base as a remarkably reliable and extremely important modding tool, there is an ongoing issue requiring documentation, which is the purpose of this thread. This ongoing issue arises when the "Fatal: Could not find ini" error is incorrectly raised on properly functioning systems where the ini file, in question, is alive and well and being serviced by the game launcher. The nature of this problem, as a bug in FNVEdit, is confirmed and identified by anolysis of an error description raised by FNVEdit in the context of applicable registry entries, log files and documentation associated with Steam and Fallout: New Vegas. The current, although little known, workaround is to append a command line parameter pointing to the location of the Fallout.ini file when launching FNVEdit (TES5Edit Readme.txt, line 112; this is the file which ships with the current version of FNVEdit).

Problem Description:

When FNVEdit is run without any command line parameters, on my system for example, the following error is raised:

Based on the text of this error description, FNVEdit looks in the registered application directory and navigates to the "Data" subdirectory to find the plug-in files used by the game. Then, it seems that FNVEDit looks in the registered local application data directory and attempts to navigate to the "My Games\FalloutNV\" subdirectory to find the Fallout.ini file - which is, evidently, not always placed in this location by the game launcher (FalloutNVLauncher.exe).

Context:

This problem seems to be confined to systems designed for multiple users sharing the same documents and corresponding Documents directory. To reproduce this problem on a clean system:

  1. Open the main Windows Menu
  2. Open the Context Menu for the "My Documents" menu item (whichever appears depending on which version of Windows you install)
  3. Select the "Properties" item from the Context Menu
  4. Open the "Location" tab
  5. Enter an alternative path for the "My Documents" directory, preferably outside the "Users" directory if this location is to be shared by multiple users on the same system
  6. Click the "OK" button and let Windows make the required adjustments to the file system.
  7. Install Fallout: New Vegas and the GECK
  8. Run Fallout: New Vegas to make sure localisation is set up
  9. Install FNVEdit and run

This will reproduce the error described above without corrupting or otherwise damaging or invalidating any of the system settings.

Current Workaround:

The documentation for the current workaround (TES5Edit Readme.txt, line 112) is a little too vague to be useful and, thanks to the efforts of Sharlikran (http://forums.nexusmods.com/index.php?/topic/248639-fnvedit/?p=15199118) we have the necessary details. When starting FNVEdit from the command line:

FNVEdit.exe -I:"[full path to Documents directory]my games\FalloutNV\my.ini"

In my case, the path to my "Personal", "Documents" or "My Documents" folder is simply "D:\" and, so, the corresponding working command line entry is:

FNVEdit.exe -I:"D:\my games\FalloutNV\my.ini"

As most modern users do not use old fashioned DOS-styled commands, it is probably a good idea to update the shortcut which points to FNVEdit accordingly:

"[Full path to FNVEdit.exe, inclusive, goes here]" -I: "[Full path to Fallout.ini, inclusive, goes here]"

In my case, the shortcut in question was modified

from:"C:\Program Files (x86)\Steam\SteamApps\common\fallout new vegas\Data\FNVEdit.exe"To:"C:\Program Files (x86)\Steam\SteamApps\common\fallout new vegas\Data\FNVEdit.exe" -I: "D:\My Games\FalloutNV\Fallout.ini"

Introduction: A Brief History of ini files accused of going absent without leave.

The raising of the "Fatal: Could not find ini" error, under circumstances requiring support, is not a unique occurrence and has been reported a number of times:

http://forums.nexusmods.com/index.php?/topic/415552-nvedit-fatal-could-not-find-ini/

http://www.gamesas.com/topic/1341861-fo3masterupdate-problem-fatal-could-not-find-ini/

http://www.nexusmods.com/skyrim/ajax/comments/?pUp=1&page=1&sort=DESC&thread_id=739586&news_id=9957

http://forums.nexusmods.com/index.php?/topic/248639-fnvedit/page-79#entry8207021

The last entry on this list reads:

The response to this user query was as follows

Aside from the extremely offensive nature of suggesting a catch-22 in place of a real solution, it seems to me that this response indicates the necessity of ensuring that more detail concerning this problem and the method of solving it remains in the public domain so that the workaround can be found and so that future maintainers of FNVEdit's source code can find the faulty registry functions more easily.

anolysis

According to the documentation for Fallout: New Vegas, specifically, the latest Readme.txt in the application directory (Line 25; Section 1, under "-Saved Games"):

This is further reinforced by the wording of Steam log entries which invoke "Rule 0". For example, from my system, there is the file located in:

C:\Program Files (x86)\Steam\logs\cloud_log.previous.txt wherein line 265 reads:

That evaluates, in my case, to "D:\" & "My Games/FalloutNV/Saves" = "D:\My Games\FalloutNV\Saves\" as a file system address. It follows that the Fallout.ini file, which is always in the parent directory to the saves directory, is found under

WinMyDocuments & "My Games\FalloutNV\"

Which is "D:\My Games\FalloutNV\" in my case.

However, FNVEdit does not look, for the Fallout.ini file, in the registered "My Documents" directory of the user's system and, consequently, does not look in the same place as the official game launcher (FalloutNVLauncher.exe). Given that it is up to the developers of Fallout: New Vegas to decide where to locate their localisation files and it is clearly up to the user to decide where to locate their "My Documents" directory, errors raised by any third party program as a consequence of failure to follow the same localisation paths constitute a bug. There can be no negotiation on this matter because of the simple fact that it is not the call of any third party developer to dictate either of these options.

Verification

The above anolysis produces two specific hypotheses which require testing before they can be established as fact.

Firstly: I disabled the workaround applied to FNVEdit to verify that the bug was still active. The corresponding entry from the FNVEdit_log.txt is as follows:

I then removed the Fallout.ini file from the directory which documentation indicates is used by the game launcher (FalloutNVLauncher.exe). Running the game launcher generated a new default copy of the Fallout.ini file, not in the directory searched by FNVEdit, but in the "My Games\FalloutNV\" subdirectory under the "My Documents" directory on my system (registered as "D:\" and resolving to "D:\My Games\FalloutNV\"). To further test this, I opened the Windows registry (with the necessary administrator privileges) and moved the "My Documents" directory from "D:\" to "E:\Delete-Me-After_2014-0604\Peek-a-Boo" and manually created the "Delete-Me-After_2014-0604\Peek-a-Boo" directory on E:\ partition. When I ran the game launcher (FalloutNVLauncher.exe) it created the subdirectory "My Games\FalloutNV\" under "E:\Delete-Me-After_2014-0604\Peek-a-Boo" to create the Fallout.ini file in the "E:\Delete-Me-After_2014-0604\Peek-a-BooMy Games\FalloutNV\" directory. It is, thus, established as fact that the game launcher (FalloutNVLauncher.exe) looks in ["My Documents" path]My Games\FalloutNV\ for the Fallout.ini file.

Secondly: While the workaround, applied to FNVEdit, was disabled I opened the Windows registry (with the necessary administrator privileges) and moved the local application data directory from "%USERPROFILE%\AppData\Local" to "D:\Delete-Me-After_2014-0604\Peek-a-Boo". I then ran FNVEdit with the corresponding entry from the FNVEdit_log.txt is as follows:

This establishes as fact that FNVEdit interrogates the registered location for local application data when searching for the Fallout.ini file - which, as can be seen, is different from where the game launcher (FalloutNVLauncher.exe) searches for this file.

Suggested Solution

The same registry key is used by both FNVEdit and the game launcher (FalloutNVLauncher.exe), however the problem arises because FNVEdit does not refer to the same registry string, under this key, as does the game launcher (FalloutNVLauncher.exe). While the registry key used by both applications is as follows:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

the game launcher (FalloutNVLauncher.exe) uses the "Personal" registry string, stored under this key, to identify the parent directory to "My Games\FalloutNV\Fallout.ini" whereas FNVEdit erroneously uses the "Local AppData" registry string, stored under this same key, to identify the parent directory to "My Games\FalloutNV\Fallout.ini".

The solution is surprisingly simple and easy. The source code need only be searched for the keyword, "Local AppData" which must be replaced with the keyword "Personal" in the context of all FNVEdit operations. Furthermore, I strongly advise applying similar tests to other game launchers in both the Fallout series and TES series to determine if all launchers refer to the same registry string when searching for or creating "My Games\FalloutNV\Fallout.ini" and update the FNVEdit function (which reads the User Shell Folders key) under other executable naming conditions, accordingly.

Conclusion

It is a fact, established by the testing reported in this post, that FNVEdit and the corresponding game launcher (FalloutNVLauncher.exe) use different registry strings in the User Shell Folders key to locate "My Games\FalloutNV\Fallout.ini" and, as a consequence, FNVEdit does not always look in the same location as the game launcher (FalloutNVLauncher.exe) for the Fallout.ini file. Given the most reasonable intention of locating the Fallout.ini file wherever the game launcher (FalloutNVLauncher.exe) might place it, it is obvious that FNVEdit does not function as originally intended when locating the file in question. As such, this constitutes a bug which has a long history and, being easily bypassed using a duplicate of the Fallout.ini file, it is probably not reported nearly as often as it is encountered. It is the intention of the author to ensure that this bug remains publicly documented for the benefit of users and so that maintainers of the source code for FNVEdit may, at some stage in the future, more readily track down the erroneous registry string names used in the code.

[EDIT]Formating inconsistency[/EDIT]