1. Quick question(s)...

    1) Is there a function to retrieve the current Version Number of your AddOn?

    2) How do you get your AddOn to determine if a newer version of itself exists? Is there a LUA module pre-written that gives AddOn's that functionality? Or is it a relatively simple set of commands?

  2. Quick question(s)...

    1) Is there a function to retrieve the current Version Number of your AddOn?

    If it's listed in your TOC:

    local version = GetAddOnMetadata("YourAddonName", "Version")

    Otherwise you can't.

    2) How do you get your AddOn to determine if a newer version of itself exists? Is there a LUA module pre-written that gives AddOn's that functionality? Or is it a relatively simple set of commands?

    You don't. There is no communication outside of the game. The best you can do is check with members of your guild/party/raid using the addon communication API to see if any of them have a newer version. It's non-trivial and doesn't add all that much, actually.

  3. You might want to look how most library files do the checking.

    local ADDON_VERSION = 90000 + tonumber(("$Revision: 74 $"):match("%d+"))

    This assumes a few things, like you are using SVN, although if Git has keyword substitutions, then great. You would keyword Revision. Also, you don't need to add the 90000 but most people do because 11 and 111 and 1111 etc all match the same pattern, or something like that.

    Then you use the addon chat channel to broadcast your version to guild/party/raid/whisper or wherever and listen back. Compare the incoming number with ADDON_VERSION to find out which is higher.

    You can also use LibVersionCheck-1.0 if that makes it easier. The API is on the pages tab.

  4. You might want to look how most library files do the checking.

    local ADDON_VERSION = 90000 + tonumber(("$Revision: 74 $"):match("%d+"))

    This assumes a few things, like you are using SVN, although if Git has keyword substitutions, then great. You would keyword Revision. Also, you don't need to add the 90000 but most people do because 11 and 111 and 1111 etc all match the same pattern, or something like that.

    This is precisely why I didn't suggest this.. most of what is done in those addon libraries are terrible legacy hacks.. I can say that because I implemented a few of them myself. Also, Git does not have numeric revisions so this won't work, it'd only work with svn.

    Then you use the addon chat channel to broadcast your version to guild/party/raid/whisper or wherever and listen back. Compare the incoming number with ADDON_VERSION to find out which is higher.

    Better to write a reasonable comparison function based on your own version formats, in my opinion.

    You can also use LibVersionCheck-1.0 if that makes it easier. The API is on the pages tab.

    Interesting, thanks for the link. Personally, I think its not worth it for 99% of the cases =)