Windows Vista, Default Programs API, file format associations, and (un)installers - explosive mix!

Posted by Alex T. on Stack Overflow See other posts from Stack Overflow or by Alex T.
Published on 2010-03-23T16:42:19Z Indexed on 2010/03/23 16:43 UTC
Read the original article Hit count: 468

My application is a rather well behaved Windows citizen, so when I ported it to Windows Vista/7 I replaced my custom file format association code with support for the Default Programs API. However I ran into a problem when trying to make uninstaller for my application - there seems to be no way to remove file format associations via Default Programs API.

I tried to call IApplicationAssociationRegistration::ClearUserAssociations but it actually removes all associations, including the ones for other applications - completely restoring default state of the OS (which is of course unacceptable).

I tried to call IApplicationAssociationRegistration::SetAppAsDefault to return file format associations to the previous "owner" - but it does not help, because my application handles many unique file formats which the OS does not support and there is no previous "owners". And Windows does not allow to pass empty strings to SetAppAsDefault...

So what do I do? Any good solutions?

© Stack Overflow or respective owner

Related posts about windows-vista

Related posts about windows-7