Kinook Software Forum

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

Reply
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
  #1  
Old 03-06-2003, 09:34 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Passing a path as a macro to another project

I have a Visual Build Project that uses a temporary macro %SourceDir% to decide where the check data out to. This works fine if I run the project on its own. However if I try to call that VBP project from another and pass it the %SourceDir% macro from the parent project I get a messagebox that states "The system cannot find the specified file".

If I put some other value in that is not a directory it does not give me this messagebox but still fails because it is not a directory (expected).

Here is the command line that is being called from the VBP project:

"C:\Program Files\VisBuildPro\VisBuildPro.exe" "SourceDir=c:\develop\" /b "C:\develop\Visual Build Pro\FormsPartnerHelp.bld"

How do I pass a directory as a macro?

Thanks in advance,
Eric Eicke
Reply With Quote
  #2  
Old 03-06-2003, 09:37 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
This is a result of a standard feature of command-line parameters. When a backslash char is followed by a double quote char, \" is treated as a literal quote (to allow the insertion of double quote characters rather treating as an end-of-parameter marker).

When actions such as the VisBuildPro Project action generate the command-line to be called, it wraps parameter values in double quotes so that if it contains spaces, the entire value will be treated as a single parameter. But if the parameter value happens to end with a backslash, it leads to the \" situation, and the remaining parameters get messed up since that double quote isn't treated as an end-of-parameter marker. In the next release, custom actions that generate commands will be fixed to only wrap with double quotes if a parameter actually contains spaces, and to change \" to \\" when a parameter does contain spaces and end in a backslash. For now, you can either remove the backslash from your macro value (and add after the places it is referenced) or add another double backslash so that the command ends up like:

... "SourceDir=c:\develop\\" ...
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 06:32 PM.


Copyright © 1999-2023 Kinook Software, Inc.