Jump to content
  • 0

Way to find Mod Organizer's installation directory


Question

Posted (edited)

Hello, this is a programming related question.

I'm looking to finding a way to automatically detect Mod Organizer's installation directory.  Normally applications will create registry keys that note where they have been installed, but for my searching in my registry using RegEdit I wasn't able to find any keys that could be consistently used to determine Mod Organizer's directory.

To be clear, I'm looking for a way to determine Mod Organizer's installation directory from within an xEdit script.  My current approach is just a brute force approach of searching for ModOrganizer.exe in all subfolders in Program Files and Program Files (x86) on all valid hard disks.  I would like to have a better way of finding it, but I'm not sure exactly how to do so.  I know that Mod Organizer enhances the data directory using it's virtual directory structure.  Is there any way to determine that this has occurred from within xEdit, and then determine Mod Organizer's installation directory?

I'm working in Delphi and have the power to search directories, read registry keys, open files/folders, etc.  I want a better solution than my current solution, but I also don't want to search entire hard drives (because that will take forever).  Does anyone (e.g. Tanin) know of a way that I can go about achieving this?

 

Regards,
-Mator

Edited by Mator

5 answers to this question

Recommended Posts

  • 0
Posted

The only way would lead through finding the mechanism defaulting to open nxm (Nexus) links at HKEY_CURRENT_USER\Software\Classes\nxm\shell\open\command which should direct itself to something like "C:\Steam\SteamApps\common\skyrim\Mod Organizer\nxmhandler.exe" "%1"

 

From there, if the user has more than one Mod Organizer install, you would have to make it read the corresponding nxmhandler.ini to find the correct Mod Organizer installation for the game you want. Example of my nxmhandler.ini

 

 

 

[handlers]
size=2
1\games=falloutnv
1\executable=C:\\Steam\\SteamApps\\common\\Fallout New Vegas\\Mod Organizer\\ModOrganizer.exe
2\games=skyrim
2\executable=C:\\Steam\\SteamApps\\common\\skyrim\\Mod Organizer\\ModOrganizer.exe
3\games=oblivion
3\executable=C:\\Steam\\SteamApps\\common\\Oblivion\\ModOrganizer\\ModOrganizer.exe

 

  • 0
Posted

I take it the reason you are wanting this is related to this post.

 

Might I suggest you tackle it another way. When the script is run perhaps you could provide the user with a file/folder selector dialog, perhaps one that maintains the result for later executions, and then the user could point to the desired folder. That way you avoid needless code searching for the folder and it would always be accurate even in extreme installation cases. (Assuming the user inputs the correct folder.)

  • 0
Posted

The only way would lead through finding the mechanism defaulting to open nxm (Nexus) links at HKEY_CURRENT_USER\Software\Classes\nxm\shell\open\command which should direct itself to something like "C:\Steam\SteamApps\common\skyrim\Mod Organizer\nxmhandler.exe" "%1"

 

From there, if the user has more than one Mod Organizer install, you would have to make it read the corresponding nxmhandler.ini to find the correct Mod Organizer installation for the game you want. Example of my nxmhandler.ini

 

 

 

[handlers]

size=2

1\games=falloutnv

1\executable=C:\\Steam\\SteamApps\\common\\Fallout New Vegas\\Mod Organizer\\ModOrganizer.exe

2\games=skyrim

2\executable=C:\\Steam\\SteamApps\\common\\skyrim\\Mod Organizer\\ModOrganizer.exe

3\games=oblivion

3\executable=C:\\Steam\\SteamApps\\common\\Oblivion\\ModOrganizer\\ModOrganizer.exe

 

I noticed the *.nxm registry keys on one of my passes through the registry.  Thanks for the elaboration though.  I think this could work if I still want to pursue this.

 

I take it the reason you are wanting this is related to this post.

 

Might I suggest you tackle it another way. When the script is run perhaps you could provide the user with a file/folder selector dialog, perhaps one that maintains the result for later executions, and then the user could point to the desired folder. That way you avoid needless code searching for the folder and it would always be accurate even in extreme installation cases. (Assuming the user inputs the correct folder.)

Hi Grant, thanks for the reply.  It is partly related to that post, but I was pursuing it prior to that post.

 

I do actually provide the user with a file/folder selection dialog which retains the result for later executions, which the user can use to point to the desired folder.  In addition to this I do have a "detect" button, which currently attempts to find Mod Organizer at some common installation directories.  I just like to take the approach of doing as much for my users as I can.  If there is a way I can find Mod Organizer's directory for them I'd like to, so as to avoid the possibility of them misunderstanding the way the script works and entering things incorrectly.

 

Based on the current posts, however, I think it's best just to search a few more common directories (e.g. Skyrim folder) for ModOrganizer.exe, and leave it at that.  If the user doesn't have Mod Organizer installed in any of the common locations they'll just have to use the DirectorySelect dialog to tell the script where it is.

 

 

Cheers,

-Mator

  • 0
Posted

 

...Based on the current posts, however, I think it's best just to search a few more common directories (e.g. Skyrim folder) for ModOrganizer.exe, and leave it at that.  If the user doesn't have Mod Organizer installed in any of the common locations they'll just have to use the DirectorySelect dialog to tell the script where it is...

 

Yes, that is the best approach. As @DoubleYou pointed out, MO doesn't set any registry settings aside from the one for the 'nxm' handler and that is for only one of many possible MO installations, so that would be more effort than it is worth.

 

I'm eagerly looking forward to your releases, been following them for sometime now.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.