Autor Beitrag
blaskito
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63

Win2003, 2008, 2012, WinXP, Win7
Delphi 6 Pers.
BeitragVerfasst: Mi 12.05.10 22:25 
Hallo,

ich musste jetzt feststellen, dass die Eigenschaft ParamCount bei einem Service scheinbar nur beim regulären Starten des Dienstes funzt. Nun wollte ich aber beim /install einige Parameter mitgeben, um sie gleich in der Registry zu verewigen. ParamCount steht dann aber immer auf 0. Gibt es überhaupt einen Weg, an alle Parameter heranzukommen, die beim Parameter /install zusätzlich mit angegeben werden?

Gruß aus dem Norden
blaskito
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 13.05.10 12:17 
Moin!

Spannende Frage: ist die VCL mit im Spiel (TService/TServiceApplication)? Oder machst du die Anbindung an den SCM selbst?

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
blaskito Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63

Win2003, 2008, 2012, WinXP, Win7
Delphi 6 Pers.
BeitragVerfasst: Fr 14.05.10 08:33 
Hi,

es ist TService.

Gruß
blaskito
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 14.05.10 09:27 
Moin!

Über die Variable CmdLine hast du Zugriff auf die Kommandozeile, mit der die Anwendung gestartet wurde. Schonmal da selbst reingesehen? :nixweiss:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
blaskito Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63

Win2003, 2008, 2012, WinXP, Win7
Delphi 6 Pers.
BeitragVerfasst: Fr 14.05.10 09:33 
Ich habe bis jetzt raus, dass über ParamStr die Parameter auch abgefragt werden können, nur ist halt ParamCount immer 0. Ich bräuchte also nur bis zum Auftreten eines Fehler ParamStr abzufragen, was ich persönlich nicht so elegant finde.

Ich werde mich jetzt erstmal mit CmdLine befassen, vielleicht habe ich darüber mehr Glück. Ergebnis wird gepostet.

Danke + Gruß
blasikto
blaskito Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63

Win2003, 2008, 2012, WinXP, Win7
Delphi 6 Pers.
BeitragVerfasst: So 16.05.10 21:53 
Manchmal sieht man den Wald vor lauter Bäumen nicht :oops: !
Es ist doch so einfach:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
for i:=1 to 10 do begin
  if ParamStr(i)='' then break;
  ....
end;