Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure RegisterFirefoxAddon();
- var
- Value: String;
- CmdFirefox: String;
- PathXpi: String;
- ResultCode: Integer;
- StrLen, StrPos: Integer;
- begin
- if RegValueExists(HKEY_CLASSES_ROOT, 'Applications\firefox.exe\shell\open\command', '') then
- begin
- RegQueryStringValue(HKEY_CLASSES_ROOT, 'Applications\firefox.exe\shell\open\command', '', Value);
- StrLen := Length(Value);
- CmdFirefox := Copy(Value, 2, StrLen - 1);
- StrPos := Pos('"', CmdFirefox);
- CmdFirefox := Copy(CmdFirefox, 1, StrPos - 1);
- PathXpi := '"' + ExpandConstant('{userappdata}\addon-1.0.0.0-fx.xpi') + '"';
- Exec(CmdFirefox, PathXpi, '', SW_SHOW, ewNoWait, ResultCode);
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement