Hello!
Here I dug out the site, what path to the registry you need to self-delete the program: " HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
"
The entries in this section indicate the names of the files that are to be executed once during system boot. To remove a program, you just need to add an entry with the name of the file that will delete it or with the command del "file name". "
But I can not understand what to do in Delphi. Here is what he wrote:
reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; try reg.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce',true); reg.WriteString('del','del "C:\...\Project2.exe"'); reg.CloseKey; reg.Free; except end;