0

My app is associated with .XYZ file extensions by an Inno setup program. As far as I can tell, the initial file association is created OK & works perfectly fine. (The correct icon is shown for associated files, double clicking them will launch the app, etc.)

The problem is that if a user manually messes up the file associations of my app, reinstalling the app doesn't seem to fix the problem.

For example, we had a user associate the .XYZ extension of the app with a PDF reader (which is not at all a valid thing to do). It would be nice if simply reinstalling were a way for this to be fixed, rather than giving a user more complicated instructions. A lot of users would try reinstalling on their own in a situation like this anyway.

I think these are the relevant portions of the script:

[Setup]
...
ChangesAssociations = yes

...

[Registry]
    Root: HKA; Subkey: "Software\Classes\{#AppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: {#MainIcon}
    Root: HKA; Subkey: "Software\Classes\{#AppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#AppExeName}"" ""%1"""
    Root: HKA; Subkey: "Software\Classes\Applications\{#AppExeName}\SupportedTypes"; ValueType: string; ValueName: ".XYZ"; ValueData: ""
StayOnTarget
  • 11,743
  • 10
  • 52
  • 81

1 Answers1

1

Your installer uses obsolete (pre-Vista?) method for registering the file association.

If the user uses Windows Control Panel/Setting app to change the association, it uses the modern method for registration. It overrides your obsolete registration for good.

For the modern method, see:
Inno Setup: Extending Windows default apps list

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992