Saturday, March 10, 2012

Inno Setup, Part 6. Creating file associations during installation.

During installation you may need to create file association, i.e. make some file extension being connected with your program. In this case Windows will receive information that files with this extension should be always opened with your program. In Windows this is done with the help of registry records. Here is the code:

In the code above we associated files with file extension .ext with OurProgram.exe which was put into {app} folder by installer. Also we set description and default icon for all the files with given file extension. If our program is uninstalled in future, this registry records will be automatically deleted by Inno Setup.