Vraag : Hoe te om regsrv32 DLLs in verre machi te registreren door Delphi 7 te gebruiken programma

Ik cre�ër een Hulpmiddel van de versieAutomatisering voor mijn plaatsing van het Project. Dit hulpmiddel kan het project van één machine aan mulitple verre machine kunnen vrijgeven. Wordend hulp toepassend de Nieuwe dossiers, DLL registreren in COM+ groep allen die. Nu wil ik de functionaliteit aan het regisitering van één of andere systeem vereiste DLL in regsrv32- sectie voor elke verre computer omvatten. kunt u me om DLL aan verre machine door Delphi Program.

Here de code voor het registreren van regsrv32 DLL in lokale machine.

Procedure TDeployAssistant.Registerwindowdll (WinPath: Koord);
type
TRegFunc = functioneert: HResult; stdcall;
var
ARegFunc: TRegFunc;
aHandle: T-hendel;
begin
try
//ocxPath: = ExtractFilePath (Application.ExeName) + „Flash.ocx“;
aHandle: = LoadLibrary (PChar (WinPath) );
als aHandle <> 0 then
begin
ARegFunc: = GetProcAddress (aHandle, „DllRegisterServer“);
indien Toegewezen (ARegFunc) then
begin
frmDeploy.ExecAndWait („regsvr32“, „/s“ + WinPath); /> eind FreeLibrary (aHandle); /> eind except
ShowMessage (Formaat („Unable om %s“ te registreren, [WinPath])); /> eind
end;
function TfrmDeploy.ExecAndWait (const ExecuteFile, ParamString: koord): van Boole;
var
SEInfo: TShellExecuteInfo;
ExitCode: DWORD;
begin
FillChar (SEInfo, SizeOf (SEInfo), 0);
SEInfo.cbSize: = SizeOf (TShellExecuteInfo);
met SEInfo begin
fMask: = SEE_MASK_NOCLOSEPROCESS;
Wnd: = Application.Handle; lpFile
: = PChar (ExecuteFile); /> lpParameters nShow: = SW_HIDE; /> eind als ShellExecuteEx (@SEInfo) then
begin
repeat
Application.ProcessMessages;
GetExitCodeProcess (SEInfo.hProcess, ExitCode);
tot (ExitCode <> STILL_ACTIVE) of Application.Terminated; /> Resultaat end
anders Resultaat end;

Antwoord : Hoe te om regsrv32 DLLs in verre machi te registreren door Delphi 7 te gebruiken programma

Als u code inzake EEN ANDERE machine wilt uitvoeren hebt u aan verre shell van één of andere soort nodig. Als u naar „zoekt voer code verre machine uit“ u heel wat bespreking over dit zult zien.

WMI is nog een ander platform u kunt vasthaken in.

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


Andere oplossingen  
 
programming4us programming4us