ModPlug Central

OpenMPT Development (Archive) => Feature Requests => Feature Request Archive => Topic started by: Harbinger on March 09, 2010, 16:23:41

Title: Recognizing openable files by MPT
Post by: Harbinger on March 09, 2010, 16:23:41
I can't get Windows XP to allow MPT to be an "opening" program. That is, when i "Open with" for example an .it file, Windows will not allow me to choose mptrack.exe as a valid application. Is there something that can be done about this? :?
Title: Re: (S=O) Recognizing openable files by MPT
Post by: LPChip on March 09, 2010, 16:27:30
Quote from: "Harbinger"I can't get Windows XP to allow MPT to be an "opening" program. That is, when i "Open with" for example an .it file, Windows will not allow me to choose mptrack.exe as a valid application. Is there something that can be done about this? :?

Can't you select: the program is not listed, and I want to select it myself?

If you did that once before and it is now gone, then there's a corruption in your registry. The program is in your registry, but most likely the path changed and thus windows decide to not show it. When adding it back again though, windows says: hey, its already there, so lets not add it twice.

By manually removing it from the registry, it should work again. If this is the case, I can look the registry location up for you.
Title: Recognizing openable files by MPT
Post by: Harbinger on March 09, 2010, 16:41:04
Great! What file am i looking for? Or should i do an index search for characters in files in a certain folder?
Title: Recognizing openable files by MPT
Post by: Saga Musix on March 09, 2010, 16:45:06
Actually, the "known programs" list is quite random, and programs might randomly disappear from the list, there's nothing wrong with that.
Can you probably provide a screenshot of this? I'm not sure what you mean with "Windows doesn't allow (...)".
Title: Recognizing openable files by MPT
Post by: LPChip on March 09, 2010, 17:21:27
Quote from: "Harbinger"Great! What file am i looking for? Or should i do an index search for characters in files in a certain folder?

Doubleclick on the file you want to open with OpenMPT, then browse to the exe: mptrack.exe
Title: Recognizing openable files by MPT
Post by: Harbinger on March 09, 2010, 17:28:03
That's already been covered. If you choose "Open with" from the contextual menu of an unrecognized file (such as an .it track), you are allowed to select the list of programs to open it with. Well, MPT doesn't show up, so you can click on the button to Browse and find the application. I find mptrack.exe, open it so it will be recognized, but it doesn't get added to the list.

That's what i want to change...
Title: Recognizing openable files by MPT
Post by: uncloned on March 09, 2010, 17:31:56
are you checking the check box that says "always use this program....?"
Title: Recognizing openable files by MPT
Post by: Saga Musix on March 09, 2010, 17:35:25
Harbinger: I think that only programs that reside in C:\Program Files\ are added to this list (just in case you have your OpenMPT somewhere else...)
Title: Recognizing openable files by MPT
Post by: Harbinger on March 09, 2010, 17:41:16
No, it's in that folder....

Let's get back to the registry idea. I know very little about Windows' registry files or what it's used for. But i HAVE moved the main application from the original folder (actually when 1.18 came out, i moved the "OpenMPT" folder out of C/Program Files, and kept ModPlug in the "MPT 1.18" folder), but i can't believe that would make Windows think it's not a valid program.

This has also happened with a couple of other executables i have as well...
Title: Recognizing openable files by MPT
Post by: Saga Musix on March 09, 2010, 17:46:09
Well, since WinXP the whole file association stuff just got a lot more complicated and frustrating, since they wanted to make it easier for the occasional user... I guess you could wait for the OpenMPT installer since it will also be able to change file associations.
Title: Recognizing openable files by MPT
Post by: Sam_Zen on March 10, 2010, 01:38:13
Quote..only programs that reside in C:\Program Files\ are added to this list
(Running XP) This is not correct. With some extensions I have quite a big "Open with.." list of applications,
and about 75 % of them are not installed in C:\Program Files\.

It appeared that I had the .it format only directly ('enter' on icon) associated with MPPlayer for a quick listen,
so this was a good test to add mptrack.exe to the  "Open with.." list.
No problem. After the first time, it re-appeared in the list (even while not enabling "always use this program..").

Quote from: "Jojo"I'm not sure what you mean with "Windows doesn't allow (...)".
I wondered about that too. You couldn't start mptrack.exe after a OK ? Some error message ?

If this problem is hard to solve, you could consider using Total Commander, because it has an option to set its own
internal associations, next to those of windows.

But I go along with the intuition about a crippled registry. Because :
Quotei moved the "OpenMPT" folder out of C/Program Files, and kept ModPlug in the "MPT 1.18" folder
If you install a program, whether in Program Files or somewhere else, (very often) some registry keys are added about that path.
So just moving the contents of a dir to another location, or moving the complete dir, is not a good idea.
Because the registry isn't clever enough to detect that, and correct it.

If you want to move a program to another location, it's better to first uninstall it, and then install it again at the new spot.
Then the old registry keys should have been removed, and the new situation should have been added.
QuoteThis has also happened with a couple of other executables i have as well...
This is also an indication of a mashed up registry.
You could try Auslogics Registry Cleaner (http://www.auslogics.com/en/software/registry-cleaner/)
This one is specialized in detecting broken associations with file extensions and fixing that.

Of course there's always the possibility of some probs with admin rights on your sys, but I'm happy to know little about that.
Title: Open With…
Post by: Really Weird Person on March 10, 2010, 05:46:48
My occasional problem was not that Modplug Tracker was not in the list, but rather which one I was selecting. I have found a workaround for this though.
Title: Recognizing openable files by MPT
Post by: LPChip on March 10, 2010, 08:18:31
Harbinger, try the guide on this page:

http://windowsxp.mvps.org/OpenWith.htm
Title: Recognizing openable files by MPT
Post by: Harbinger on March 20, 2010, 19:25:34
Yes, indeed it was the registries. I know little about them, as Macs never use this kind of application cache.
Here's a workaround for all those who ever encounter this problem again (in XP at least):

Solution to setting ModPlug as the opening application:

To prevent your system from "losing" ModPlug as a valid application, when upgrading to a new version of MPT, rename the old folder (but remember the current folder name), and name the new folder (where your mpt executable will be) the same name as the old folder was. Alternatively move the applicable files from the old MPT build somewhere else, and move the new build into the current folder. Make sure the MPT executable's name AND PATH are the same as previous. The object here is to keep all the new files the same as the old (registered) files with the same name and the same path.

If you move things around, Windows loses sight of the valid "registered" executable, and can't find it to make it available to the Windows contextual menu (shell) for opening files. When you install an application, Windows sets up its validity by putting it in its registry, including the file path and its name. When you move the application or rename, the registry key is no longer applicable.

If ModPlug is not showing up as an opening executable (an application that can open files that have certain extensions), here's how you can fix it:

1. Either A. click Start, click Run, type %systemroot%\syswow64\regedit, and click OK; or B. open the WINDOWS folder in your main drive (usually C:/WINDOWS) and open the "regedit" executable.

2. On the left side is the directory pane. Open the "HKEY_CLASSES_ROOT" directory (it may be open to it by default already), and scroll down to the Applications folder. This holds the registry keys for all valid applications on your system.

3. Look for the correct name of the current ModPlug executable, such as "mptrack.exe", and open this directory.

4. There should be only one subdirectory "shell." This is the marker for Windows to include this application in your opening executables list. Open this directory, and its subdirectory "open" and ITS subdirectory "command."

5. On the left side of the RegEdit window, you'lll see the Open registry key. The pathname is what you'll need to correct. Double-click the "(Default)" icon, and enter the correct pathname.

6. To verify that what you did was correct, find a track file for MPT to open. Right-click on it to show the contextual menu, and choose "Open With..." The Open With dialog will appear and if you scroll down you should see the current version of ModPlug (or "Open MPT") in the list. If so, you've now corrected the registry.
Title: Recognizing openable files by MPT
Post by: Saga Musix on March 20, 2010, 19:32:03
Addendum: The above steps might slightly differ on a 32-bit system, for example the path "%systemroot%\syswow64\regedit" does not exist there.  But you can simply type "regedit" on both 32-bit and 64-bit systems to start the registry editor anyway.
Title: Recognizing openable files by MPT
Post by: LPChip on March 20, 2010, 22:26:02
I had the same problem with a simple batch file I programmed.

I moved it elsewhere, and suddenly I couldn't get windows to remember to have it in the Open With list. After I removed the entry from the registry, I could select Open With, and remember, and it was added back to the list.

This is what happens:

When you request the open with list, windows will not show items that do not exist on the system (which can happen if you rename a dir).

When you want to add a program to the open with list, windows thinks to be clever and sees that the program is already on the list, thus not adding it, which will fail of course. You could of course rename the .exe file and it will magically be added to the list, or you can remove the not-working program from the list by diving into the registry and manually remove it. After the program is gone from the open with list, adding it again will work as supposed.