Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

File Association


3 replies to this topic

baillie

baillie
  • Members
  • 4 posts

Posted 17 April 2001 - 21:04

I am trying to associate the file extension .xml with the application that I'm installing.  I do not want to wipe out any existing associations.

I don't want it to open in my application with a double click in explorer.  I want to be able to right click on the filename and have my application name show up on an "Open With" list.

I've got it working in Windows2000, but it doesn't seem to work on NT/98 machines.  Is this not a feature of these other OS or is it just a different setup?

Here is how I'm doing the association:

I'm creating a set of keys in the HKEY_CLASSES_ROOT  
Applications
      app.exe
          shell
              open
                  command

To set up the application parameters.

Then within HKEY_CURRENT_USER  I create a key like below:

Software
   Microsoft
       Windows
           CurrentVersion
                Explorer
                    FileExts
                        .xml
There, I query the OpenWithList to see if my app is already reqistered there.  If it is, great, otherwise, I add
a string value with the data value of app.exe.  I also add the string value to the MRUList so the app shows up on the OpenWith list in explorer.

I hope it is clear what I'm doing.  Any help would be very much appreciated.


mat t

mat t
  • Members
  • 11 posts

Posted 24 April 2001 - 17:26

Software
  Microsoft
      Windows
          CurrentVersion
               Explorer
                   FileExts
                       .xml

I don't think this key exists on NT and 98 - I think its new to w2k.

I've been trying to set up a right click menu for a program we do and there were 2 ways I could see of doing it.
1. Write a shell extension and registry it @
HKEY_CLASSES_ROOT
.xml
   shellext
     <all the right CLSID etc>

2. Or a some what simpler way - find out what has the association (eg ".xml" and "xmlfile")
The add the following key
HKEY_CLASSES_ROOT
 xmlfile
   shell
     <your menu entery>
       command
 
This will add <your menu entery> to the right click menu on .xml files.

I hope this helps,
Matt

BTW,
I tried adding something like the following
.xml
 shell
   <menu entry>
     command
This only worked when the file extension was not associated with anything else.



baillie

baillie
  • Members
  • 4 posts

Posted 24 April 2001 - 17:47

Thanks Matt.  I can't wait to give this a shot.