<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Use Version Information from Build Specification in code in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4028954#M1154792</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I want to use the version information from the build specification in my application instead of the hard-coded string (2.0.6 in the attached image). But I have no idea how to get the data in my code.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2020 13:51:31 GMT</pubDate>
    <dc:creator>HolgerN</dc:creator>
    <dc:date>2020-03-26T13:51:31Z</dc:date>
    <item>
      <title>Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4028954#M1154792</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I want to use the version information from the build specification in my application instead of the hard-coded string (2.0.6 in the attached image). But I have no idea how to get the data in my code.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 13:51:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4028954#M1154792</guid>
      <dc:creator>HolgerN</dc:creator>
      <dc:date>2020-03-26T13:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4028955#M1154793</link>
      <description>&lt;P&gt;No matter what they say, Google is your friend.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I Googled &lt;EM&gt;labview build revision in code&lt;/EM&gt; and came up with a lot of good hits, and many different ways, depending on what, specifically, your need is...&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 14:00:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4028955#M1154793</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2020-03-26T14:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029022#M1154823</link>
      <description>&lt;P&gt;In your other thread, Ulib claimed you can use "&lt;SPAN&gt;[VersionNumber]" in the path.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Does that not work for you?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;At least in preview, "C:\Users\&amp;lt;cb&amp;gt;\builds\Untitled Project 1_[VersionNumber]\My Application" looks promising to me.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:37:30 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029022#M1154823</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2020-03-26T16:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029029#M1154826</link>
      <description>&lt;P&gt;If you are building the EXE and want to use the version that LabVIEW embeds in it, you can use the &lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.fileversioninfo.getversioninfo?view=netframework-4.8" target="_self"&gt;GetVersionInfo .NET command&lt;/A&gt; (passing the path and filename of the EXE into it).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EXE version.png" style="width: 566px;"&gt;&lt;img src="https://ip1.i.lithium.com/cb9d969cf37b86be3a4955954722bfd981140c45/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32363436353969344343453333423331393843323943352f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="EXE version.png" alt="EXE version.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:47:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029029#M1154826</guid>
      <dc:creator>Kyle97330</dc:creator>
      <dc:date>2020-03-26T16:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029072#M1154834</link>
      <description>&lt;P&gt;I also use the EXE file version.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 19:33:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029072#M1154834</guid>
      <dc:creator>drjdpowell</dc:creator>
      <dc:date>2020-03-26T19:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029276#M1154951</link>
      <description>&lt;P&gt;I found the attached VI in the internet. That fits my needs very well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="labviewAnmerkung 2020-03-27 071030.JPG" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/2f1f1bcd930d608189807a3dfdd16e483d272b98/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32363436393469324630393842313741464430464435342f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="labviewAnmerkung 2020-03-27 071030.JPG" alt="labviewAnmerkung 2020-03-27 071030.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 06:11:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029276#M1154951</guid>
      <dc:creator>HolgerN</dc:creator>
      <dc:date>2020-03-27T06:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029352#M1154975</link>
      <description>&lt;P&gt;I don't believe your solution will work in a built EXE.&amp;nbsp; The EXE file version technique will work.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 09:34:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029352#M1154975</guid>
      <dc:creator>drjdpowell</dc:creator>
      <dc:date>2020-03-27T09:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029845#M1155279</link>
      <description>&lt;P&gt;There is a "hidden gem" that can be revealed with Darren's "Hidden Gems in vi.lib" package using VIPM.&amp;nbsp; This particular gem is FileVersionInfo.vi.&amp;nbsp; It looks like it will do what you are asking.&amp;nbsp; If you don't want to install the package, the VI is located at &amp;lt;LabVIEW&amp;gt;\vi.lib\Platform\fileVersionInfo.llb\FileVersionInfo.vi.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.ni.com/ni/attachments/ni/170/1155279/1/File%20Version%20Info%20context%20help.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 12:12:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029845#M1155279</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2020-03-28T12:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029880#M1155293</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/75897"&gt;@crossrulz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;There is a "hidden gem" that can be revealed with Darren's "Hidden Gems in vi.lib" package using VIPM.&amp;nbsp; This particular gem is FileVersionInfo.vi.&amp;nbsp; It looks like it will do what you are asking.&amp;nbsp; If you don't want to install the package, the VI is located at &amp;lt;LabVIEW&amp;gt;\vi.lib\Platform\fileVersionInfo.llb\FileVersionInfo.vi.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.ni.com/ni/attachments/ni/170/1155279/1/File%20Version%20Info%20context%20help.png" border="0" /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So&amp;nbsp;&lt;EM&gt;that's&lt;/EM&gt; where that VI resides.&amp;nbsp; I've used it before and wanted to recommend it, but I couldn't remember where it came from.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 15:43:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029880#M1155293</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2020-03-28T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029889#M1155299</link>
      <description>&lt;P&gt;I dug into the "hidden gem" version a little because the pure .NET version shown in msg #4 has a small flaw (arguably) that I've run into before.&amp;nbsp;&amp;nbsp;When both the Patch and Build values are 0 in the executable, the .NET string output truncates them away.&amp;nbsp; So if you built up a version "1.0.0.0" in the build spec, the string output would be "1.0".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "hidden gem" version appears to me to avoid this flaw as does the visible dev environment code shown in msg #6.&amp;nbsp; Both seem to build up a string from the individual integers for Major,Minor,Patch,Build so there won't be any truncation.&amp;nbsp; My guess is that the "hidden gem" version might support non-Windows platforms where the .NET version wouldn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Kevin P&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 16:40:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4029889#M1155299</guid>
      <dc:creator>Kevin_Price</dc:creator>
      <dc:date>2020-03-28T16:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4030269#M1155490</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/11892"&gt;@Kevin_Price&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I dug into the "hidden gem" version a little because the pure .NET version shown in msg #4 has a small flaw (arguably) that I've run into before.&amp;nbsp;&amp;nbsp;When both the Patch and Build values are 0 in the executable, the .NET string output truncates them away.&amp;nbsp; So if you built up a version "1.0.0.0" in the build spec, the string output would be "1.0".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "hidden gem" version appears to me to avoid this flaw as does the visible dev environment code shown in msg #6.&amp;nbsp; Both seem to build up a string from the individual integers for Major,Minor,Patch,Build so there won't be any truncation.&amp;nbsp; My guess is that the "hidden gem" version might support non-Windows platforms where the .NET version wouldn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Kevin P&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The .net version also have properties to get Major, Minor, Patch and Compile versions indiviually so you can build the string yourself. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 08:25:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4030269#M1155490</guid>
      <dc:creator>Yamaeda</dc:creator>
      <dc:date>2020-03-30T08:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4030399#M1155554</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/110591"&gt;@Yamaeda&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;The .net version also have properties to get Major, Minor, Patch and Compile versions indiviually so you can build the string yourself. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah, that's what we started doing after we got bit by the string-only query.&amp;nbsp; (And this wouldn't be any *real* issue in a lot of cases, but in a regulated industry with documentation calling for software version 1.0.0.0 and software that self-reports only 1.0, well...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm intrigued by the Hidden Gems version but we're pretty much Windows-only so for now, it ain't broke so I won't fix it.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Kevin P&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:25:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4030399#M1155554</guid>
      <dc:creator>Kevin_Price</dc:creator>
      <dc:date>2020-03-30T14:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Use Version Information from Build Specification in code</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4030527#M1155629</link>
      <description>&lt;P&gt;so, here's another option - although, I don't know if this is the default generic conduct:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after you have compiled your .exe via the LabView Application Builder,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;open the .exe file with an texteditor,&lt;/P&gt;
&lt;P&gt;e.g. Windows Editor,&lt;/P&gt;
&lt;P&gt;look at the end of the file,&lt;/P&gt;
&lt;P&gt;voila:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="product-version-from-exe.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/26479c07dfb42770040fe9d2f5514666867be48d/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32363438363569333839314344384442393542323436322f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="product-version-from-exe.png" alt="product-version-from-exe.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 18:12:38 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Use-Version-Information-from-Build-Specification-in-code/m-p/4030527#M1155629</guid>
      <dc:creator>alexderjuengere</dc:creator>
      <dc:date>2020-03-30T18:12:38Z</dc:date>
    </item>
  </channel>
</rss>

