Search code examples
registryinno-setupfile-type

Restore the file association registry values on uninstall


according to the InnoSetup Helpfile it is possible to delete a registry key and value (a filetype-assoctiation) if my program gets uninstalled.

but the problem is the following:

*.txt-files <-> Windows Editor

Installation of my Programm

*.txt <-> My Program

Deinstallation of my Program

*.txt <-> NOTHING

So, how can i backup the previous association while installing and restore them while uninstalling my program?


Solution

  • This is the expected behaviour.

    What if the operations are along these lines:

    1. XYZ editor pro XP is installed and takes over .txt handling
    2. Yourapp 1.0 is installed and takes over .txt handling
    3. XYZ editor pro XP is removed, maybe restoring .txt handling back to notepad (its backup)
    4. Yourapp 1.0 is removed, restoring its backed up value to XYZ editor pro XP

    Much brokenness

    The best option is to leave them as they are on uninstall, OR blank them ONLY if your app is still the registered application.