11 Replies Latest reply on Jul 7, 2009 9:06 AM by escouten

    VERSION

    micahjwalter

      Hi,

      I was trying to set the VERSION number in my Info.lua file as follows:

       

      VERSION = {

      1,1,4

      },

       

      but I must be doing this wrong as it keeps showing up as Version 1.0 in the Plugin-Manager. Any examples of how this should be formatted?

       

      -m

        • 1. Re: VERSION
          Mark J M Wilson Level 1

          It was documented on page 21 of the 2.2 SDK manual update and there is an example of syntax in the flickr.lrdevplugin:

           

          VERSION = { major=2, minor=0, revision=0, build=200000, },

           

          You can also specify 'display' to show something different or localise the displayed string.

           

          Hope that helps.

          • 2. Re: VERSION
            john beardsworth Adobe Community Professional & MVP

            As a follow up, is it possible for the plug-in to detect the version - and therefore use an LrHTTP call to show a "newer version available" message in the Info panel?

             

            I've tried _PLUGIN.version, _PLUGIN.VERSION. Neither of which are documented, and neither of which work.

             

            John

            • 3. Re: VERSION
              Mark J M Wilson Level 1

              John, I ended up with a long winded solution to that: I store major, minor, revision and build in a table, which I use to set the version info.  I can then use the same values to compare to the latest released value on my website.

               

              BTW John, I saw your comment on my tagset issue - thanks and looking at it now.

              • 4. Re: VERSION
                john beardsworth Adobe Community Professional & MVP

                Thanks  Mark, that gives me a way forward. Can't get it to work 

                though!

                 

                John

                • 5. Re: VERSION
                  Mark J M Wilson Level 1

                  I just realised that my explination was bad and that LrApplication.versionTable() might do what you want...and I am trying to remember why I am not using versionTable()...I really should write more comments in my code...

                   

                  I actually store the values in two places - once in info.lua and again in another script, which now makes no sense at all but was probably very sensible last year

                   

                  EDIT: just realised why - it gives Lightroom's version, not the plug-in's...

                   

                  Message was edited by: Mark J M Wilson

                  • 6. Re: VERSION
                    john beardsworth Adobe Community Professional & MVP

                    Isn't that the version of Lightroom?

                    John

                    • 7. Re: VERSION
                      Mark J M Wilson Level 1

                      johnbeardy wrote:

                       

                      Isn't that the version of Lightroom?

                      John

                      Yes, my edit must have crossed with your reply.  That does explain why it is commented out in my code and replaced with a recreation of the version table.

                      • 8. Re: VERSION
                        escouten Adobe Employee

                        Those calls aren't documented because they aren't implemented.

                         

                        There isn't currently a way for a plug-in to look at its Info.lua declaration or its version declaration. I'll interpret this as a feature request for such.

                        • 9. Re: VERSION
                          DawMatt Level 3

                          escouten wrote:

                           

                          There isn't currently a way for a plug-in to look at its Info.lua declaration or its version declaration.

                          Not technically true.

                           

                          Why don't people just do this?  My latest plugin uses it and it works.

                          local info = require 'Info.lua'
                          local versionString = 'Version ' .. (info.VERSION.major or '0') .. '.' .. (info.VERSION.minor or '0')
                          

                          Sure, Lightroom has to have this in memory already so this is a tad inefficient, but the files are small (and have to be present) so its relatively save to load them again.

                           

                          Matt

                          • 10. Re: VERSION
                            john beardsworth Adobe Community Professional & MVP

                            Thanks Eric - that's a correct interpretation.

                            • 11. Re: VERSION
                              escouten Adobe Employee

                              D'oh! I stand corrected.

                               

                              I don't see any problem with this approach.