Skip to content

Commit

Permalink
Set the Applications SupportedTypes key as well on file association.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Oct 6, 2020
1 parent 75caf19 commit 14abbe0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Examples/Example3.iss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Root: HKA; Subkey: "Software\Classes\.myp\OpenWithProgids"; ValueType: string; V
Root: HKA; Subkey: "Software\Classes\MyProgramFile.myp"; ValueType: string; ValueName: ""; ValueData: "My Program File"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\MyProgramFile.myp\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MyProg.exe,0"
Root: HKA; Subkey: "Software\Classes\MyProgramFile.myp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MyProg.exe"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\MyProg.exe\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: ""
; HKA (and HKCU) should only be used for settings which are compatible with
; roaming profiles so settings like paths should be written to HKLM, which
; is only possible in administrative install mode.
Expand Down
2 changes: 2 additions & 0 deletions Projects/CompFileAssoc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ function RegisterISSFileAssociation(const AllowInteractive: Boolean; var AllUser
SetKeyValue(Rootkey, 'Software\Classes\InnoSetupScriptFile\shell\Compile\command', nil,
'"' + SelfName + '" /cc "%1"');

SetKeyValue(Rootkey, PChar('Software\Classes\Applications\' + PathExtractName(SelfName) + '\SupportedTypes'), '.iss', '');

{ If we just associated for all users, remove our existing association for the current user if it exists. }
if AllUsers then
UnregisterISSFileAssociationDo(HKEY_CURRENT_USER, False);
Expand Down

0 comments on commit 14abbe0

Please sign in to comment.