This project has moved. For the latest updates, please go here.

Expandable Properties

Within the headers configured in your license header definition files, you can use expandable properties, i.e., variables that are expanded when the header is inserted or updated.

The following properties are currently supported:
  • %FullFileName% expands to the full file name (including directory path),
  • %FileName% expands to the file name,
  • %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime% expand to the respective file creation DateTime properties (time is in short time format),
  • %CurrentYear%, %CurrentMonth%, %CurrentDay%, %CurrentTime% expand to the respective current DateTime properties (time is in short time format),
  • %UserName% expands to the name of the current user
  • %Project% expands to the name of the containing project (since 1.4)
  • %Namespace% expands to the first namespace used in the file (since 1.4)

For example

extensions: .cs 
// This is a sample license header. %UserName%, %CurrentYear%-%CurrentMonth%-%CurrentDay%
will insert something similar to

// This is a sample license header. john.doe, 2011-12-23
into .cs files. Note that the properties are updated every time the header is reinserted.

This feature is available since release 1.3.

Last edited Oct 8, 2012 at 1:50 PM by matkoch, version 3

Comments

fuct Mar 11, 2015 at 8:43 PM 
This may sound like nitpicking to some but could you have (an option for ) the Month/Date be in 2 digit format. I.e. "2" >> "02". Our coding standards are to keep things uniform with the digits.

Thanks again!! Great job all around!

Nate_Wilkins Sep 6, 2014 at 2:27 AM 
Would be nice if we could possibly add to this list - have a script run to generate the value or something similar +1

JoCooper Sep 4, 2014 at 9:13 PM 
Very nice feature with expandable properties. It works well for my .cs files. However, I don't even get a menu item for wixproj projects which means it's useless for my installer projects.

Skleni Mar 12, 2012 at 8:28 AM 
Very nice, I was about to create a feature request for that. :)