Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Deployment File Type settings not overwriting existing association
 

Deployment File Type settings not overwriting existing association

I am using Visual Studio 2008 deployment project to create installers for our software, I have created a File Type association in the deployment project for an extension (xmlp).

This works fine if it is installed on a fresh system, but if installed on Vista and the user already has an association then it does not overwrite it, thus our testers have failed it.

How can I fix this problem? I cannot fathom how to get the installer to overwrite the users existing association, there seems to be no settings in the project for it.
KrisWragg  Tuesday, April 28, 2009 7:46 AM
When I've done this on non-Vista it doesn't replace the existing one but it does add to the list that's shownon right-clicking a file with that extension.I did a test to have another program open txt files, and it didn't replace notepad but it added my program to the list, and at uninstall time it just removed my program from the list. This makes sense because otherwise at uninstall time you'd have to restore what was there before. Is this what you're seeing maybe?
Phil Wilson
PhilWilson  Tuesday, April 28, 2009 9:52 PM
When I've done this on non-Vista it doesn't replace the existing one but it does add to the list that's shownon right-clicking a file with that extension.I did a test to have another program open txt files, and it didn't replace notepad but it added my program to the list, and at uninstall time it just removed my program from the list. This makes sense because otherwise at uninstall time you'd have to restore what was there before. Is this what you're seeing maybe?
Phil Wilson
PhilWilson  Tuesday, April 28, 2009 9:52 PM
Yes this is what we are seeing. In the real world it is unlikely that the user will have associated our filetype with wordpad/notepad like the developers and testers have. But needless to say it's making things difficult because as part of our installer we have put a shortcut on the users desktop to a demonstration file, which is great if the association has worked correctly.

But if its still pointing to notepad or something then it opens the file in that, which isn't desireable.
KrisWragg  Wednesday, April 29, 2009 7:28 AM
Hi Kris,

You may remove the file association to the existing programs andadd the file association to the new program when installing the MSI package.

Alternatively, you can set the default program for the file extension to the new application that is being installed.

Hope this helps.

Sincerely,
Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Wednesday, April 29, 2009 9:45 AM
Hi Kris,

You may remove the file association to the existing programs andadd the file association to the new program when installing the MSI package.

Alternatively, you can set the default program for the file extension to the new application that is being installed.

Hope this helps.

Sincerely,
Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Any examples? I have looked into the SetAppAsDefault function, but that doesnt seem to work correctly, and is only for Vista anyway.
KrisWragg  Wednesday, April 29, 2009 9:51 AM

You can use google to search for other answers

Custom Search

More Threads

• How to register assemblies during install in 64-bit
• Coding while publish
• Can language resources be downloaded as a file group and be used in the app without restarting?
• MDF datafile not being deployed target machine
• Change ProductVersion : Another version of this product is already installedChange (C# VS 2005)
• ClickOnce updating problem
• won't run without dot-net-framework
• Simple Deployment - advice requested
• Windows Service installed via setup (msi) project doesn't show up in Services
• Click Once Code signing