I would recommend not using a third-party component for this, because it will only complicate the situation.
We all know how to create file associations by editing ducks HKEY_CURRENT_USERand HKEY_LOCAL_MACHINE, right? In Windows Vista +, editing the former implies no problems, but if for some reason you want to edit the latter, that is, if you want to edit the associations for all users on the machine, your application should run with elevated privileges.
, " ". . , ( XML) . UAC *.exe , , , HKEY_LOCAL_MACHINE. , , SO. .
, "" . , , , - :
procedure Button1.Click(Sender: TObject);
begin
SomehowGetAdminPrivileges;
ChangeLocalMachineRegistry;
SomehowGetBackNormalPrivileges;
end;
. , -, , ,
procedure Button1.Click(Sender: TObject);
begin
ShellExecute(Application.Handle, nil, PChar('myapp.exe'), nil, nil, SW_SHOWNORMAL);
end;
myapp.exe , , . , myapp.exe - , UAC, myapp.exe , .
, , .
? Inno Setup, , Inno Setup . , UAC setup.exe( Inno Setup), . - HKEY_LOCAL_MACHINE.