mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
installer: reset registry value if .srt association is deactivated
This commit is contained in:
parent
3439ea13e1
commit
4841d7111b
@ -417,7 +417,7 @@ Root: HKLM; Subkey: "{#keyCl}\.srt"; ValueType: string; ValueName: "PerceivedTyp
|
||||
Root: HKLM; Subkey: "{#keyApps}\SubtitleEdit.exe\SupportedTypes"; ValueType: string; ValueName: ".srt"; ValueData: ""; Check: HklmKeyExists('{#keyApps}')
|
||||
Root: HKLM; Subkey: "{#keySE}\Capabilities\FileAssociations"; ValueType: string; ValueName: ".srt"; ValueData: "SubtitleEdit.srt"
|
||||
; Associate .srt file type with SE (only if requested by user)
|
||||
Root: HKLM; Subkey: "{#keyCl}\.srt"; ValueType: string; ValueName: ""; ValueData: "SubtitleEdit.srt"; Tasks: associate_srt
|
||||
Root: HKLM; Subkey: "{#keyCl}\.srt"; ValueType: string; ValueName: ""; ValueData: "SubtitleEdit.srt"; Check: DoSystemAssoc('srt')
|
||||
; Add .sup to the SE-supported file types
|
||||
Root: HKLM; Subkey: "{#keyCl}\SubtitleEdit.sup"; ValueType: string; ValueName: ""; ValueData: "{#RCDESC_SUP_DEFAULT}"; Flags: deletekey uninsdeletekey
|
||||
Root: HKLM; Subkey: "{#keyCl}\SubtitleEdit.sup"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "{#rctext(RCDESC_SUP)}"
|
||||
@ -472,6 +472,21 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
// Reset HKLM file type association if it is currently ours, and check if it should be renewed
|
||||
function DoSystemAssoc(const FileType: String): Boolean;
|
||||
var
|
||||
CurrentProgId, MyProgId, KeyName: String;
|
||||
begin
|
||||
KeyName := '{#keyCl}\.' + FileType;
|
||||
if RegQueryStringValue(HKEY_LOCAL_MACHINE, KeyName, '', CurrentProgId) then begin
|
||||
MyProgId := 'SubtitleEdit.' + FileType;
|
||||
if CompareText(CurrentProgId, MyProgId) = 0 then
|
||||
RegWriteStringValue(HKEY_LOCAL_MACHINE, KeyName, '', '');
|
||||
end;
|
||||
Result := IsTaskSelected('associate_' + FileType);
|
||||
end;
|
||||
|
||||
|
||||
procedure CleanUpDictionaries();
|
||||
begin
|
||||
DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\da_DK_names_etc.xml'));
|
||||
|
Loading…
Reference in New Issue
Block a user