// write the application to the Windows run key
procedure AddToStartup(Name, AppPath: string);
var path: string;
begin
FInifile := TRegIniFile.Create('Software');
with FIniFile do
begin
path := 'Software\Microsoft\Windows\CurrentVersion\Run';
RootKey := HKEY_LOCAL_MACHINE;
if ReadString(Path, Name, '') <> AppPath then
WriteString(Path, Name, AppPath);
Free;
end;
end;