Old 7th February 2011, 20:37   #1
ADude
Junior Member
 
Join Date: Nov 2003
Posts: 18
File Type Associations and Multiple Instances

I have been wrestling with this problem for over a year, reading all the threads about multiple instances. Somehow I did have it working at one point - but don't remember what the last change was.

Then I decided to try a media library program and it took over all the file associations, and when uninstalled that program, there were no file associations, and when I let Winamp re-establish its file associations, it was wrong again.

Specifics:

I have two entirely separate installations of Winamp in two separate folders. (This is Vista, but UAC is disabled and the user is an Administrator.) The idea is that I have a Shoutcast stream output through a little FM transmitter, so that a bedroom FM radio can listen to it. Then I want MP3s, FLACs and so on to play on the other instance of Winamp, so that they do not interrupt the other person listening to the Shoutcast stream.

So, I want the File Type Associations to only work with ONE of the Winamp instances, and not work with the second shoutcast stream instance.

The only way that has ever worked is with "/CLASS" commandline option as specified in:

http://forums.winamp.com/showthread....50#post1953650

But I think that the "/CLASS" needs to be specified in the file associations in order for this to work.

In other words, if the only Winamp instance running is the #2 instance with shoutcast stream and /CLASS="Winamp2" then the vanilla Winamp file type associations will ignore the /CLASS and play the MP3 file in the shoutcast stream instead of starting a new instance. (I don't want to use /NEW because if the correct instance is already running playing an MP3, I don't want it to start a second one causing both MP3s to play at once.)

So, how can I get only one Winamp instance to have the file type associations, and presumably include /CLASS in those associations ?

Many thanks !
ADude is offline   Reply With Quote
Old 8th February 2011, 06:46   #2
ADude
Junior Member
 
Join Date: Nov 2003
Posts: 18
Okay, so today I tried uninstalling Winamp altogether, and reinstalled it and copies the inidir, so that the one whose INI has output set to the FM transmitter as:

"C:\Program Files\Winamp\winamp.exe" /inidir="%APPDATA%\Winamp2" /CLASS="Winamp2" "(shoutcast stream link)"

and then I used a registry search and replace to change every occurrence of:

"C:\Program Files\Winamp\winamp.exe" "%1"

that was created by Winamp installation to:

"C:\Program Files\Winamp\winamp.exe" /inidir="%APPDATA%\Winamp" /CLASS="Winamp" "%1"

Then I unchecked the checkbox to have the filetype associations reset when Winamp is started so that Winamp would not clear those changes. I checked the registry and the associations still has the inidir and CLASS. Multiple Instances is checked on each Winamp.

Then I double-clicked on a FLAC file and it opened it in the existing Winamp, ignoring the inidir and CLASS settings. So, for some reason, the instructions from the Winamp Lead Developer in:

http://forums.winamp.com/showthread....50#post1953650

that say: "(note: this will launch Winamp, as above, if the particular copy is not open)"

are not working.
ADude is offline   Reply With Quote
Old 8th February 2011, 10:14   #3
DrO
 
Join Date: Sep 2003
Posts: 27,873
the fact you've messed around and changed different things especially with having done something with another media player is no wonder that you're having issues and especially messing around with the filepaths in the registry is really not the best way to be doing it. especially as it can all be done permenantly in ini files instead of using the command-line options which are only really intended for temporary solutions and not permanent ones as you seem to be doing.

once you have the first instance setup (will require a re-install or running Winamp /REG=S on the command-line in the Winamp folder to restore things correctly to that instance), copy the program folder and make a second copy of it (or re-use the second install you've already made), changing the inidir entry in the paths.ini to somewhere different as you're otherwise going to get a settings conflict with trying to run both versions.

you can also change the class on the second instance in the paths.ini by adding class=whatever_you_want


additionally if you set 'no_registry=1' in the [Winamp] section of the second instance's Winamp.ini so that instance won't try to do anything in the registry.

that's how i've got two instances of Winamp running, one for normal usage & test broadcasting with the Source DSP and a second one being able to listen or act as an alternative broadcaster. though i only ever drag and drop files onto the instance i want though from a quick try it was sending the files to the correct instance but i've got a feeling you're going to come back and say it's still not working.

[edit]
just found if i run the second instance first (which i don't usually do) then the files are enqueued into it instead of the main instance. i think this is more something quirky between Explorer and how Winamp is indentifying itself, most likely with the ole regsitration.

-daz
DrO is offline   Reply With Quote
Old 8th February 2011, 17:12   #4
ADude
Junior Member
 
Join Date: Nov 2003
Posts: 18
Quote:
Originally Posted by DrO View Post
just found if i run the second instance first (which i don't usually do) then the files are enqueued into it instead of the main instance. i think this is more something quirky between Explorer and how Winamp is indentifying itself, most likely with the ole regsitration.
Thanks for your reply.

Your last statement ("just found...") is the only problem that I have when doing it the way that Ben Allison suggests.

Also, I found out that when Winamp is started from a shortcut (.lnk file), if you don't even bother with the CLASS and inidir, in other words just winamp.exe filename.mp3, then it will start a new instance (which makes sense since no CLASS specified is different than the running Winamp and the default inidir would be the original installation).

So, it only fails to work right in Explorer or an Explorer substitute (like xplorer2).
ADude is offline   Reply With Quote
Old 8th February 2011, 17:37   #5
DrO
 
Join Date: Sep 2003
Posts: 27,873
what Ben suggested (all those years back) is basically how to do it but things have changed a lot in how Winamp interacts with the Windows Shell since those posts to make the normal usage of a single instance work better. basically running multiple instances isn't really intended to happen and although it does, if you do, the first instance is generally going to be the one which gets the files from Explorer, etc as that's how the api's running work - so what is being seen (however annoying) is how things are meant to be working from what i've found / seen in the source code and the OS api's, etc being used.

-daz
DrO is offline   Reply With Quote
Old 8th February 2011, 18:45   #6
ADude
Junior Member
 
Join Date: Nov 2003
Posts: 18
Quote:
Originally Posted by DrO View Post
basically running multiple instances isn't really intended to happen and although it does, if you do, the first instance is generally going to be the one which gets the files from Explorer
Okay, but that is contrary to having a "Multiple Instances" checkbook on the options page, which obviously is stating that it is supported.

It sounds like what is needed is for Winamp development to support "Multiple Installations" rather than "Multiple Instances".

Here is how that could work:

- Install Winamp normally.

- Start installation again.

- Winamp checks and sees an existing installation and asks:

" Do you want to repair your existing installation or do you want multiple installations? "

- If you click on "multiple installations", then Winamp does a normal installation, except that everything is installed as "Winamp2", especially the registry stuff. So, as far as Windows is concerned, you have installed two different programs, "Winamp" and "Winamp2" that are totally separate. Then none of these problems would occur.

It's a much cleaner, simpler and problem free method which would save hundreds of hours of Forum replies.

( AFAIK, I cannot do that myself, because I cannot get the installer to change the name of the program being installed. )
ADude is offline   Reply With Quote
Old 8th February 2011, 18:59   #7
DrO
 
Join Date: Sep 2003
Posts: 27,873
i think you're starting to confuse things (and me) with changing between multiple installs vs multiple instances.

you already can do multiple installations as long as you choose a different location - the only possible issue (and i'm not in a position to try it out now) is with the file association where one instance is likely to overwrite the settings from the prior install unless the no_registry option is enabled (the part i cannot currently try out).

what you've said wouldn't work with the registry handling as that's not how file associations work, at least not for what you're wanting to achieve having different guids per com server instance registered for the ole handling (which is what is responsible for the handling of shell actions) complicates things and for the odd scenario i personally wouldn't think is worth the time and work needed to make everything handle it correctly (in winamp.exe, in all of the registry associations, in the installer + uninstaller aspects, etc).

all you need to do is to start the 'main' instance of Winamp first and then that will be used for the shell interaction, etc. maybe someone on the dev team will see this but i highly doubt anything like this will be considered to be worked on (to keep things in the world of reality).

-daz
DrO is offline   Reply With Quote
Old 8th February 2011, 20:22   #8
ADude
Junior Member
 
Join Date: Nov 2003
Posts: 18
I've realized that if I keep the installation called "Winamp" for outputting the stream to the FM transmitter and then if I do an entirely different installation for music files, like MP3 and FLAC, and call that second installation "Foobar", then it will all work fine.

I suspect that is what other people have done in the past.

I need to keep Winamp for the streaming task, because some helpful guy wrote a Silence Detector plugin that makes it work properly.

The reason that this problem does not get to the level of needing action by developers, is that using Windows Explorer to find and click on a file, is an "old computer guy" way of doing things. People nowadays are trained to first start an application and then use the application to open a file. In that way of doing things, "file associations" are irrelevant.
ADude is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump