RAD Studio 2010 project build using MSBuild works fine when I build it locally. Subprojects that build BPL files end up under C:\Users\Public\Documents\RAD Studio\7.0 like it's supposed to since no other output directory is set.

When building using TeamCity it all fell apart. Complaining it could not find BPL files generated by subprojects. Looking in the directory where it should end up nothing was created there. Instead, the BPL files ended up in the projects directory.

After scratching my head, checking environment variables etc and all the BDSCOMMONDIR and similar variables are set etc it dawned on me that the TeamCity build Agent was running as the SYSTEM account. I opened a command prompt as the SYSTEM account using

PsExec.exe -i -s cmd.exe

I checked environment variables again, they all existed for the account. Started a build locally as SYSTEM and the same issue. BPL files in the project directory instead of the default folder, subsequent projects not finding the BPL files since they look in the default location, build failed.

But why?

Using another user it compiles fine and running the TeamCity build agent as that user enables TeamCity to finish the build correctly to.

0

There are 0 best solutions below