Post-build event command issue, command line build

This forum is for all Flare issues not related to any of the other categories.
Post Reply
0Qq5Ew538tV
Propeller Head
Posts: 17
Joined: Wed Jun 06, 2018 11:51 am

Post-build event command issue, command line build

Post by 0Qq5Ew538tV »

We have a post-build event command set up for a target that just echos variables to a file.

This is the command:

Code: Select all

echo "$(TargetName)|$(ProjectDirectory)|$(OutputDirectory)" > %appdata%\mcoutput.fldat
On my machine, I can build targets via the GUI in Flare and also via the command line, and the post-build event command always completes successfully. However, on my co-worker's machine, the post-build event command only completes successfully if he builds the target from within the Flare GUI. If he builds the target from the command line he receives an error:

Code: Select all

Running Post-Build Event Command...
Run Command Error: 'echo' is not recognized as an internal or external command,
Run Command Error: operable program or batch file.
What could be causing this issue? I know it's not an issue with the actual post-build event command because it works on my machine. I don't think it's an environment variable issue since he has the exact same environment variables configured that I do. Also echo does work on his command line as we tested it to confirm. We're not sure what could be causing this issue and we've run out of things to troubleshoot, can anyone provide some suggestions?
0Qq5Ew538tV
Propeller Head
Posts: 17
Joined: Wed Jun 06, 2018 11:51 am

Re: Post-build event command issue, command line build

Post by 0Qq5Ew538tV »

Does anyone have any ideas? We're still experiencing the issue.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Post-build event command issue, command line build

Post by ChoccieMuffin »

Does he have permission to write to the location specified? That's the only thing I could think of.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
cameronm
Jr. Propeller Head
Posts: 5
Joined: Sun Apr 10, 2016 9:57 pm

Re: Post-build event command issue, command line build

Post by cameronm »

I'm having the same issue, with the only difference being that the 'other user' in my case is an on prem azure pipeline agent. I've seen the error with various standard cmd.exe commands: if, cd, echo.

Did you ever get to the bottom of this? Was it permissions related?
honzik
Jr. Propeller Head
Posts: 3
Joined: Fri Dec 15, 2017 2:34 am

Re: Post-build event command issue, command line build

Post by honzik »

I'm getting this error as well.
honzik
Jr. Propeller Head
Posts: 3
Joined: Fri Dec 15, 2017 2:34 am

Re: Post-build event command issue, command line build

Post by honzik »

I've got a workaround...But first to deal with the cause. When I looked at the Azure pipeline logs I saw that *something* had inserted an invisible Unicode character (<0xfeff> )before the first character of the first command in the post-build event. This looks like a BOM problem.

The workaround which I've tested on an on-prem Azure agent: insert a dummy command as the first line of your build even and redirect it.

I've got:

Code: Select all

gibberish 2> NUL 
as my first line, with the real commands following on the next line. This clears the warning from the log and DevOps reports it as a clean build.
Post Reply