theguy0000 Posted August 31, 2005 Posted August 31, 2005 i need to figure out the user's autoit directory, such as "program files\autoit3\" thanks! The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
MHz Posted August 31, 2005 Posted August 31, 2005 Just use the Applications path in the registry$value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '') $value = StringLeft($value, StringInStr($value, '\', 0, -1)-1) MsgBox(0, '', $value)This will work if AutoIt was installed and not from a zip file.
theguy0000 Posted August 31, 2005 Author Posted August 31, 2005 i dont want the path to autoit3.exe, i want the path to the directory in program file that autoit is installed in, such as "program files\autoit3\" The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
MHz Posted August 31, 2005 Posted August 31, 2005 Did you test that. AutoIt3.exe resides in the directory. That is why I used string*() functions to remove the '\AutoIt3.exe' from the full path returned with RegRead().
theguy0000 Posted August 31, 2005 Author Posted August 31, 2005 oh heh srry ok thanks then The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
theguy0000 Posted August 31, 2005 Author Posted August 31, 2005 but i want the version removed...for example, it comes up with "\program files\autoit3\beta" but i want the "beta" removed The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
MHz Posted August 31, 2005 Posted August 31, 2005 Oh, Ok. I do not use the beta installer. I use the beta zip. So was unaware of this scenerio. Just adding StringReplace should cover for this difference of version. $value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '') $value = StringLeft($value, StringInStr($value, '\', 0, -1)-1) $value = StringReplace($value, '\beta', '') MsgBox(0, '', $value)
theguy0000 Posted August 31, 2005 Author Posted August 31, 2005 (edited) but the user could be using some other version of autoit, so that would be specific to me and other beta users Edited August 31, 2005 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
MHz Posted August 31, 2005 Posted August 31, 2005 The above gives you the directory to AutoIt3.exe. If you are enquiring about someone like me, who uses both release and beta? Then use If FileExists for the presence of the Beta directory within the AutoIt directory. For other concepts, then specify more.
theguy0000 Posted August 31, 2005 Author Posted August 31, 2005 nvm i figured out a way... $value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '') $value = StringLeft($value, StringInStr($value, '\', 0, -1)-1) $beta = StringInStr ( $value, "\beta" ) If $beta <> 0 Then $value = StringReplace($value, '\beta', '') EndIf MsgBox ( 0, "", $value ) thanks! The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
MHz Posted August 31, 2005 Posted August 31, 2005 If you want to know if someone has the beta in a subdirectory of the AutoIt directory, then you could use this. $value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '') $value = StringLeft($value, StringInStr($value, '\', 0, -1)-1) $value = StringReplace($value, '\beta', '') If Not @extended Then If FileExists($value & '\beta') Then $value = $value & '\beta' EndIf MsgBox(0, '', $value)
Valik Posted August 31, 2005 Posted August 31, 2005 Or you could (unimaginatively enough), read the values "InstallDir" and "BetaInstallDir" located at "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt".
MHz Posted August 31, 2005 Posted August 31, 2005 I do not have "BetaInstallDir", as to usage of beta zip. Nice try.
/dev/null Posted August 31, 2005 Posted August 31, 2005 (edited) I do not have "BetaInstallDir", as to usage of beta zip. Nice try.<{POST_SNAPBACK}>Guys, never heard of @AutoItExe ?? @AutoItExe - The full path and filename of the AutoIt executable currently running. For compiled scripts it is the path of the compiled script.Doesn't matter if beta version, installed or from ZIP file. Use String* functions to get the path only...EDIT: Or even better. Use _PathSplit()CheersKurt Edited August 31, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Valik Posted August 31, 2005 Posted August 31, 2005 I do not have "BetaInstallDir", as to usage of beta zip. Nice try.<{POST_SNAPBACK}>Then there are no guarantees that even the presence of a "beta" directory will actually contain a valid beta version of AutoIt or that should a "valid" beta be found it may not be the newest (Meaning a newer version could be elsewhere). I also don't understand how you expect the AutoIt AppPath entry to be present unless the installer sets it, so we're back to being able to detect only valid (installer) installations, anyway, ergo, checking the two values I mention above is an easier solution than reading the AppPath key and doing splitting and all that stuff.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now