Ver Mensaje Individual
  #7  
Antiguo 28-06-2024
Avatar de pgranados
pgranados pgranados is offline
Miembro
 
Registrado: sep 2022
Ubicación: México
Posts: 321
Reputación: 4
pgranados Va por buen camino
Para eso yo utilizo este codigo:

Código Delphi [-]
if EsWindows64Bits then // Si Windows es 64 bits vamos a mandar las DLL
begin // Si Windows es de 64 bits copio y pego las dos DLL en System 32
    if not FileExists('C:\Windows\SysWOW64\WebView2Loader_x86.dll') then
    begin
      if not FileExists(psRutaRaizServer+'WebView2Loader_x86.dll') then
        exit;

      Destino := 'C:\Windows\SysWOW64';

      ZeroMemory(@FO, SizeOf(FO));
      FO.Wnd := 0;
      FO.wFunc := FO_COPY;
      FO.pFrom := PChar(psRutaRaizServer+'WebView2Loader_x86.dll' + #0);
      FO.pTo := PChar(Destino + #0);
      FO.fFlags := FOF_NOCONFIRMATION or FOF_NOCONFIRMMKDIR;

      if SHFileOperation(FO) <> 0 then
        Application.MessageBox(PChar('Hubo un error con WebView2Loader_x86.dll'), PChar(csNombrePrograma),MB_OK + MB_ICONERROR)
      else
        lbTerminar:= true;
    end;

    if not FileExists('C:\Windows\SysWOW64\WebView2Loader_x64.dll') then
    begin
      if not FileExists(psRutaRaizServer+'WebView2Loader_x64.dll') then
        exit;

      Destino := 'C:\Windows\SysWOW64';

      ZeroMemory(@FO, SizeOf(FO));
      FO.Wnd := 0;
      FO.wFunc := FO_COPY;
      FO.pFrom := PChar(psRutaRaizServer+'WebView2Loader_x64.dll' + #0);
      FO.pTo := PChar(Destino + #0);
      FO.fFlags := FOF_NOCONFIRMATION or FOF_NOCONFIRMMKDIR;

      if SHFileOperation(FO) <> 0 then
        Application.MessageBox(PChar('Hubo un error con WebView2Loader_x64.dll'), PChar(csNombrePrograma),MB_OK + MB_ICONERROR)
      else
        lbTerminar:= true;
   end;
end;

if lbTerminar = true then
begin
    Application.MessageBox(PChar('Al cerrar este mensaje se cerrará el sistema. al volver a entrar se terminarán de instalar los archivos requeridos para el correcto funcionamiento de 
    este.'), PChar(csNombrePrograma),MB_OK + MB_ICONWARNING);
    // Aqui cerramos el programa
end;
Responder Con Cita