AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Packages in anderem Verzeichnis

Ein Thema von hschmid67 · begonnen am 22. Sep 2024 · letzter Beitrag vom 24. Sep 2024
Antwort Antwort
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.586 Beiträge
 
Delphi 12 Athens
 
#1

AW: Packages in anderem Verzeichnis

  Alt 23. Sep 2024, 19:08
Delphi-Quellcode:
  var Environment := TStringList.Create;
  Environment.TrailingLineBreak := True;
  Environment.LineBreak := #0;

  //Environment.StrictDelimiter := True;
  //Environment.Delimiter := #0;
  //Environment.DelimitedText := GetEnvironmentStrings;
  var P := GetEnvironmentStrings;
  var S: String;
  while P <> 'do begin
    Environment.Add(P);
    Inc(P, Succ(Length(P)));
  end;

  Environment.Values['PATH'] := Environment.Values['PATH'] + ';' + TPath.Combine(TPath.GetAppPath, 'Version_1.0.0');

  var Test := Environment.Text;
  //CreateProcess(ApplicationName, CommandLine, ProcessAttributes, ThreadAttributes, InheritHandles, CreationFlags, PChar(Environment.Text), CurrentDirectory, StartupInfo, ProcessInformation);
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
461 Beiträge
 
#2

AW: Packages in anderem Verzeichnis

  Alt 24. Sep 2024, 07:34
Delphi-Quellcode:
  var Environment := TStringList.Create;
  Environment.TrailingLineBreak := True;
  Environment.LineBreak := #0;

  //Environment.StrictDelimiter := True;
  //Environment.Delimiter := #0;
  //Environment.DelimitedText := GetEnvironmentStrings;
  var P := GetEnvironmentStrings;
  var S: String;
  while P <> 'do begin
    Environment.Add(P);
    Inc(P, Succ(Length(P)));
  end;

  Environment.Values['PATH'] := Environment.Values['PATH'] + ';' + TPath.Combine(TPath.GetAppPath, 'Version_1.0.0');

  var Test := Environment.Text;
  //CreateProcess(ApplicationName, CommandLine, ProcessAttributes, ThreadAttributes, InheritHandles, CreationFlags, PChar(Environment.Text), CurrentDirectory, StartupInfo, ProcessInformation);
Well, that is nice !

Alas, i can't repeat it on my XE8, and neither it will work on older versions.

On side note: Environment.Text should add an extra null char (two zeros bytes when used with CreateProcess), so it should be PChar(Environment.Text + #0), of course assuming the last line has the null terminator, if not then it should be added also, and that honestly because i never used StringList with #0 as LineBreak, it gives me goosebumps.
Kas
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:44 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz