serg_aka_lain  Цитата: Покажи как используешь в Code
  [more=здесь] 
 [_Code] 
 var  
   ErrorCode, ResultCode: Integer;  
   ResultStr: String;     
 function InitializeSetup(): Boolean;  
 begin  
   Exec('taskkill', '/f /im PSTrayFactory.exe', '', SW_HIDE,ewWaitUntilTerminated, ErrorCode);  
   Result := True;  
   begin  
     If RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PS Tray Factory_is1', 'DisplayName', ResultStr) then  
     begin  
       If ResultStr='PS Tray Factory' then  
       begin  
         ResultStr:=RemoveQuotes(ResultStr);  
         if MsgBox('Setup has detected that ' + ResultStr + ' is already installed on your computer.'#13#13'You would like to remove all before continuing?', mbInformation, MB_OKCANCEL) = idCANCEL then  
         begin  
           Result := False;  
         end else  
         If RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PS Tray Factory_is1', 'UninstallString', ResultStr) then  
         begin  
           If ResultStr <> '' then  
           begin  
             ResultStr := RemoveQuotes(ResultStr);  
             if not Exec(ResultStr, '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then  
             MsgBox('Uninstall Error. ' #13#13 '' + SysErrorMessage(ResultCode) + '.' #13#13 'Probably, uninstall files was moved, removed or renamed.', mbError, MB_OK);  
           end;  
         end;  
       end;  
     end;  
   end;  
 end; 
 [/more] проверка во время инсталляции, но именно на этой программке выдаёт ошибку, поэтому и хотел сделать, чтоб инсталлятор проверял, что приложение уже установлено, затем предлагал его удалить, а уже при удалении деинсталлятор определял запущенный процесс и предлагал его выгрузить вручную. Т.к. после того как процесс закрывается вручную, программа полностью удаляется не оставляя хвостов.