Question : How  to register regsrv32 DLLs in remote machi by using delphi 7 program

I'm creating a release Automation Tool for my Project deployment. This tool can be able to release the project from one machine to mulitple remote machine. Getting back up applying the New files, Registering the DLL into COM+ group all. Now i want to include the functionality to regisitering some system required DLL into regsrv32 section for every remote computer. can you help me to register the DLL in to remote machine by using Delphi Program.

Here  the code for registering regsrv32 DLL in local machine.

Procedure TDeployAssistant.Registerwindowdll(WinPath : String);
type
  TRegFunc = function : HResult; stdcall;
var
  ARegFunc : TRegFunc;
  aHandle  : THandle;
begin
 try
//  ocxPath := ExtractFilePath(Application.ExeName) + 'Flash.ocx';
  aHandle := LoadLibrary(PChar(WinPath));
  if aHandle <> 0 then
  begin
    ARegFunc := GetProcAddress(aHandle,'DllRegisterServer');
    if Assigned(ARegFunc) then
    begin
     frmDeploy.ExecAndWait('regsvr32','/s ' + WinPath);
    end;
    FreeLibrary(aHandle);
  end;
 except
  ShowMessage(Format('Unable to register %s', [WinPath]));
 end;

end;
function TfrmDeploy.ExecAndWait(const ExecuteFile, ParamString : string): boolean;
var
  SEInfo: TShellExecuteInfo;
  ExitCode: DWORD;
begin
  FillChar(SEInfo, SizeOf(SEInfo), 0);
  SEInfo.cbSize := SizeOf(TShellExecuteInfo);
  with SEInfo do begin
    fMask := SEE_MASK_NOCLOSEPROCESS;
    Wnd := Application.Handle;
    lpFile := PChar(ExecuteFile);
    lpParameters := PChar(ParamString);
    nShow := SW_HIDE;
  end;
  if ShellExecuteEx(@SEInfo) then
  begin
    repeat
      Application.ProcessMessages;
      GetExitCodeProcess(SEInfo.hProcess, ExitCode);
    until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
    Result:=True;
  end
  else Result:=False;
end;

Answer : How  to register regsrv32 DLLs in remote machi by using delphi 7 program

If you want to execute code on ANOTHER machine you need to a remote shell of some sort. If you search for "execute code remote machine" you'll see a lot of discussion about this.

WMI is yet another platform you can hook into.

http://blogs.technet.com/b/heyscriptingguy/archive/2005/07/01/how-can-i-launch-two-applications-wait-until-one-program-ends-and-then-close-the-other.aspx


Random Solutions  
 
programming4us programming4us