Było. Macie tu kawałek kodu, który kiedyś napisałem na potrzeby swojej aplikacji.
function ModifyReg:boolean;
var reg : TRegistry;
procedure cantcreate;
begin
Result:=False;
Reg.Free;
Exit;
end;
begin
Result:=True;
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CLASSES_ROOT;
With Reg do
begin
If Not CreateKey('.arj') then
CantCreate;
OpenKey('.arj',False);
WriteString('','PolArj');
end;
Reg.CloseKey;
If Not Reg.CreateKey('PolArj') then
CantCreate;
Reg.OpenKey('PolArj',False);
Reg.WriteString('','ARJ archive');
If (Not Reg.CreateKey('shell'))or(Not Reg.CreateKey('DefaultIcon')) then
CantCreate;
With Reg do
begin
OpenKey('DefaultIcon',False);
WriteString('',PathToInstall+'\Polarj.exe,0');
CloseKey;
OpenKey('polarj\shell',False);
end;
If Not Reg.CreateKey('open') then
CantCreate;
Reg.OpenKey('open',False);
If Not Reg.CreateKey('command') then
CantCreate;
Reg.OpenKey('command',False);
Reg.WriteString('',PathToInstall+'\polarj.exe "%1"');
Reg.RootKey:=HKEY_LOCAL_MACHINE;
If Not Reg.OpenKey('software\Microsoft\Windows\CurrentVersion\Uninstall',False) then
CantCreate;
If Not Reg.CreateKey('PolArj') then
CantCreate;
Reg.OpenKey('PolArj',False);
Reg.WriteString('DisplayName','PolArj - Nakładka na ARJ');
If PathToInstall[Length(PathToInstall)]'' then
Reg.WriteString('UninstallString',PathToInstall+'\Uninstall.exe -uninstall')
else
Reg.WriteString('UninstallString',PathToInstall+'Uninstall.exe -uninstall');
Reg.Free;
end;//ModifyReg
Część kodu usunąłem bo nie była istotna, część nie jest dla stworzenia skojarzenia potrzebna ale na wzór może posłużyć.