Search code examples
c#visual-studioregistrysetup-project

VS SetupProject registry entry for custom file-extensions


Within my project I create backup-files with a custom extension ".tp"

The software will be distributed with a Setup Project as an installer.

Which steps do I have to follow in order to add a registry entry via Setup project to let the OS show my custom icon? Is that possible?

I found a few solutions on how to do it manually, but I would like to have the installer (Setup project) to do it for me... Could not find anything on that...

info: I use Visual Studio Express 2017 Software is written in C#

EDIT: In the meantime I was able to add a registry entry into the right directory, but I am not sure how to point to the .ico file, and on how to call SHChangeNotify...


Solution

  • Visual Studio setup projects have a File Types on Target Machine editor, so there's no need for registry manipulation. If you add a new file type (your .tp) the IDE's property window on the .tp (hit F4) will show a window where you add your icon. The %Open properties window is where you add the program to open the extension. It's not overly complicated. This seems to cover it in extra detail:

    http://www.dreamincode.net/forums/topic/58005-file-associations-in-visual-studio/