View Issue Details

IDProjectCategoryView StatusLast Update
0005513JEDI Code LibraryJclIDEUtilspublic2012-02-25 21:14
ReporterdeboseAssigned Tooutchy 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionVersion 2.3 
Target VersionFixed in VersionVersion 2.3 
Summary0005513: GetEnvironmentVariables (in TJclBDSInstallation) does not have values for some variables of Delphi XE: $(BDSLIB), $(Platform)
DescriptionJust found, that method GetEnvironmentVariables of TJclBDSInstallation does not return values for some Enviroinment variables that appeared in DelphiXE.
These are: $(BDSLIB), $(Platform)

These variables are used in default configuration of Delphi XE to specify search path for default Library.

1) $(BDSLIB)\$(Platform)\release
2) $(BDSLIB)\$(Platform)\debug

which are equal to
1) C:\Program Files\Embarcadero\RAD Studio\8.0\lib\win32\release
2) C:\Program Files\Embarcadero\RAD Studio\8.0\lib\win32\debug

Tested with rev 3402.
Additional InformationI investigated this problem a little. These variables can't be retrieved from registry. Also they are not specified in RAD Studio Command Prompt of Delphi XE.

TagsJcl, XE
Fixed in GIT commit
Fixed in SVN revision3573
IDE versionDelphi/C++Builder 2010

Activities

2011-03-18 09:18

 

JclIDEUtils_GetEnvVar_BdsLib.patch (1,093 bytes)
Index: JclIDEUtils.pas
===================================================================
--- JclIDEUtils.pas	(revision 3506)
+++ JclIDEUtils.pas	(working copy)
@@ -812,6 +812,8 @@
   EnvVariableBDSValueName    = 'BDS';
   EnvVariableBDSPROJDIRValueName = 'BDSPROJECTSDIR';
   EnvVariableBDSCOMDIRValueName = 'BDSCOMMONDIR';
+  EnvVariableBDSLIBValueName = 'BDSLIB';
+  EnvVariablePLatformValueName = 'Platform';
   KnownPackagesKeyName       = 'Known Packages';
   KnownIDEPackagesKeyName    = 'Known IDE Packages';
   ExpertsKeyName             = 'Experts';
@@ -3458,6 +3460,11 @@
       Result.Values[EnvVariableBDSPROJDIRValueName] := DefaultProjectsDir;
     if Result.Values[EnvVariableBDSCOMDIRValueName] = '' then
       Result.Values[EnvVariableBDSCOMDIRValueName] := CommonProjectsDir;
+
+    if Result.Values[EnvVariableBDSLIBValueName] = '' then
+      Result.Values[EnvVariableBDSLIBValueName] := PathAddSeparator(RootDir) + 'lib';
+    if Result.Values[EnvVariablePLatformValueName] = '' then
+      Result.Values[EnvVariablePLatformValueName] := 'win32';
   end;
 end;
 

debose

2011-03-18 09:19

reporter   ~0018458

Added patch to fix that.
Note: no checks on Delphi version are performed. Hope this won't cause any troubles.

2011-03-19 14:46

 

JclIDEUtils_GetEnvVar_BdsLib2.patch (1,252 bytes)
Index: JclIDEUtils.pas
===================================================================
--- JclIDEUtils.pas	(revision 3506)
+++ JclIDEUtils.pas	(working copy)
@@ -812,6 +812,8 @@
   EnvVariableBDSValueName    = 'BDS';
   EnvVariableBDSPROJDIRValueName = 'BDSPROJECTSDIR';
   EnvVariableBDSCOMDIRValueName = 'BDSCOMMONDIR';
+  EnvVariableBDSLIBValueName = 'BDSLIB';
+  EnvVariablePLatformValueName = 'Platform';
   KnownPackagesKeyName       = 'Known Packages';
   KnownIDEPackagesKeyName    = 'Known IDE Packages';
   ExpertsKeyName             = 'Experts';
@@ -3458,6 +3460,15 @@
       Result.Values[EnvVariableBDSPROJDIRValueName] := DefaultProjectsDir;
     if Result.Values[EnvVariableBDSCOMDIRValueName] = '' then
       Result.Values[EnvVariableBDSCOMDIRValueName] := CommonProjectsDir;
+
+    if VersionNumber >= 8 then
+    begin
+      { TODO : For crossplatform Delphi version check/change $(BDSLIB) and $(platform) values. }
+      if Result.Values[EnvVariableBDSLIBValueName] = '' then
+        Result.Values[EnvVariableBDSLIBValueName] := PathAddSeparator(RootDir) + 'lib';
+      if Result.Values[EnvVariablePLatformValueName] = '' then
+        Result.Values[EnvVariablePLatformValueName] := 'win32';
+    end;
   end;
 end;
 

debose

2011-03-19 14:46

reporter   ~0018459

Added 2nd version of the patch with BDS version check. JclIDEUtils_GetEnvVar_BdsLib2.patch

outchy

2011-03-24 10:31

administrator   ~0018469

ok for $(BDSLIB), but $(Platform) depends on the target OS. It is project specific.

debose

2011-03-24 10:43

reporter   ~0018470

> but $(Platform) depends on the target OS. It is project specific.
Is it actually?

I suppose Delphi XE has libraries only for win32 platform.

Anyway I asked friend to check his installation of Delphi XE on 64bit windows, and he approved that there is also "win32" folder.

debose

2011-03-24 10:44

reporter   ~0018471

but i believe, that in Delphi XE 2, $(platform) can take other values. F.e. "win64" and "macos".

debose

2011-03-30 10:11

reporter   ~0018476

Note: I suppose, you can't reproduce this bug, running code in Delphi XE, cause Delphi XE adds these enviroinment variables.
So, code should be run either from outside of Delphi XE, or from older version of Delphi.

outchy

2011-08-13 00:47

administrator   ~0018869

Actually you can switch the active platform/configuration by settings properties in MsBuild command line. These settings are not strongly set by the project file, the project file contains configuration for all possible platform/configuration pairs.

I've just committed a parser for MsBuild files in revision 3573, it should be able to give more accurate results about the default platform/configuration for each project.

outchy

2011-08-17 09:03

administrator   ~0018875

This new MsBuild project can be used to parse EnvOptions.proj or CodeGear.Delphi.Targets that will return the right values for these environment variables. Note that they are now automatically expanded when encountered in an MsBuild project file.

debose

2012-02-25 06:49

reporter   ~0019550

Some variables may still be undefined (see: http://issuetracker.delphi-jedi.org/view.php?id=5809)

Is it possible to get Env. variables from "srsvars.bat" for each installation, to avoid cases when some variables may still be empty? These values can also be passed to MsBuild parser, but MsBuild parser can try to overwrite them.

p.s. srsvars.bat is used in TJclBDSInstallation.GetCommonProjectsDirectory

outchy

2012-02-25 21:14

administrator   ~0019554

Please follow-up in http://issuetracker.delphi-jedi.org/view.php?id=5809
The original issue is definitively fixed. Revision 3749 introduces TJclBDSInstallation.GetRsVars to return environment variables as after RsVars.bat is executed.

Issue History

Date Modified Username Field Change
2011-03-14 00:27 debose New Issue
2011-03-14 00:27 debose IDE version => Delphi/C++Builder XE
2011-03-14 00:28 debose Tag Attached: Jcl
2011-03-14 00:28 debose Tag Attached: XE
2011-03-18 09:18 debose File Added: JclIDEUtils_GetEnvVar_BdsLib.patch
2011-03-18 09:19 debose Note Added: 0018458
2011-03-19 14:46 debose File Added: JclIDEUtils_GetEnvVar_BdsLib2.patch
2011-03-19 14:46 debose Note Added: 0018459
2011-03-23 22:46 outchy Category JclBorlandTools => JclIDEUtils
2011-03-24 10:31 outchy Note Added: 0018469
2011-03-24 10:43 debose Note Added: 0018470
2011-03-24 10:44 debose Note Added: 0018471
2011-03-30 10:11 debose Note Added: 0018476
2011-08-13 00:47 outchy Note Added: 0018869
2011-08-17 09:03 outchy Note Added: 0018875
2011-08-17 09:03 outchy Assigned To => outchy
2011-08-17 09:03 outchy Status new => feedback
2011-09-29 21:55 outchy Fixed in revision => 3573
2011-09-29 21:55 outchy Status feedback => resolved
2011-09-29 21:55 outchy Fixed in Version => Version 2.3
2011-09-29 21:55 outchy Resolution open => fixed
2012-02-25 06:48 debose IDE version Delphi/C++Builder XE => Delphi/C++Builder 2010
2012-02-25 06:49 debose Note Added: 0019550
2012-02-25 06:49 debose Status resolved => feedback
2012-02-25 06:49 debose Resolution fixed => reopened
2012-02-25 21:14 outchy Note Added: 0019554
2012-02-25 21:14 outchy Status feedback => resolved
2012-02-25 21:14 outchy Resolution reopened => fixed