Click here to Skip to main content
Click here to Skip to main content

System File Association

By , 16 Mar 2007
 

Introduction

Ever wanted to programmatically associate a file type on the system with your application, but didn't like the idea of digging through the registry yourself? If so, then this article and code are right for you.

Background

File associations in Windows have two parts, the extension itself and the ProgID (programmatic identifier). While an extension does not have to be associated with any ProgID, if it is, it can only be associated with a single one. On the other hand, a ProgID can have multiple extensions associated with it.

The attached code includes classes such as:

  • FileAssociationInfo: provides properties to determine (or set) what ProgID the extension is associated with (ProgID), what sort of file the system considers it to be (PerceivedType), the MIME type of the file (ContentType), and what programs will appear in the extensions (OpenWithList).
  • ProgramAssociationInfo: functions similarly to FileAssociationInfo and provides properties to set how the shell should handle the file type (EditFlags), the command verbs and programs the ProgID supports (Verbs), and the file types icon (DefaultIcon).
  • AssociationManager: provides a simplistic method to determine if certain extensions are associated with a given ProgID. It also provides the ability to associate those types or to create a brand new association between already specified extensions and a ProgID.

Examples

Our first step is to create an instance of the FileAssociationInfo class and specify the extension we wish to deal with into the constructor. Next we see if the extension already exists and if it doesn't, we create it with the specified ProgID (MyProgramName), and then set up the optional ContentType and OpenWithList properties.

FileAssociationInfo fai = new FileAssociationInfo(".bob");
    if (!fai.Exists)
      {
         fai.Create("MyProgramName");

         //Specify MIME type (optional)
         fai.ContentType = "application/myfile";

         //Programs automatically displayed in open with list
         fai.OpenWithList = new string[]
        { "notepad.exe", "wordpad.exe", "someotherapp.exe" };
       }

Finally, we create an instance of the ProgramAssociationInfo class and specify the ProgID we wish to deal with in its constructor. Should this ProgID not exist, we create it and specify both a description for the program type (shared between all files using this ProgID) and the command verb that is used in selecting different ways to load the file.

ProgramAssociationInfo pai = new ProgramAssociationInfo(fai.ProgID);
    if (!pai.Exists)
      {
         pai.Create
         (
         //Description of program/file type
         "My Program's File Type",

         new ProgramVerb
              (
              //Verb name
              "Open",
              //Path and arguments to use
              @"C:\SomePath\MyApp.exe %1"
              )
            );

         //optional
         pai.DefaultIcon = new ProgramIcon(@"C:\SomePath\SomeIcon.ico");
       }

Full sample

The link at the top of this article includes a simplistic GUI that demonstrates all the capabilities of the FileAssociationInfo and ProgramAssociationInfo classes.

Word of warning

This code requires administrative access (especially under Vista) when used to create or modify extensions, and on some systems, it also requires elevated permission to read.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Brendan Grant
Web Developer
United States United States
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questionpdf, txtmemberPhilip Stuyck31-Jan-13 8:45 
I am trying this on windows 7 machine.
I only want to find out the default icon associated with an arbitrary file like for instance pdf. For pdf, the path in programicon is null and for txt extensions I get a value back containing % charackters that obviously need to be replaced by valid directory names.
So I think there is still some work here.
Can't figure out why pdf's return an empty path though.
QuestionHow to replace an existing extension?memberalexander200531-Dec-12 6:38 
Hi,
 
How to replace an existing extension with another program as default, BUT keep the old one in the "open with" list ?
 
Thanks!
QuestionCan't open multiple filesmemberFabrizio Stellato2-Dec-12 23:39 
When I select more than one file, my application open n times for each file selected with a single environment argument.
NewsNuGet PackagememberRob Vesse2-Nov-12 9:29 
For those who are interested I created a NuGet package for this library to make it easier to pull into newer projects
 
The code for creating the NuGet package is on BitBucket and you can find the package on NuGet
QuestionDoesnt work with Win7memberHrizip5-Dec-11 2:50 
Doesn't work with windows 7, it creates registry entries in HKEY_CLASSES_ROOT correctly but this is not where they should be placed, they must go under HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\FILEEXTS\-name of your extension-
 
If one manually adds the appropriate entries under the above mentioned key, the association works well, and if one deletes it, its stops working, so I conclude that on my system this is the reg. key that has to be modified.
If I delete one of the other places with relevant entries, it has no effect.
Other locations that I have found (with the relevant entries) are:
 
A) HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\name-of-extension\OPENWITHLIST
B) HKEY_CLASSES_ROOT\-name of extension-
C) HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\FILEEXTS\-name of your extension-
D) HKEY_USERS\random-user-ID\SOFTWARE\MICROSOFT\WINDOWS
 
ONLY by changing C) the changes have any effect!
Question%1 argumentmemberBence Sebők7-Jun-11 8:43 
Is '%1' the path of the opened file?
And if that is then can I get the path with this code?:

static void Main(string[] args)
{
string FilePath = args[0];
}

AnswerRe: %1 argumentmemberDimitris Vassiliades7-Jun-11 10:52 
The args contains only the arguments passed to the program.
You can take the path of the executable from Application.ExecutablePath.
 
See also http://msdn.microsoft.com/en-us/library/xf6afks0[^]

...Plug & Pray... Dead | X|

GeneralMy vote of 5memberMario Majcica19-May-11 11:26 
Good job!
GeneralGreat articlememberjatinsehgal8618-May-11 2:51 
This is one of the very better articles that I have come across in a considerable period of time. A job well done.
AnswerProgramIcon bug fix!memberWaldo Bronchart1-Mar-11 2:27 
in file ProgramAssociationInfo.cs the line 479 needs to be changed to:
registryWrapper.Write(string.Format("{0}\\{1}", this.progId, "DefaultIcon"), null, icon.ToString());
 
This fixes the issue I had with me not able to change the DefaultIcon
GeneralRe: ProgramIcon bug fix!memberikkentim31-Jan-12 10:35 
Thanks!
GeneralSome notes about file extensions on windowsmemberTheToid12-May-10 13:47 
It should be noted that the HKEY_CLASSES_ROOT key is actually a conglomerate view of the HKEY_LOCAL_MACHINE\Software\Classes AND the HKEY_CURRENT_USER\Software\Class, so please be careful, as sometimes one will override the other.
 
Also, when windows first launches a file association it creates a key under:
 
HKEY_CLASSES_ROOT\Software\Classes\Applications\{APPFILENAME}, where {APPFILENAME} is the filename including extension of the program associated, under this it will create a copy of the keys under the actual file association, this becomes the default when using the windows interface to create an association, which becomes a problem is the file pointed to under the Applications key no longer exists, as it stops the file from appearing in the open with list (even if you use the browse button), this key is not removed by the windows XP (maybe vista and 7 not sure) interface when going through the file types settings and restoring or deleting the association.
 
So if you have a problem where an association is not working be sure to check for this key and remove it.
 
One other place file assocations can be created is the Recommended Association list, this list can be found under:
 
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
 
And lists the default recommended programs, as per usual microsoft makes everything more complication then it needs to be, I hope this message saves someone some time, i had to find this by trial and error in the registry because it dosnt appear to be mentioned anywhere else on the net.
GeneralGreat post, one commentmemberLimitedAtonement3-Feb-10 10:02 
Dear Mr. Grant,
 
I hope you get out of debt fast!
 
This is a great project. I was looking through it and found one little oopsie that you may want to know about, although I realize that you probably haven't touched this thing in a while. In AssociationGUIForm.cs, in the extensionsListBox_SelectedIndexChanged(object, EventArgs) around line 33 of that function, you have what seems like an identical if-then statement doing the same thing, but the second time around, also setting the tag for the textbox. It looks like you wanted to replace the first if-then, but instead, replicated it and added to it. If I see more, I'll let you know, but this is a great job. Nice Registry Wrapper!
 
In Christ,
Aaron Laws
 
http://ProCure.com

Generalthanks for the codememberwas830917-Sep-09 18:02 
Smile | :)
GeneralAssociations not Working for currently associated filesmemberPipSharp18-Aug-09 0:36 
Hi,
 
I was wondering if someone could give us a hand here. I've created my own classes which sets file assiciations in the registry, much similar to this project... it seems to work perfectly fine if I register my own custom file type, but if I want to change an existing extension (like .tif for instnace) to open in my app instead of the default or current app, it won't work until I go into the associated app's settings and (un)associate the file type.
 
I've scanned the registry to check what it's doing, even by making use of these classes, and it sets the verbs, paths and parameters as it should, but windows still opens it in the original program (unless I first go manually unassociate)
 
I've been stuck on this for 5 days... my project was supposed to have been live already... it's freaking my pip. Any ideas would be awesome.
 
Tks,
Pip
GeneralRe: Associations not Working for currently associated filesmemberLimitedAtonement3-Feb-10 10:03 
Dear Pip,
 
Wow, that sucks. How did you do? I have no idea what's going on, but am curious as to how you did.
 
In Christ,
Aaron Laws
 
http://ProCure.com

GeneralRe: Associations not Working for currently associated filesmemberTheToid12-May-10 13:51 
You most likely have the applications key left over, to reset a file association FULLY using the registry delete these keys (NOTE: the windows interface dosnt even reset some of these):
 
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.{EXT}
 
HKEY_LOCAL_MACHINE\Software\Classes\.{EXT}]
HKEY_LOCAL_MACHINE\Software\Classes\Applications\{YOURAPPNAME}
HKEY_LOCAL_MACHINE\Software\Classes\{EXT}_auto_file
 
HKEY_CURRENT_USER\Software\Classes\.{EXT}]
HKEY_CURRENT_USER\Software\Classes\Applications\{YOURAPPNAME}
HKEY_CURRENT_USER\Software\Classes\{EXT}_auto_file]
 
Replacing
 
{EXT} with your file extension
{YOURAPPNAME} with the FILENAME.EXT of your application
 
Doing this will not only ensure your newly created assocation will work, but it will also remove any crap that windows has added from the open with interface creating its associations ({EXT}_auto_file and the like).
QuestionI want to use your code in my app. Can I ?memberIQ719-Jun-09 3:27 
I am developing open - source free project under GNU public license. I want to use your code as is, without modifying, just add your project to my solution. Can I use your code ?
 
I see somewhere in a code, that it can't be used in a GNU projects.
QuestionHow to run this applicationmemberKapilDesai17-May-09 22:42 
I am not able to associate your files with my project kindly let me knw urgently.....
QuestionHow to use it for an applicationmemberMichael Egan9-Apr-09 22:46 
Nice works, but I don't know how to step by step use it in my application. All I want is that after install my application, user can open a file by double click into it, of course this file with my extension. Can you describe more details?
 
Michael Egan

Generaldoes not work under VISTAmemberviewon013-Apr-08 10:59 
Hi,
 
It does not work under VISTA, I don t know why !
 
Do you have an idea ?
GeneralFilenames with spacesmemberpucis8324-Feb-08 13:15 
A little tweak for proper file handling if filename is with spaces like "C:\Documents and settings\...", shoud be:
 
//Path and arguments to use
 
@"C:\SomePath\MyApp.exe ""%1"""
QuestionHow to get icon from ProgramAssociationInfo.DefaultIconmemberhoanhtuan8-Jan-08 21:34 
Brendan,
 
How to get the icon from path string of ProgramAssociationInfo.DefaultIcon ?
 
I'm writing a explorer type program, and will need to display icon for each file type.
 
You done a great job, Rose | [Rose] , thanks much.
 
Anh Tuan
AnswerRe: How to get icon from ProgramAssociationInfo.DefaultIconmemberAschratt31-Jan-08 7:51 
mmhh... You can get the path to the icon and load it into your ListView (Or any other control) using standart C# Commands!
 
FileAssociationInfo hFAInfo = new FileAssociationInfo(".test");
if (hFAInfo.Exists)
{
ProgramAssociationInfo hPAInfo = new ProgramAssociationInfo(hFAInfo.ProgID);
string sIconPath = hPAInfo.DefaultIcon.Path.ToString();
}

 
Greetings!
 
Bier

GeneralDefaultIcon Bug [modified]memberAschratt1-Dec-07 23:16 
Hey!
 
Nice Code... pretty easy to use! But I found an Bug... If I set an DefaultIcon for a ProgrammAssociation the libary creates an DefaultIcon string value to my icon. At least Windows (XP... dunno how it is in other Win Versions) uses a key with an string (Standart) including the Icon. Your GUI even doesn't show my icon!
 
To make this a little bit more understood I try to show this on an "example":
 
Your's libary creates something like this:
 
-[KEY]Prog.ID
--(Standard)
--DefaultIcon
--[KEY]shell
...
 
But Windows wants something like this:
 
-[KEY]Prog.ID
--(Standard)
--[KEY]DefaultIcon
---(Standard) //Path to the Icon
--[KEY]shell
...
 
I try to fix this, but it would be cool if you could try this too!
 
Greetings and thanks for the nice code! =)
 
//EDIT:
 
protected void SetDefaultIcon(ProgramIcon icon)
{
if (!this.Exists)
throw new Exception("Extension does not exist");
 
if (icon != ProgramIcon.None)
{
RegistryKey root = Registry.ClassesRoot;
RegistryKey key = root.OpenSubKey(this.progId, true);
RegistryKey tmpkey = key.OpenSubKey("DefaultIcon", true);
 
if (tmpkey != null)
{
key.DeleteSubKeyTree("shell");
}
 
tmpkey = key.CreateSubKey("DefaultIcon");
registryWrapper.Write(this.progId + "\\DefaultIcon", "", icon.ToString());
 
ShellNotification.NotifyOfChange();
}
}

 
Works for me Wink | ;)
 
Greetz!
 

-- modified at 5:43 Sunday 2nd December, 2007
 
Bier

GeneralRe: DefaultIcon Bugmemberzackflame15-Jun-10 4:48 
This code is incorrect. Correct version:
protected void SetDefaultIcon(ProgramIcon icon)
{
  if (!this.Exists)
      throw new Exception("Extension does not exist");
 
  if (icon != ProgramIcon.None)
  {
      RegistryKey root = Registry.ClassesRoot;
      RegistryKey key = root.OpenSubKey(this.progId, true);
      RegistryKey tmpkey = key.OpenSubKey("DefaultIcon", true);
 
      if (tmpkey == null)
      {
          tmpkey = key.CreateSubKey("DefaultIcon");
      }
      
      registryWrapper.Write(this.progId + "\\DefaultIcon", "", icon.ToString());
 
      ShellNotification.NotifyOfChange();
  }
}

GeneralAccess to registry key deniedmemberkamal2003us1-Jul-07 23:49 
I tried compiling your code but I'm facing an exception "Access to registry key HKEY_...ROOT\.ewf is denied"
 
I'm running Vista Busines.
 
"Do u think that my being stronger or faster has anything to do with my muscles in a place like this".

GeneralRe: Access to registry key deniedmemberBrendan Grant2-Jul-07 5:24 
Are you receiving that exception during compilation or execution?
 
Chances are you are running into that exception because your user account doesn't have permission to write to or create that registry key.
 
Currently my code only writes to HKEY_CLASSES_ROOT, perhaps in future it will support writing to HKEY_CURRENT_USER\Software\Classes as well so that an app can register user specific file associations.
 
Ordinarily when writing to an admin only portion of the registry, Vista's Registry Virtualization would kick in... however it doesn't apply in this case as we are writing to HKEY_CLASSES_ROOT and not HKEY_LOCAL_MACHINE\Software.
 
For now, try running the application as Administrator when setting/editing system wide associations (which is truly an admin operation).
GeneralRe: Access to registry key deniedmemberyf0129-Dec-07 20:39 
In vista, the file associations information is written in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts instead of HKEY_CLASSES_ROOT.
It will read HKEY_CLASSES_ROOT unless there is no infomation existed in HKEY_CURRENT_USER.
And the key in HKEY_CURRENT_USER will be created when user opens file associations in the contro panel.
GeneralMay not need admin access under VistamemberThe_Mega_ZZTer16-Mar-07 14:42 
Vista (and it seems, also XP) support per-user file associations, at least as far as assigning extensions to existing file types. HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ is where it's at... I don't see actual file types under there, just associations for specific extensions.
 
It's also possible that HKCR is one of the keys where any writes by limited users is mirrored into a per-user key, and read back when requested by that user.
 
At the very least, the stuff in the key I mentioned has the possibility of overriding what changes your code tries to make if it doesn't look there.
QuestionGreat stuff! Can I use it?memberRichard Brightwell8-Mar-07 8:27 
Hi!
 
These classes you wrote are exactly what we need. I was wondering if we can use it in our program?
 
Thanks so much!
 
Richard
AnswerRe: Great stuff! Can I use it?memberBrendan Grant12-Mar-07 6:18 
Absolutely!
 
When you get around to release I’d love to hear what you are using it for/in.
GeneralBrief version [modified]memberMatthiasBiel21-Feb-07 20:41 
Hi,
 
this code is not as flexible as the version provided by Brendan but covers the common case of registering an application for opening a file with a specific extension.
 
Matthias
 
/// <summary>
/// Registers a file type via it's extension. If the file type is already registered, nothing is changed.
/// </summary>
/// <param name="extension">The extension to register</param>
/// <param name="progId">A unique identifier for the program to work with the file type</param>
/// <param name="description">A brief description of the file type</param>
/// <param name="executeable">Where to find the executeable.</param>
/// <param name="iconFile">Location of the icon.</param>
/// <param name="iconIdx">Selects the icon within <paramref name="iconFile"/></param>
public static void Register(string extension, string progId, string description, string executeable, string iconFile, int iconIdx)
{
     try
     {                   
          if (extension.Length != 0)
          {
               if (extension[0] != '.')
               {
                    extension = "."+extension;
               }
 
               // register the extension, if necessary
               using (RegistryKey key = Registry.ClassesRoot.OpenSubKey(extension))
               {
                    if (key == null)
                    {
                         using (RegistryKey extKey = Registry.ClassesRoot.CreateSubKey(extension))
                         {
                              extKey.SetValue(string.Empty, progId);
                         }
                    }
               }
 
               // register the progId, if necessary
               using (RegistryKey key = Registry.ClassesRoot.OpenSubKey(progId))
               {
                    if (key == null)
                    {
                         using (RegistryKey progIdKey = Registry.ClassesRoot.CreateSubKey(progId))
                         {
                              progIdKey.SetValue(string.Empty, description);
                              using (RegistryKey defaultIcon = progIdKey.CreateSubKey("DefaultIcon"))
                              {
                                   defaultIcon.SetValue(string.Empty, String.Format("\"{0}\",{1}", iconFile, iconIdx));
                              }
 
                              using (RegistryKey command = progIdKey.CreateSubKey("shell\\open\\command"))
                              {
                                   command.SetValue(string.Empty, String.Format("\"{0}\" \"%1\"", executeable));
                              }
                         }
                    }
               }
          }
     }
     catch(Exception ex)
     {
          // TODO: implement proper exception handling.
     }
}
 

 

-- modified at 2:08 Wednesday 30th May, 2007
GeneralRe: Brief versionmemberTesto28ß519-Jun-08 10:45 
Nice, but don't work unter Vista.
GeneralRe: Brief versionmemberkasparovthe218-Feb-09 6:33 
Sure it works on vista !
You're german , aren't you ? Because you used the german "unter" instead of "under" Wink | ;)
GeneralRe: Brief versionmemberspamblot13-Mar-09 4:51 
Much easier.
And, unlike the code from the main article, it actually works Dead | X|
 
Cheers!
GeneralRe: Brief versionmemberWayne Walter6-May-10 8:26 
This code didn't work for me at first. But then after correction, it works great.
 
The trouble is that it only works if there is not already any association with a file.
 
However, if you want to "overwrite" an existing association with your own, it fails.
 
It's easy to fix the logic, just look how it calls OpenSubKey() and then skips setting
the value if it already exists.
 
Instead, modify the code to always set the values even if OpenSubKey() finds an association
already there. Alternatively, you could warn the user, if you like, before overwriting.
 
Sincerely,
Wayne
GeneralHey BrendanmemberTall Dude9-Jan-07 20:20 
Brendan,
 
Where's the VB version for us
amatuers that don't want to learn/ install C# ?
 
See ya on the forums!
GeneralRe: Hey BrendanmemberBrendan Grant10-Jan-07 4:59 
Curse you Tall Dude! I was hoping it’d be a week or two before someone asked about a VB.NET version but then you had to go and ruin that! Ahh well, it was expected.
 
I’m planning to sit down over the weekend and convert both projects to VB.NET as well as have a pre-compiled copy of the classes for those who don’t want to use either C# or VB.NET and/or don’t want to look at source code at all.
GeneralRe: Hey BrendanmemberTall Dude10-Jan-07 8:51 
Well God bless you Brendan.
 
And yes, I've read your religious position
on your blog Smile | :)
 
Good luck on your weight project. I am also
6'4", but a smoker and could use to ADD a few pounds.
 
But on the bright side, I'll never be as good a programmer
as you are.
 
Later my friend .....
GeneralRe: Hey BrendanmemberBrendan Grant21-Mar-07 17:45 
Wanna do a little beta testing for me?
 
At long last I got around to porting the projects over to VB.NET and would love to have you (or anyone else) take it for a spin before I post it as the final VB.NET version on here.
 
You can find the project here[^]
GeneralRe: Hey BrendanmemberTall Dude22-Mar-07 13:04 
Brendan,
 
I had a little while today to try out the VB example solution.
 
Problem 1, (for me), VB Express will not open and run the program
in debug mode because it does not use the VB express partial classes
setup. Also, I, being an amatuer, was not used to working with multiple
projects in one solution Frown | :(
 
It would run by directly clicking on the exe in the solution from
Windows Explorer.
 
(I did restructure the code to run in the VB Express debugger.)
 
Problem 2: At one point I was able to crash the program by using the top
'update' button with the 'persistant handler' set to blank.
 
Problem 3: Having not read up too much on the subject of how Windows
handles file associations, the program was not intuative to me.
(Me dumb)
 
When trying to use the 'new extension' option, I had no idea what to put in the
other fields. Wheather thay could be made up, or had to equal some real value.
Also, the 'persistanthandler' seems to be a GUID, which I know nothing about.
Where would I look to find the GUID for my VB program?
 
A lot of the 'program association' info at the bottom, ended in
'/n /dde', which I have no idea what that means.
I figured out for my program to gets it's file argument I had to use "%1"
at the end, which did work.
 
The 'add' and 'remove' at the bottom, let you add/remove things like 'open'
(called a verb?) The open at bottom is the only one I worked with.
 
Problem 4: Some of the updates would not show up until the program was
closed and re-opened. Can't remember which ones.
 
Problem 5: Pointing to a new exe (VB program exe) for the icon source did not
change the icon source. (Is that just an info only field?)
 
More comments when I get more time to tinker.
GeneralNice code!memberRynus9-Jan-07 3:41 
This sure is helpful! Now we don't need ourselves to dive into the registry again Smile | :)
GeneralRe: Nice code!memberBrendan Grant10-Jan-07 4:57 
Thanks! The joy of registry editing was exactly why I wrote this in fact. I had found oodles of examples of how to write to the registry to do it yourself... but almost nothing that provided a higher level interface to do it.
GeneralGreat [modified]memberDrJaymz5-Jan-07 6:38 
I have been having a mare with file associations. I couldn't figure out how to get it to work with the installer, and then when I used XP's own file association tools from explorer, it just kept ignoring what I just told it.
 
I wanted to get this behaviour...
 
When you click on a *.spr file launch my program, then send the file as a command line switch. But I couldn't get it to work.
 
I got the associate.exe from the resource kit and assigned it manually, and it works, but I'm still confused.
GeneralRe: GreatmemberBrendan Grant10-Jan-07 4:55 
Getting files associations to work depends on what route you are taking to create them. If you are having problems with the installer I’d look more carefully into what might be going wrong there. What sort of installer are you using? How are you creating it?
GeneralRe: GreatmemberDrJaymz10-Jan-07 5:59 
Well I was using a 3rd party installer (wise) with .net, but we don't have the latest version, and I don't think we could have version 7, so I tried to use the vs2005 version, which I can't figure out how to make associations.
 
But I do like programs that are well behaved and can fix things themselves.
GeneralRe: GreatmemberBrendan Grant10-Jan-07 10:19 
Assuming you are trying to set it up within a Visual Studio 2005 Setup Project, use the File Types Editor (should be middle icon in Solution Explorer) to specify new file types you want registered on the target system and how they should be treated.
GeneralRe: GreatmemberDiamonddrake29-May-09 9:46 
Most often when you are having problems with changing file associations in windows, be it both XP and Vista, they can get angry about program IDs if the old program isn't where it expects it, it ignores changes... if you are having the trouble, just delete the entire key for that extension. and recreate it. It works wonders.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130617.1 | Last Updated 16 Mar 2007
Article Copyright 2007 by Brendan Grant
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid