Einzelnen Beitrag anzeigen

ltbr

Registriert seit: 5. Feb 2007
3 Beiträge
 
Delphi XE7 Enterprise
 
#3

AW: Migration D6-Projekt auf XE7

  Alt 28. Mai 2015, 09:50
Hallo und Danke für die Antwort!

die PSvr.exe ist definitiv kein Dienst, das mit dem "Als Administrator ausführen" hab ich auch schon versucht, leider ohne Erfolg.
das alte D6-Projekt verwendet übrigens die BDE, die sollte im Zuge der Migration nach XE7 auch entfernt und durch moderne DB-Zugriffskomponenten ersetzt werden (UniDAC)

Ich versuch noch ein paar Infos zu liefern, vielleicht hat ja noch jemand eine Idee:

also das Hauptprogramm des Applikationsservers sieht so aus
Delphi-Quellcode:
program PSvr;

uses
  Forms,
  SysUtils,
  Dialogs,
  ServerDlg in 'ServerDlg.pas{dlgServer},
  PSvr_TLB in 'PSvr_TLB.pas',
  ServerDM in 'ServerDM.pas{PServer: TRemoteDataModule} {PServer: CoClass},
  PSysDataUn in 'PSysDataUn.pas',
  PSrvDef in 'PSrvDef.pas',
  DocSrvFunctionsUn in 'DocSrvFunctionsUn.pas',
  PSettingsDlg in 'PSettingsDlg.pas{dlgPSettings};
// Provider in 'C:\Programme\Borland\Delphi6\Source\Vcl\provider.pas';
                                           
{$R *.TLB}

{$R *.RES}

begin
  Application.ShowMainForm:=False;
  Application.Initialize;
  Application.CreateForm(TdlgServer, dlgServer);
  if ParamCount>0 then begin
    if (UpperCase(ParamStr(1))='/I') or (UpperCase(ParamStr(1))='/INSTALL') then
      Halt;
  end;
  Application.Run;
end.
die letzte Zeile in der Uses-Anweisung habe ich unter XE7 auskommentiert, unter D6 war die aktiv.

das folgende ist ein Auszug der PSvr_TLB:
Delphi-Quellcode:
unit PSvr_TLB;

// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //

// PASTLWTR : $Revision: 1.130.1.0.1.0.1.6 $
// File generated on 23.01.2009 14:25:49 from Type Library described below.

// ************************************************************************ //
// Type Lib: D:\projects\PERP\program\PServer\PSvr.tlb (1)
// LIBID: {B9A8DFF8-92C2-11D3-990E-00500401C404}
// LCID: 0
// Helpfile:
// DepndLst:
// (1) v1.0 Midas, (C:\WINNT\system32\MIDAS.DLL)
// (2) v2.0 stdole, (C:\WINNT\system32\stdole2.tlb)
// (3) v4.0 StdVCL, (C:\WINNT\system32\stdvcl40.dll)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, Midas, StdVCL, Variants;
  

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  PSvrMajorVersion = 1;
  PSvrMinorVersion = 0;

  LIBID_PSvr: TGUID = '{B9A8DFF8-92C2-11D3-990E-00500401C404}';

  IID_IPServer: TGUID = '{F38C6372-3F3B-11D3-ADA5-006097B43693}';
  CLASS_PServer: TGUID = '{F38C6374-3F3B-11D3-ADA5-006097B43693}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
  IPServer = interface;
  IPServerDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
  PServer = IPServer;


// *********************************************************************//
// Interface: IPServer
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {F38C6372-3F3B-11D3-ADA5-006097B43693}
// *********************************************************************//
  IPServer = interface(IAppServer)
    ['{F38C6372-3F3B-11D3-ADA5-006097B43693}']
    function SetDBParams(const Aliasname: WideString; const UserName: WideString;
                         const Password: WideString; HoldConnection: WordBool;
                         const ClientName: WideString; const ProgUser: WideString;
                         ConnectType: Smallint; var AliveInterval: Integer): WordBool; safecall;
    
    ....
    ....
    ....
  end;

// *********************************************************************//
// DispIntf: IPServerDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {F38C6372-3F3B-11D3-ADA5-006097B43693}
// *********************************************************************//
  IPServerDisp = dispinterface
    ['{F38C6372-3F3B-11D3-ADA5-006097B43693}']
    function SetDBParams(const Aliasname: WideString; const UserName: WideString;
                         const Password: WideString; HoldConnection: WordBool;
                         const ClientName: WideString; const ProgUser: WideString;
                         ConnectType: Smallint; var AliveInterval: Integer): WordBool; dispid 1;
    
    ...
    ...
    ...
  end;

// *********************************************************************//
// The Class CoPServer provides a Create and CreateRemote method to
// create instances of the default interface IPServer exposed by
// the CoClass PServer. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
  CoPServer = class
    class function Create: IPServer;
    class function CreateRemote(const MachineName: string): IPServer;
  end;

implementation
uses ComObj;

class function CoPServer.Create: IPServer;
begin
  Result := CreateComObject(CLASS_PServer) as IPServer;
end;

class function CoPServer.CreateRemote(const MachineName: string): IPServer;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_PServer) as IPServer;
end;
und noch was interessantes, die ServerDM wo im Initialization-Teil was ausgeführt wird
Delphi-Quellcode:
unit ServerDM;

interface

uses
  Windows, Messages, Variants, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr,
  DBClient, PSvr_TLB, StdVcl, DBTables, Db, Uni, Provider, Midas,
  PSysdataUn, CSClientDataSet, ExtCtrls, DBAccess, MemDS;

type
  TPServer = class(TRemoteDataModule, IPServer)
    ....;

implementation

uses {BDE,}ServerDlg,Dialogs,PSrvDef,DocSrvFunctionsUn;

...

initialization
  TComponentFactory.Create(ComServer, TPServer, Class_PServer, ciMultiInstance, tmApartment);

end.
Soweit ich das sehe, ist das TComponentFactory.Create das einzige das ausgeführt wird, wenn ich die Anwendung mit dem Paramter /INSTALL starte, also sollte hier die Registrierung erfolgen.

wenn die Anwendung unter D6 mit dem Parameter /INSTALL gestartet wird, legt sie in der Registry folgende Schlüssel an
Code:
[HKEY_CLASSES_ROOT\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}]
@="PServer Object"
"AppID"="{F38C6374-3F3B-11D3-ADA5-006097B43693}"
"Sockets"="1"
"Web"="1"

[HKEY_CLASSES_ROOT\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\Implemented Categories]

[HKEY_CLASSES_ROOT\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\Implemented Categories\{13E85B3C-9508-11D2-AB63-00C04FA35CFA}]

[HKEY_CLASSES_ROOT\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\LocalServer32]
@="C:\\PROGRA~1\\PROFIK~1.0\\PSvr.exe"

[HKEY_CLASSES_ROOT\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\ProgID]
@="PSvr.PServer"

[HKEY_CLASSES_ROOT\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\TypeLib]
@="{B9A8DFF8-92C2-11D3-990E-00500401C404}"

[HKEY_CLASSES_ROOT\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\Version]
@="1.0"

[HKEY_CLASSES_ROOT\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}]

[HKEY_CLASSES_ROOT\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0]
@="PSvr Library"

[HKEY_CLASSES_ROOT\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\0]

[HKEY_CLASSES_ROOT\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\0\win32]
@="C:\\PROGRA~1\\PROFIK~1.0\\PSvr.exe"

[HKEY_CLASSES_ROOT\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\FLAGS]
@="0"

[HKEY_CLASSES_ROOT\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\HELPDIR]
@="C:\\PROGRA~1\\PROFIK~1.0\\"

[HKEY_CLASSES_ROOT\PSvr.PServer]
@="PServer Object"

[HKEY_CLASSES_ROOT\PSvr.PServer\Clsid]
@="{F38C6374-3F3B-11D3-ADA5-006097B43693}"
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0]
@="PSvr Library"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\0]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\0\win32]
@="C:\\PROGRA~1\\PROFIK~1.0\\PSvr.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\FLAGS]
@="0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{B9A8DFF8-92C2-11D3-990E-00500401C404}\1.0\HELPDIR]
@="C:\\PROGRA~1\\PROFIK~1.0\\"


[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PSvr.PServer]
@="PServer Object"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PSvr.PServer\Clsid]
@="{F38C6374-3F3B-11D3-ADA5-006097B43693}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}]
@="PServer Object"
"AppID"="{F38C6374-3F3B-11D3-ADA5-006097B43693}"
"Sockets"="1"
"Web"="1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\Implemented Categories]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\Implemented Categories\{13E85B3C-9508-11D2-AB63-00C04FA35CFA}]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\LocalServer32]
@="C:\\PROGRA~1\\PROFIK~1.0\\PSvr.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\ProgID]
@="PSvr.PServer"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\TypeLib]
@="{B9A8DFF8-92C2-11D3-990E-00500401C404}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F38C6374-3F3B-11D3-ADA5-006097B43693}\Version]
@="1.0"
Kann mir da jemand weiterhelfen?
Mir würden auch schon ein paar Schlagworte helfen, mit denen ich dann Googlen kann.

Vielen Dank schon mal
Alex
  Mit Zitat antworten Zitat