Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-16-2009, 04:53 AM
tgr tgr is online now
Registered User
 
Join Date: 05-13-2009
Posts: 7
Problems building mixed Delphi 2007 / 2009 project

I have a project including both Delphi 2007 and Delphi 2009 steps.

The Delphi 2009 step builds fine.

The problem is the Delphi 2007 step -- MsBuild reports 2 errors. After some experimenting, I found that the command line created by Visual Build Pro refers to the wrong folder for rsvars.bat:

cmd /c "@echo off&"C:\Program Files (x86)\CodeGear\RAD Studio\6.0\Bin\rsvars.bat"&C:\Windows\Microsoft.NE T\Framework\v2.0.50727\MSBuild.exe C:\Temp\Project1.dproj /p:Configuration=Release||exit -1"

The correct statement should be:
cmd /c "@echo off&"C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat"&C:\Windows\Microsoft.NE T\Framework\v2.0.50727\MSBuild.exe C:\Temp\Project1.dproj /p:Configuration=Release||exit -1"

Is there a way to force Visual Build Pro to use the correct rsvars.bat?

Thanks, Trond

Last edited by tgr; 05-16-2009 at 11:30 AM.
Reply With Quote
  #2  
Old 05-18-2009, 07:52 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The Make Delphi action determines that path by finding the highest version key in the registry under

HKEY_LOCAL_MACHINE\SOFTWARE\CodeGear\BDS

(for D2009, it's 6.0) and reading the RootDir value from that key. You could temporarily update this registry value to point to D2007 before building D2007 projects, then change it back to the D2009 path afterwards.
http://www.kinook.com/VisBuildPro/Ma...teregistry.htm
Reply With Quote
  #3  
Old 05-18-2009, 12:29 PM
tgr tgr is online now
Registered User
 
Join Date: 05-13-2009
Posts: 7
Thank you for the suggestion.

I checked a couple of PCs, and found the keys for Delphi 2007 and 2009 under:

HKEY_CURRENT_USER\Software\Borland\BDS\5.0

and

HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0

(I guess it depends on the choices made during installation whether these keys are located under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER.)

So changing
HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\RootDi r
to temporarily point to the Delphi 2007 folder should do the trick?


Anyway, I tried another (possibly less elegant) solution while experimenting with this:

1) Setting the "Don't build the project(s), but update any other properties that are chosen" to ON

2) Adding a Run Program step with the modified cmd statement

This works partly ok. -- The version info doesn't get updated when I uncheck the "Don't build the project(s), but update any other properties that are chosen".

Regards,
Trond
Reply With Quote
  #4  
Old 05-18-2009, 12:44 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The Make Delphi action looks only under HKEY_LOCAL_MACHINE, not HKEY_CURRENT_USER.

Another option would be to check 'Do not run rsvars.bat before MSBuild' on the Options tab and specify the appropriate rsvars.bat command in the 'Command to run before main command' field on the Advanced tab.

http://www.kinook.com/VisBuildPro/Ma...optionstab.htm
http://www.kinook.com/VisBuildPro/Ma...dvancedtab.htm
Reply With Quote
  #5  
Old 05-18-2009, 01:20 PM
tgr tgr is online now
Registered User
 
Join Date: 05-13-2009
Posts: 7
Thanks for the suggestion.

I tried the follwing settings:

Override the default location of the command-line compiler executable:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBu ild.exe

Do not run rsvars.bat befor MSBuild:
Checked

Command to run before main command:
C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat

...but the resulting command line fails:
cmd /c C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat&"C:\Program Files (x86)\CodeGear\RAD Studio\6.0\Bin\brcc32.exe" Test2007.vrc -foC:\Temp\VisualBuildPro\Test2007.vres

... and actually looks quite different from what I expected:
cmd /c "@echo off&"C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat"&C:\Windows\Microsoft.NE T\Framework\v2.0.50727\MSBuild.exe C:\Temp\Project1.dproj /p:Configuration=Release||exit -1"

Regards, Trond
Reply With Quote
  #6  
Old 05-18-2009, 01:40 PM
tgr tgr is online now
Registered User
 
Join Date: 05-13-2009
Posts: 7
Further to the location of the registry keys:

I just checked and older PC running Windows XP with Delphi 2007 installed, and found the keys under HKEY_LOCAL_MACHINE as you describe it.

On my two Vista 64 PCs there is no HKEY_CURRENT_USER\Software\CodeGear section.

Regards,
Trond
Reply With Quote
  #7  
Old 05-18-2009, 04:06 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
If version/property changes are specified, the Make Delphi action first updates the project .res file (using brcc32.exe) before building.
http://www.kinook.com/VisBuildPro/Ma...lphiaction.htm

Try putting double quotes around the .bat filename:

"C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat"

If that doesn't help, please provide the error information. Thanks.
Reply With Quote
  #8  
Old 05-19-2009, 10:46 AM
tgr tgr is online now
Registered User
 
Join Date: 05-13-2009
Posts: 7
Adding the quotes still fails. See error messages below:


19.05.2009 17:41:21: --------------------Starting Build: 'Testproject-1.bld'--------------------
19.05.2009 17:41:21: Building project step 1 - Build Application...
19.05.2009 17:41:21: Building project step 3 - Make Delphi 2007 project...
incrementing version...compiling VERSIONINFO RC file...
cmd /c "C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat" &"C:\Program Files (x86)\CodeGear\RAD Studio\6.0\Bin\brcc32.exe" Test2007.vrc -foC:\Temp\VisualBuildPro\Test2007.vres
C:\Program is not recognized as an internal or external command,
operable program or batch file.

Process completed with exit code 1
19.05.2009 17:41:21: Step '3 - Make Delphi 2007 project' failed
19.05.2009 17:41:21: Build successfully completed.


Regards,
Trond
Reply With Quote
  #9  
Old 05-19-2009, 12:32 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Looks like two double quotes are needed at the beginning.

""C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat"
Reply With Quote
  #10  
Old 05-19-2009, 01:01 PM
tgr tgr is online now
Registered User
 
Join Date: 05-13-2009
Posts: 7
No, that still doesn't do it:

19.05.2009 19:37:57: --------------------Starting Build: 'Testproject-1.bld'--------------------
19.05.2009 19:37:57: Building project step 3 - Make Delphi 2007 project...
incrementing version...compiling VERSIONINFO RC file...
cmd /c ""C:\Program Files (x86)\CodeGear\RAD Studio\5.0\Bin\rsvars.bat"&"C:\Program Files (x86)\CodeGear\RAD Studio\6.0\Bin\brcc32.exe" Test2007.vrc -foC:\Temp\VisualBuildPro\Test2007.vres
Setting environment for using CodeGear RAD Studio tools
Filnavnet, mappenavnet eller volumnavnesyntaksen er feil.

Process completed with exit code 1
19.05.2009 19:37:58: Step '3 - Make Delphi 2007 project' failed
19.05.2009 19:37:58: Build successfully completed.
Reply With Quote
  #11  
Old 05-19-2009, 04:15 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Strange, it works ok here. You may need to use the other workaround for now (create/update registry value). We'll also consider adding an option to specify the rsvars.bat location, which overrides the default.
Reply With Quote
  #12  
Old 05-19-2009, 04:38 PM
tgr tgr is online now
Registered User
 
Join Date: 05-13-2009
Posts: 7
Ok. The other solution works just great so I'm fine for now. Adding a custom override for the rsvars.bat location, sounds like a good idea.

Thanks a lot,
Trond
Reply With Quote
  #13  
Old 10-14-2009, 06:11 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
This is available in v7.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 12:58 AM.


Copyright © 1999-2023 Kinook Software, Inc.