Command Line Build batch file

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.

Command Line Build batch file

Postby SteveS on Tue Aug 15, 2006 10:31 pm

Fellow Propellor Heads

I've created a batch file for using the command line method of building projects and thought the nice thing would be to share.

You'll probably want to change the log file location.

Feel free to use it as you wish, but there are no guarantees, use it at your own risk :)
Code: Select all
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Batch file to automate building Flare Outputs            ::
:: Accepts Flare Project as parameter                       ::
:: Drag and drop project onto shortcut or batch file icon   ::
::                                                          ::
:: Created 16 Aug 2006 by Steve Salter                      ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

:: Set CLI window title
Title Building Project

:: Show user something happened
echo Building project outputs, please wait

:: Change to Flare directory
cd C:\\Program Files\\Madcap Software\\Madcap Flare\\Flare.app

:: Create log
echo Project building started > c:\\temp\\madbuild.txt
echo. | date | find /I \"Current\" >> c:\\temp\\madbuild.txt
echo. | time | find /I \"Current\" >> c:\\temp\\madbuild.txt

:: Build project(s)
madbuild -project %1 >> c:\\temp\\madbuild.txt

:: Add completion time to log
echo Project building completed >> c:\\temp\\madbuild.txt
echo. | time | find /I \"Current\" >> c:\\temp\\madbuild.txt


With my larger projects I now have more than enough time to get a Starbucks while a CLI dominates my desktop :wink:
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
SteveS
Propellus Maximus
 
Posts: 1522
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).

Postby RamonS on Wed Aug 16, 2006 6:01 am

Richard, Kevin, can we get this transferred to the KB before it disappears in the forum's nirvana?

For those who manage their help sources via source control, add CLI batch code to pull the sources from the source control. Our build engineer did this with great success, except that with RHX5 command line compiles of help were not possible. Now, Flare can do it, Yeah!! 8)

Just, can't you add some simple UI component to Flare that integrates with common source control systems. As far as I know CLI commands are available for all the major systems and should be fairly easy to be implemented in Flare...says me who programmed oh so many applications. :wink:
RamonS
Senior Propellus Maximus
 
Posts: 3728
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Postby SteveS on Tue Sep 05, 2006 10:58 pm

Been building projects madly and have come up with a request (if anyone is listening?)

When you use the build button, or the command line, the flag the view button uses isn't reset. So, if you build your project (or individual target) and then click the view target button it reports the target isn't up to date. Annoying with a large build. :?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
SteveS
Propellus Maximus
 
Posts: 1522
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).

Problems viewing built output.

Postby claydevin on Wed Sep 06, 2006 10:12 am

That is a handy batch file, thanks.
So when the command line build completes, how does a person see the changes in the output? After successfully running a Madbuild for all targets I press the \"View the Primary Target\" button and it says the Webhelp Target is not up-to-date. After clicking No, the help displayed is that of the last time I pressed the build button, not that of the last command line build.

hope this makes sense.
claydevin
Jr. Propeller Head
 
Posts: 2
Joined: Mon Apr 24, 2006 2:29 pm

Postby SteveS on Wed Sep 06, 2006 4:20 pm

My builds are in the output -> my name -> target name directory.

I've just tested and the directories refreshed. What have you specified for build targets etc?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
SteveS
Propellus Maximus
 
Posts: 1522
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).

Postby claydevin on Thu Sep 07, 2006 2:22 pm

I cleaned out all the output files and changed the 'Output Folder' in the Targets to simple paths all in the same folder. Not sure why the output was being buried into deeper folders but all is better now.
Thanks for the post(s).
claydevin
Jr. Propeller Head
 
Posts: 2
Joined: Mon Apr 24, 2006 2:29 pm

Invalid registration code error

Postby TheGreatAndPowerfulOz on Tue Jan 16, 2007 8:08 pm

SteveS,

Thanks for the batch file posting. I've been looking for some way to do this with Flare (was hoping there'd be a front-end \"batch build/publish\", like in RH).

I was all excited to try it out, but was disappointed to get the following error on attempting to execute the BAT file:

Code: Select all
Your MadCap Flare registration code is invalid.

I know darned well that my product is registered; my company's accounting department can attest to that! Any idea why I might be getting the error? Is this a known issue, perhaps, for which there's some sort of workaround?

Oh, forgot to mention that I still haven't upgraded to v2.0 of Flare. We've downloaded the setup package, but our IT group hasn't got around to scheduling the install for me yet. If the issue I'm seeing was \"known\", perhaps it's been addressed in v2.0?

Any suggestions you (or anyone else) could offer would be greatly appreciated.

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 67
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Invalid registration code

Postby SteveS on Tue Jan 16, 2007 8:16 pm

Might be one for Rick or Neal - the thing that springs to mind is the command line build, which the batch file calls, is disabled in the trial version. Something screwy with your installation? :?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
SteveS
Propellus Maximus
 
Posts: 1522
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).

Postby TheGreatAndPowerfulOz on Tue Jan 16, 2007 8:56 pm

Thanks for the zippy response! Nothing out of the ordinary with the installation, as far as I know. I can live with building one target at a time until our IT gang gets around to installing v2.0 for me. I plan on having the two versions \"co-exist\" on my machine for a while, just to make sure everything goes alright, so I'll try the batch command with 2.0 to see if I get the same issue.

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 67
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Postby Richard Ferrell on Wed Jan 17, 2007 7:30 am

I've seen this issue sometimes if your company has a firewall, Let me know if its still is happening in version 2.0
Richard Ferrell

Certified Madcap Trainer
Image
Richard Ferrell
Propellus Majorus
 
Posts: 837
Joined: Mon May 01, 2006 10:11 am
Location: SomeWhere in Arizona

Batch file on steroids

Postby TheGreatAndPowerfulOz on Thu Jan 18, 2007 12:14 am

All,

I'm glad to report that I got Flare v2.0 installed today and all is going well with the command line build process!

I figured I'd have a little fun with batch files \"while I was at it\" and came up with quite a spiffy one, based on the one posted here by Steve Salter. This file allows you to list as many of your Targets as you want as parameters, then when you run it, you can choose which one to build (or to build all Targets in the Project). I also tossed in an option dialogue for overwriting vs. appending the log file.

Just like Steve's file, mine is free for the taking. It is also as is, so use at your own risk! I've tested it against my own project and all is working swimmingly. I'm actually running it right now to build all my targets at once!

I was going to include the code here in my post, but it seems that there may be a character limit to what one is allowed to place inside the Code tag (looked OK in the Preview, but then got all messed up when I hit Submit). I'll try it again, but if it doesn't work I guess anyone interested in the batch file can contact me so I can e-mail it to you. I don't see a way to upload/attach a file here, either. :(

If you want the interface to look a bit \"nicer\" (as nice as a DOS window can look), make a shortcut on the Desktop to the .BAT file you create, then right-click it and set the Properties as follows:
    Shortcut tab: Press the Change Icon... button and point to the icon at \"%ProgramFiles%\\MadCap Software\\MadCap Flare V2\\Flare.app\\Flare.exe\"

    Layout tab: Set the Width to 70 and Height to 30 for both the Screen buffer size and the Window size

Thanks to all who offered input as to how to get the command line functionality going for me!

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 67
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Postby Richard Ferrell on Thu Jan 18, 2007 8:24 am

If you want to email it to me, I can create a Knowledge base article of it, and SteveS batch file, Of course giving you credit for it :)

Click on the Email Button and send it to me

Thanks!
Richard Ferrell

Certified Madcap Trainer
Image
Richard Ferrell
Propellus Majorus
 
Posts: 837
Joined: Mon May 01, 2006 10:11 am
Location: SomeWhere in Arizona

Postby TheGreatAndPowerfulOz on Thu Jan 18, 2007 8:26 am

Richard,

I've decided to tweak a few little things before I \"go public\", so I'll probably e-mail the BAT file to you within another day or so. Thanks!

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 67
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Postby Richard Ferrell on Thu Jan 18, 2007 8:48 am

Looking forward to seeing it, Thank you
Richard Ferrell

Certified Madcap Trainer
Image
Richard Ferrell
Propellus Majorus
 
Posts: 837
Joined: Mon May 01, 2006 10:11 am
Location: SomeWhere in Arizona

Re: Problems viewing built output.

Postby TheGreatAndPowerfulOz on Fri Jan 19, 2007 7:39 am

claydevin wrote:... After successfully running a Madbuild for all targets I press the "View the Primary Target" button and it says the Webhelp Target is not up-to-date...


Through a little investigative work while creating my own batch file (I've e-mailed it to Richard Ferrell, by the way), I discovered that when you don't specify a target while running the command line build (when you build all targets), the flag that indicates "up-to-date-edness" is NOT flipped. If you DO specify a target, the flag IS flipped, so subsequent attempts to view or publish will reflect that output is up-to-date.

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 67
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Postby BVega_LibertyIMS on Sat Mar 31, 2007 11:18 pm

I just searched the Knowledge Base and don't see the updated Batch File in there. Rick, did you put it in there?

Thanks

Barb Vega
BVega_LibertyIMS
Jr. Propeller Head
 
Posts: 3
Joined: Wed Feb 08, 2006 12:34 pm
Location: California

Postby dom.reed on Wed Sep 12, 2007 7:35 am

Hi
Just wondered if this batch file ever got posted on the knowledge base, or if someone could mail me with it, as I can't find it either and it sounds perfect!

Cheers
Dom
dom.reed
Jr. Propeller Head
 
Posts: 7
Joined: Tue Feb 14, 2006 5:54 am
Location: Bristol, UK

Command Line Batch File

Postby SteveS on Wed Sep 12, 2007 3:44 pm

Hi Dom,

The code for the batch file is in the first post in this thread.

Copy it into notepad and save it as <filename>.bat - should work a treat :wink:
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
SteveS
Propellus Maximus
 
Posts: 1522
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).

Re: Command Line Build batch file

Postby forfear on Sat Jul 12, 2008 10:24 pm

Hi!

What is a CLI? Everyone seems to know what that is. Nice post. Very important topic! We need to do something more with this. :flare:
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
forfear
Propellus Majorus
 
Posts: 767
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: Command Line Build batch file

Postby Pete Lees on Sun Jul 13, 2008 3:05 am

Hi,

CLI = Command Line Interface. One example is the Command Prompt window in Windows.

Pete
Pete Lees
Propeller Head
 
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: Command Line Build batch file

Postby doc_guy on Mon Jul 14, 2008 8:51 am

forfear wrote:Hi!

What is a CLI? Everyone seems to know what that is. Nice post. Very important topic! We need to do something more with this. :flare:


For clarification, the purpose of the command line interface is that it allows you to build your Flare project as part of some larger script. So if you have a Windows build machine for your software, you can include a command to build and publish the Flare help system as well. Then when that completes, the script can pull over the latest version of the help system into the build.
Paul Pehrson
My Blog | My portfolio | Modularized Flare training - Use promo code FALL2014 and save 15%

I'm speaking at MadWorld 2015! Join us next April in San Diego!
Image Image
User avatar
doc_guy
Propellus Maximus
 
Posts: 1481
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West

Re: Command Line Build batch file

Postby SteveS on Mon Jul 14, 2008 3:32 pm

If you drag and drop the project onto the batch file (in Windows Explorer, for example) it will build all the targets in the project - so even on a stand-alone it has advantages! One action, 5 targets built. And plenty of time to drink a coffee... :wink:
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
SteveS
Propellus Maximus
 
Posts: 1522
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).

Re: Command Line Build batch file

Postby TheGreatAndPowerfulOz on Tue Jan 06, 2009 9:09 pm

Has it really been nearly 3 years since I wrote my multi-target command line batch file? :|

Well, just for kicks, I decided to add some code to the batch file which will calculate the amount of time a build operation takes. The elapsed time (in hours, minutes and seconds) will display at the end of the process, and also be written to the log file.

I've posted the latest version here, if anyone is interested in it. I'll gladly answer any questions you may have about it via e-mail, or here in the forum.

The batch file has been tested on versions 2 to 4.1 of Flare. Works fine on all of 'em. :D

Regards,
Austin.
Attachments
MadCapFlareMultiTargetBuilder_20090106.zip
/
The attached ZIP archive contains two files:

1) a batch file template (you can rename it whatever you want)
2) a screenshot of settings to specify for the Windows shortcut to the batch file

Place the batch file anywhere you'd like (My Documents, Flare project directory, etc.), then create a shortcut to it on your Desktop, Start menu, etc. and set its properties according to what's shown in the screenshot.

Configuration instructions (to make the file work with your Flare project) are at the top of the batch file.
\
(25.96 KiB) Downloaded 303 times
Austin Wright

Flare v10.1.0 :: HTML Help / WebHelp / HTML5 / PDF output
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 67
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Re: Command Line Build batch file

Postby MC Hammer on Wed Jan 07, 2009 4:43 am

Hi there
I have copied Steve's batch file (thank you for sharing) and tweaked it for my version of Flare (v4.0) and for my projects.
I am not familiar at all with the MS-DOS batch language (have read a few things on the Internet about the syntax though) and have a couple of questions as I do not think it is all working fine for me. I managed to batch-build all my targets (6 in total) in less than 45 min, which is quite good. No Starbucks here but I can do something else during these 45 mins 8) .
1/I do not think that the log file bit is working as I get two "access denied" lines in my Prompt Window when the batch file is clicked. The madbuild.txt file gets created and at the end of the batch-building process, only contains 2 lines informing me that the project building was started, then completed.
Do I need to edit the two echo. | date | find /I \"Current\" >> c:\\Temp\\madbuild.txt lines as these do not seem to work?
2/I am not sure I understood correctly what to do on the line that builds the project....
I have tweaked the original line from Steve
Code: Select all
madbuild -project %1 >> c:\\temp\\madbuild.txt
to
Code: Select all
madbuild -project C:\Help\IWHelp\IW\IW.flprj

I had to remove the >> c:\\temp\\madbuild.txt bit as nothing seems to happen if I leave it in. My questions are:
a/do I need to specify which project to build or can I leave the line as the original one (project %1). I did not get the dragging n dropping of projects onto the batch file shortcut.
b/ what does the last part of the line >> c:\\temp\\madbuild.txt do?
Any help would be appreciated as I am struggling a bit with this code :cry: .
Marie-Claire
Flare 10.2.1- Windows 7 & Windows 8 - IE10 - HTML Help and WebHelp 2.0
MC Hammer
Propeller Head
 
Posts: 203
Joined: Wed Aug 08, 2007 3:04 am
Location: In a galaxy far, far away

Re: Command Line Build batch file

Postby TheGreatAndPowerfulOz on Wed Jan 07, 2009 1:46 pm

MC,

Hello! It's been some time since I've looked at Steve's code, so I can't comment specifically on it. Unfortunately, I don't have the time at present (when will I EVER?!) to delve into it, either. :cry:

I just thought I'd ask if you wanted to give the batch file I've posted here a whirl to see if it's any easier for you to configure and use (I tried to make it as easy as possible!). Please let me know, and I can certainly help with any questions you have with regard to it. :)

Regards,
Austin.
Austin Wright

Flare v10.1.0 :: HTML Help / WebHelp / HTML5 / PDF output
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 67
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Next

Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest