Wheres the install path?

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,

Imports Microsoft.Win32

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\”
End Function

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\”


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: