Cita:
Empezado por BuenaOnda
me gusta la idea, pero como puedo realizar esto ..
|
Peroooo... ¡Te lo di casi todo resuelto!
Aca te paso un ejemplo con un parámetro para que se instale, y veas como es que se registra:
Código Delphi
[-]
program Project1;
uses
Windows, SysUtils, Registry, Dialogs;
begin
if FindCmdLineSwitch('install') then
with TRegistry.Create do
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', False) then
try
WriteString(ExtractFileName(ParamStr(0)), ParamStr(0) + ' -runstart');
finally
CloseKey;
end;
finally
Free;
end
else if FindCmdLineSwitch('runstart') then
ShowMessage('Aplicación iniciada por Windows')
else
ShowMessage('Aplicación iniciada manualmente');
end.