SHFB icon indicating copy to clipboard operation
SHFB copied to clipboard

ProductVersion and Copyright should change dynamically based on Build update

Open gowthamguptha opened this issue 7 years ago • 4 comments

Currently, I see the Copyright and Product version is a constant variable.

But I want to change this dynamically. My build will change the Assembly Version (Assembly.cs) based on the release it is going dynamically.

Now how can I update this accordingly to my Plugin?

gowthamguptha avatar Dec 03 '19 06:12 gowthamguptha

If your version information is in project properties, they can be added to the SHFB project as custom properties and referenced in the copyright and product version SHFB properties using the substitution syntax ({@MajorVersionNumber}.{@MinorVersionNumber} for example). I know others have done it that way though I don't recall the specifics.

EWSoftware avatar Dec 03 '19 15:12 EWSoftware

I have defined the copyright and footer as follows in the SHFB project (note, the &s are actually entered as "&amp followed by ; with no spaces): &#169%3b 2004-{%40BuildDate:yyyy} Company Name. All Rights Reserved. documentation%40osisoft.com Version: {%40FullBuildNumber}&lt%3bbr/&gt%3bBuild Date: {%40BuildDate:MMMM d, yyyy}

And FullBuildNumber is a property defined as follows: $(MajorVersionNumber).$(MinorVersionNumber).$(BuildVersionNumber)

dwhearn avatar Dec 03 '19 15:12 dwhearn

Hi,

The above comments are related to copyright in SHFB. But my question was I created a custom plugin, where I need to mention the version and Copyright attributes right.

These values I need to do it dynamically.

[HelpFileBuilderPlugInExport("PlugIn", Version = AssemblyInfo.ProductVersion, Copyright = AssemblyInfo.Copyright, Description = "plug-in", IsConfigurable = true)]

Currently, these values are getting from the assembly info class. But these values I should populate dynamically based on AssemblyVersion which my build will update.

gowthamguptha avatar Dec 04 '19 05:12 gowthamguptha

EDIT: Ignore my last reply if you read it. I don't think you can do this dynamically as these are attribute values and are set at compile time. You mention that your build process is modifying AssemblyInfo.cs, you will probably have to do something similar to update the values for the attributes.

EWSoftware avatar Dec 04 '19 15:12 EWSoftware