Browse Source

Set the Applications SupportedTypes key as well on file association.
https://docs.microsoft.com/en-us/windows/win32/shell/app-registration
https://groups.google.com/d/msgid/innosetup/36059381.20200907151340%40eternallybored.org

Martijn Laan 4 years ago
parent
commit
14abbe0165
2 changed files with 3 additions and 0 deletions
  1. 1 0
      Examples/Example3.iss
  2. 2 0
      Projects/CompFileAssoc.pas

+ 1 - 0
Examples/Example3.iss

@@ -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.

+ 2 - 0
Projects/CompFileAssoc.pas

@@ -83,6 +83,8 @@ begin
   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);