Ignore exceptions when setting file associations, for Win 7 users

without admin privs
This commit is contained in:
Eric Fredricksen
2012-02-14 08:41:54 -08:00
parent e371be0bc4
commit d611931e37
+6
View File
@@ -199,6 +199,7 @@ var
kOpenCommand: String; kOpenCommand: String;
begin begin
kOpenCommand := '"' + Application.ExeName + '" "%1"'; kOpenCommand := '"' + Application.ExeName + '" "%1"';
try
RegWrite(HKEY_CLASSES_ROOT, kFileExt,'', kPQFileType); RegWrite(HKEY_CLASSES_ROOT, kFileExt,'', kPQFileType);
RegWrite(HKEY_CLASSES_ROOT, kPQFileType, '', 'Progresss Quest saved game'); RegWrite(HKEY_CLASSES_ROOT, kPQFileType, '', 'Progresss Quest saved game');
RegWrite(HKEY_CLASSES_ROOT, kPQFileType + '\DefaultIcon', '', Application.ExeName + ',0'); RegWrite(HKEY_CLASSES_ROOT, kPQFileType + '\DefaultIcon', '', Application.ExeName + ',0');
@@ -209,6 +210,11 @@ begin
// I don't do this unless I'm sure this one has changed. // I don't do this unless I'm sure this one has changed.
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil); SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);
end; end;
except
on Exception do begin
// Don't care
end;
end;
end; end;
procedure TMainForm.MinimizeIt; procedure TMainForm.MinimizeIt;