Jump to content

Recommended Posts

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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)
Link to post
Share on other sites

but the user could be using some other version of autoit, so that would be specific to me and other beta users

Edited by theguy0000

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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)
Link to post
Share on other sites

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()

Cheers

Kurt

Edited 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 *

Link to post
Share on other sites

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.
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...