Kinook Software Forum

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-04-2011, 01:44 PM
deramor deramor is online now
Registered User
 
Join Date: 05-11-2011
Posts: 27
Write XML: Xpath not found but I don't want the step to fail

Hello-

I am using the Write XML project step to remove Source Safe information from Visual Studio project files. I basically find the XML fields and NULL them.

This works fine when the project file I am looking at has source control information in it. When this information is not present, the XML fields are not there for me to NULL. This causes the step to fail since the XPath I used was not found. The step failure is not important to me for this reason but for other reasons it would be. Is there any way to have this step continue when the XPath is not found but fail in all other cases?

Simply marking the step to continue and not execute failure steps is not a good alternative.

I have in the past edited a single step's script to pass a step for a particular exit code:

Sub vbld_StepDone()
If CLng(Application.ExpandMacros("%RUNPROGRAM_EXITCOD E%")) = -1073741819 Then
Step.BuildStatus = vbldStepStatSucceeded
End If
End Sub

However I see no macro that is created with an exit code for me to work with in this instance. The above edit was to work around a problem with InstallShield which apparently uses the run program project step underneath which in turn generates the %RUNPROGRAM_EXITCODE% macro as part of its execution. I do see the LASTSTEP_STATUS but it seems to be only a pass/fail value rather than an exit code.

Thanks-
Rob
Reply With Quote
  #2  
Old 10-04-2011, 06:37 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The Write XML action does not run a program, so there is no exit code. You could use the READ_XML system macro to conditionally build the step only if the XPath expression is found in the file.
http://www.kinook.com/VisBuildPro/Ma...stemmacros.htm
http://www.kinook.com/VisBuildPro/Manual/buildrules.htm
Reply With Quote
  #3  
Old 10-05-2011, 10:57 AM
deramor deramor is online now
Registered User
 
Join Date: 05-11-2011
Posts: 27
Ah that makes sense. Thanks for pointing out the obvious workaround.
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 04:24 PM.


Copyright © 1999-2023 Kinook Software, Inc.