Jump to content

user's include directory


theguy0000
 Share

Recommended Posts

im trying to learn more about the registry, and in regedit, i just happened to see something in there called "AutoItv3Script", i looked, and there was my install directory!

now, some of you might remember me wondering how to find a user's include directory.

$installDir = RegRead ( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir" )
$includeDir = $installDir & "\include\"

MsgBox ( 0, "test", "Install Directory found at " & $installDir )
MsgBox ( 0, "test", "Include directory found at " & $includeDir )

this is more of a scrap than a script, i dont expect anyone to find it useful, but i just thought i would post it here.

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

_RunDOS("dir /b /s | find "AutoIt\Include\")

way better dont ya think?

No, stupid idea. Why do a full recursive hard drive search when you can read the registry and lookup the location(s) exactly how AutoIt does it?
Link to comment
Share on other sites

...and if you have multiple versions scattered on your drive, how would you validate which is the correct one?

Or what if your directory isn't named AutoIt\include? Maybe it's AutoIt3\include.

Or what if your directory isn't even on the same drive "dir /b /s" searches on.

Link to comment
Share on other sites

what if they installed a zip that didnt write to the registry ?

Then AutoIt changes how it searches for an Include directory if it can't find the registry keys it wants:

For the include library syntax (#include <file>) to work AutoIt must have been installed using the supplied installer otherwise the installation directory will not be known and the current script directory (@ScriptDir\Include) will be used instead.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...