We have recently added four new conditions – HasTaskExclusions, NotHasTaskExclusions, TaskIsExcluded and NotTaskIsExcluded – which operate alongside the If command and work to determine different actions to take depending on the return value of the condition. As with all commands and conditions in Pipeline Runner what they do should be pretty much self explanatory just from their names, but why did we add them?

One of our larger users wanted to automatically update their version numbering depending on the state of Task Exclusions, and we thought it would be great for Pipeline Runner itself too. In case you haven’t got that far yet, the Tasks Section of a Pipeline Runner script or project  allows User Sections to be assigned as Tasks and therefore become optional. When the script is executed via the Studio IDE, each task will be displayed in the Task Selection Dialog with a check box to allow the user to determine whether or not those sections are executed, and you can created different configurations to remember as many sets of exclusions as you want. If you are running the project automatically without displaying the IDE, when you create the command line automatically it will again display the dialog to allow you to select any required exclusions so that no user interaction is required at runtime. This means you can create configurations for Full Release, Interim Release, Update Source Control, Upload Only, Protect Only, and so on.

Important: Because Tasks are a Pro Only feature these new conditions  are only available to users that hold a Pro License

Their release project was already automatically retrieving the version information of the most recent release, and updating the Revision part of the version number each time to create a standard version and also a file name version (the same but with underscores instead of full stops / dots between the parts), but they wanted something more flexible and of course fully automated.

Their release project has no exclusions for a full release, so any exclusion means that it is not a full release and needs to be handled differently. To solve this problem, the HasTaskExclusions and NotHasTaskExclusions conditions are used. If there are no exclusions, the Build part of the version number is updated and the Revision part is set to zero. If there are any exclusions, the Revision part is incremented and the Build left as it is. Of course, it would be easy enough to perform calculations based on whether or not a specific task is excluded rather than a blanket check against exclusions, which is where the TaskIsExcluded and NotTaskIsExcluded conditions come in.

Using Pipeline Runner it was easy to solve their problem despite the complex calculations involved, as you can see from this similar script example:


[Setup]

; Change the target file name and path to that of your application executable
Var:VersionTargetFile=“C:\Source\MyApp\bin\Release\MyApp.exe”

; Now declare other global variables here
Var
:Version,GetFileVersion,%%VersionTargetFile%%
Var
:Major=1
Var
:Minor=0
Var
:Build=GetBuildFileVersion,%%VersionTargetFile%%
Var
:Revision=GetRevisionFileVersion,%%VersionTargetFile%%

; Incremented version values are initially set to the current version number
; Values will be updated by the UpdateVersionNumber task if it is allowed to run
Var
:NewVersion,%%Version%%
Var
:NewFileNameVersion=GetFileNameVersion,%%VersionTargetFile%%
Var
:NewBuild=%%Build%%
Var
:NewRevision=%%Revision%%

; MUST be done BEFORE the build!!
[Update Version Number]

Remark
:“Current Version: %%Version%%
Var
:IncrementedBuild=IncrementBuildFileVersion,%%VersionTargetFile%%
Var
:IncrementedRevision = IncrementRevisionFileVersion,%%VersionTargetFile%%

@If:HasTaskExclusions,
    Assign:NewRevision,%%IncrementedRevision%%,
    Assign:NewBuild,%%IncrementedBuild%%;

If:NotHasTaskExclusions,Assign:NewRevision,0

Assign:NewVersion,%%NewMajor%%.%%NewMinor%%.%%NewBuild%%.%%NewRevision%%
Assign
:NewFileNameVersion,%%NewMajor%%_%%NewMinor%%_%%NewBuild%%_%%NewRevision%%
Remark
:“New Version: %%NewVersion%%
Remark
:“New File Name Version: %%NewFileNameVersion%%

; Remarks show in the report or the command prompt so you can see that it has worked correctly
; Rest of the script goes here


If that looks complicated to you, don’t worry because you don’t even need to type any of it! Pipeline Runner Studio will let you generate the whole thing by simply selecting the necessary parts from a menu or drop down button and it will build it automatically for you…

Pipeline Runner can make short work of even the most complicated requirements and provide complete automation of complex processes with ease. Once a project script is written, you can run it forever either automatically or on demand saving countless hours and removing all the risk of human error that comes with doing it manually.

Responsive site designed and developed by