Environment variable BDSPROJECTSDIR expanding problem

Hello,

today I have installed FinalBuilder 7 and I have problem. I have in my environment variable BDSPROJECTSDIR overriden. This variable is set in system setting. Default value for this variable is: d:\Moje dokumenty\Rad Studio\Projects but on my machine it has value: d:\projects.

In Delphi global library path I have path:

$(BDSPROJECTSDIR)\Jedi\V3-40\Jvcl\lib\D12

 

In this folders are required files but while application compiling in FinalBuilder I have error: JvJclUtils.dcu not found. 

 

I have check project settings saved to App.cfg file. In App.used file I have found wrong value:

d:\Moje dokumenty\Rad Studio\Projects\Jedi\V3-40\JVcl\lib\D12

It should be: d:\Projects\Jedi\V3-40\JVcl\lib\D12

I have also tried set variable value in project settings but this give no effect. In FinalBuilder 6.3 the same settings are working correctly. Other variables by example DXVCL are expanded correctly.

best regards

Adam Siwoń

 

In the FinalBuilder Options dialog, go to the Compilers\Embarcadero Delphi page, on the general options tab, there are a bunch of check boxes that tell Finalbuilder to load up those environment variable overloads.

Posted By Vincent Parrett on 15 Nov 2010 06:44 PM

In the FinalBuilder Options dialog, go to the Compilers\Embarcadero Delphi page, on the general options tab, there are a bunch of check boxes that tell Finalbuilder to load up those environment variable overloads.

I have found this options, but problem occurs everytime - if Use RadStudio XE Environment Variables at StartUp checkbox is checked or is not checked. So what I have to do?

 

best regards

Adam Siwoń

 

Hi Adam

Please try this build : https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_854.exe

The issue was that we provide defaults for some rad studio variables (BDSPROJECTSDIR is one of them) and for DelphiXE it was not registering the override correctly.

Hi Vincent,

In FB7.00.854 problem still exists.

best regards
Adam Siwoń

Where are you using the variable?

Turn on the option in the action to keep the generated .cfg file (on the compiler tab, bottom left), then run the action. That leave a file named [projectfilename].used - open it in notepad and take a look paths it generates for the -U -O -I -R settings, for example in my test I set the BDSPROJECTS env variable in XE to “C:\Users\Vincent\Documents\RAD Studio\NewProjects” and set the library path to “$(BDSLIB)$(Platform)\release;$(BDSUSERDIR)\Imports;$(BDS)\Imports;$(BDSCOMMONDIR)\Dcp;$(BDS)\include;C:\Program Files (x86)\Raize\CS4\Lib\RS-XE;$(BDSPROJECTSDIR)”

-U"E:\CodeGear\RAD Studio\8.0\lib\Win32\release";“C:\Users\Vincent\Documents\Rad Studio\8.0\Imports”;“E:\CodeGear\RAD Studio\8.0\Imports”;“C:\Users\Public\Documents\Rad Studio\8.0\Dcp”;“E:\CodeGear\RAD Studio\8.0\include”;“C:\Program Files (x86)\Raize\CS4\Lib\RS-XE”;“C:\Users\Vincent\Documents\RAD Studio\NewProjects”;

You can see above that $(BDSPROJECTSDIR) was replaced with “C:\Users\Vincent\Documents\RAD Studio\NewProjects”

Hi Vincent

Here is build log fragment:

Log Variable Values [Variables: BDSProjectsDir]
Status: Completed
Date: 2010-11-17
Time: 07:37:32:968
End: 07:37:32:968
Duration: 00:00:00:000

Action Messages:
Current variable values :
BDSProjectsDir = d:\Projects
Success
Build Delphi Win32 Project [ D:\Projects\Transkol\Kalkulator\Source\KalkulatorTT.dpr ]
Status: Error
Date: 2010-11-17
Time: 07:37:32:968
End: 07:37:33:500
Duration: 00:00:00:532

Action Messages:
Generating Resource File…
Including ICON File Adam Siwoń

Hi

I have just spent the last hour trying to reproduce this here, and examining the code to see how it could happen and it’s all working fine for me. I did make some minor changes to the action today to improve scripting support for the delphi specific actions, although I don’t think those changes would impact on the issue you are seeing it is worth a try :

https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_860.exe

Please you send your FinalBuilder project file to support at finalbuilder dot com, please reference this forum topic in the message. Also include the action value of your Delphi library path. That way we can make sure we are testing with the same settings here.

Rad studio variables are virtualized by the Delphi action, because Borland/Codegear/Embarcadero insists on using environment variables with the same name in each different version of delphi. So the Delphi action has it’s own local variable namespace which is keyed by the compiler version. For backwards compatibility when you tell FB to load those environment variable overrides, it also adds an Application variable To FB and that is what you would see in the output of the log. To get see what the actual value is when the action is running, add this line (VBScript) to the BeforeAction script event :

msgbox Action.ExpandExpression("$(BDSPROJECTSDIR)",false)

Hi

I have check FB 7.0.860 version - the problem still exist. I have sent project file to the support. I have also added msgbox command in BeforeAction script. In messagebox is wrong value of BDSPROJECTSDIR variable.

If this is problem to correct this I can just use other environment variable in my projects.


best regards
Adam Siwoń

I have a similar problem here regarding BDSCOMMONDIR. I have both RAD Studio XE3 and Delphi XE7 installed and when I run my Build Delph actions it seems to set BDSCOMMONDIR as

[code]C:\Users\Public\RAD Studio\15.0[/code]

However, in XE7 BDSCOMMONDIR is set as

[code]C:\Users\Public\Embarcadero\Studio\15.0[/code]

If I open the projects up and compile inside the IDE they go to the correct location, only when I do this in FB do they deploy to the incorrect one. Here is what one of the .used files look like

[code]-U[b]'C:\Users\Public\Documents\Rad Studio\15.0\Bpl'[/b];'c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release';C:\Users*****\Documents\Embarcadero\Studio\15.0\Imports;'c:\program files (x86)\embarcadero\studio\15.0\Imports';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;'c:\program files (x86)\embarcadero\studio\15.0\include';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;-O[b]'C:\Users\Public\Documents\Rad Studio\15.0\Bpl'[b];'c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release';C:\Users*\Documents\Embarcadero\Studio\15.0\Imports;'c:\program files (x86)\embarcadero\studio\15.0\Imports';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;'c:\program files (x86)\embarcadero\studio\15.0\include';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;-I[b]'C:\Users\Public\Documents\Rad Studio\15.0\Bpl'[/b];'c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release';C:\Users*\Documents\Embarcadero\Studio\15.0\Imports;'c:\program files (x86)\embarcadero\studio\15.0\Imports';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;'c:\program files (x86)\embarcadero\studio\15.0\include';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;-R[b]'C:\Users\Public\Documents\Rad Studio\15.0\Bpl'[/b];'c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release';C:\Users******\Documents\Embarcadero\Studio\15.0\Imports;'c:\program files (x86)\embarcadero\studio\15.0\Imports';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;'c:\program files (x86)\embarcadero\studio\15.0\include';C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;-$A8-$B–$C±$D–$E–$F–$G±$H±$I±$J–$K–$L–$M–$N±$O±$P±$Q–$R–$S–$T–$U–$V±$W–$X±$Y–$Z1-cg-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE-H±W±$M16384,1048576-K$00400000-NU'D:\mg-trunk\common\compiled Units'-D"RELEASE"-LE[b]"C:\Users\Public\Documents\Rad Studio\15.0\Bpl"[/b]-LN[b]"C:\Users\Public\Documents\Rad Studio\15.0\Dcp"[/b]-NO[b]"C:\Users\Public\Documents\Rad Studio\15.0\Dcp"[/b]-NB[b]"C:\Users\Public\Documents\Rad Studio\15.0\Dcp"[/b]-NH[b]"C:\Users\Public\Documents\Rad Studio\15.0\Dcp"[/b]-NSVcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;[/code]

It would appear this path is generated (I assume by FinalBuilder) as there is an extra backslash in there. Going on what you said about default values, am I correct in assuming that this is FinalBuilder is generating a default BDSCOMMONDIR path?

I have a similar problem here regarding BDSCOMMONDIR. I have both RAD Studio XE3 and Delphi XE7 installed and when I run my Build Delph actions it seems to set BDSCOMMONDIR as

C:\Users\Public\RAD Studio\15.0\

However, in XE7 BDSCOMMONDIR is set as

C:\Users\Public\Embarcadero\Studio\15.0\

If I open the projects up and compile inside the IDE they go to the correct location, only when I do this in FB do they deploy to the incorrect one. Here is what one of the .used files look like

-U’C:\Users\Public\Documents\Rad Studio\15.0\Bpl’;‘c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release’;C:\Users*****\Documents\Embarcadero\Studio\15.0\Imports;‘c:\program files (x86)\embarcadero\studio\15.0\Imports’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;‘c:\program files (x86)\embarcadero\studio\15.0\include’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp; -O’C:\Users\Public\Documents\Rad Studio\15.0\Bpl’;‘c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release’;C:\Users*\Documents\Embarcadero\Studio\15.0\Imports;‘c:\program files (x86)\embarcadero\studio\15.0\Imports’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;‘c:\program files (x86)\embarcadero\studio\15.0\include’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp; -I’C:\Users\Public\Documents\Rad Studio\15.0\Bpl’;‘c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release’;C:\Users*\Documents\Embarcadero\Studio\15.0\Imports;‘c:\program files (x86)\embarcadero\studio\15.0\Imports’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;‘c:\program files (x86)\embarcadero\studio\15.0\include’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp; -R’C:\Users\Public\Documents\Rad Studio\15.0\Bpl’;‘c:\program files (x86)\embarcadero\studio\15.0\lib\Win32\release’;C:\Users******\Documents\Embarcadero\Studio\15.0\Imports;‘c:\program files (x86)\embarcadero\studio\15.0\Imports’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp;‘c:\program files (x86)\embarcadero\studio\15.0\include’;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp; -$A8 -$B- -$C+ -$D- -$E- -$F- -$G+ -$H+ -$I+ -$J- -$K- -$L- -$M- -$N+ -$O+ -$P+ -$Q- -$R- -$S- -$T- -$U- -$V+ -$W- -$X+ -$Y- -$Z1 -cg -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -H+ -W+ -$M16384,1048576 -K$00400000 -NU’D:\mg-trunk\common\compiled Units’ -D"RELEASE" -LE"C:\Users\Public\Documents\Rad Studio\15.0\Bpl" -LN"C:\Users\Public\Documents\Rad Studio\15.0\Dcp" -NO"C:\Users\Public\Documents\Rad Studio\15.0\Dcp" -NB"C:\Users\Public\Documents\Rad Studio\15.0\Dcp" -NH"C:\Users\Public\Documents\Rad Studio\15.0\Dcp" -NSVcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;

It would appear this path is generated (I assume by FinalBuilder) as there is an extra backslash in there. Going on what you said about default values, am I correct in assuming that this is FinalBuilder is generating a default BDSCOMMONDIR path?

This looks like a bug in our XE7 support, I guess we didn’t notice that they changed the folder location to C:\Users\Public\Documents\Embarcadero\Studio\15.0 - will look at it first thing in the morning and get an update out with the fix.

FWIW, we virtualise the rad studio variables because using environment variable does not allow the use of multiple delphi versions.

Hi Vincent,

Thanks that would be great! I had a feeling that it would have something to do with the difference in installs - just when I seen the path generated I could not for the life of me see where it was getting this from as everything was now Embarcadero/Studio/XX.0 rather than Rad Studio/XX.0.

If this bug gets fixed then I won’t need to use an environment variable to set BDSCOMMONDIR, I can just load it from the Delphi installation.

Regards

Hi James,

Great news. The following build has the fix for the issue your seeing.

http://downloads.finalbuilder.com/downloads/finalbuilder/700/FB700_3102.exe

Also note that this is will be official release which I will posting up shortly.

Hi Jason,

Thanks this is now working as expected. However, just one thing I would say about the fix - do you guys hard-code these paths? I noticed that the release note states

  • Bug Fix - Build Delphi Action - Now uses the correct folder location (‘Embarcadero\Studio\15.0’) for XE7 builds.

If so, this would appear a fairly brittle fix. Surely there is a more reliable way, perhaps executing rsvars.bat file?

One other thing, I require the use of BDSCOMMONDIR in a non-Delphi build action (e.g. to copy some files). At the moment I workaround this by replicating BDSCOMMONDIR as a windows environment variable, however, I would have thought enabling the “Load environment variables from X” setting in the compiler options would give me access to this. All it appears to do is load in the Delphi overrides and not the system ones - is this is a bug as well?

Executing rsvars.bat would solve nothing, the values for BDSCOMMONDIR need to be different for each version of delphi, as you have already discovered. The load Environment variables from X setting does not load BDSCOMMONDIR, it loads the values from (for XE7) :

HKEY_CURRENT_USER\Software\Embarcadero\BDS\15.0\Environment Variables

BDSCOMMONDIR is not defined anywhere on the system other than what the older installers added (or didn’t, not sure how it got there). On my machine, which has a bunch of versions of delphi installed it points to C:\Users\Public\Documents\RAD Studio\5.0 - hardly useful for XE7.

In D2010, in the Options, Environment, BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\5.0 - ie the windows env var. I had to add a user override to the correct location. In XE2, BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\9.0 which is correct. It’s virtualizing the environment variable so that it’s not influenced by other versions of delphi - something I begged emb to do for years (long before XE2). In FinalBuilder we do the same. We do this for BDS, BDSUSERDIR, BDSPROJECTSDIR and BDSCOMMONDIR.

BTW, one way to ensure you get the correct value, is to add something like this to the AfterAction script event on the Delphi Action :

[code]TargetDIR = BDSCOMMONDIR [/code]

Where TargetDIR is a project variable. That will capture the value of BDSCOMMONDIR for the version of delphi you are using.