The first function we need to build our addon updater is a registry key get collector.
We could use the OpenFileDialog .net componet and force the user to sort through there system and find the addon folder location.
This is inconvenient for the user and really just shows how lazy the author is.
So for were going to be a function to get our install path from the registry,
Public Function GetAddonPath() as string
Dim RegKey as RegistryKey
Dim Value as string
RegKey = Registry.LocalMachine.OpenSubKey(“SOFTWARE\Blizzard Entertainment\World of Warcraft”, False)
Value = RegKey.GetValue(“InstallPath”,”null”)
return Value & “Interface\AddOns\”
First we need to import Microsoft.Win32 to save our self lines of redundant coding.
We dim RegKey to hold the Registry information, also dim Value as a string to hold registry key value or return null if the registry value did not exist. Once we have a value we return the install path location plus “Interface\AddOns\” to complete our AddOn Path string.
Example of a return – “D:\Users\Public\Games\World of Warcraft\Interface\AddOns\”