Jump to content

RegRead to end script if exists


 Share

Recommended Posts

I have hopefully an easy question for the experts. I have a script written to install an application update. this are soon to be needed for about 100 users. i plan to call my exe via logon scripts. I need to have the first line of the script look for a reg key for the app and if it exists then terminate the script or if the reg key is absent then move on to the installs. please help.

Thanks.

Link to comment
Share on other sites

I have hopefully an easy question for the experts. I have a script written to install an application update. this are soon to be needed for about 100 users. i plan to call my exe via logon scripts. I need to have the first line of the script look for a reg key for the app and if it exists then terminate the script or if the reg key is absent then move on to the installs. please help.

Thanks.

The RegRead example in the helpfile doesn't help you ?

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

The RegRead example in the helpfile doesn't help you ?

no, sorry. i have reviewed the help files and the online functions definition but i am missing something. below is what i have in my script. the registry key does exist on the test machine but it still processes the script.

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Sleep(2000)

If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B2A9B452-2621-49B0-A474-AB01F9F74202}", "Oracle 11 Client") <> "" Then

ProcessClose("AutoIt3.exe") ;also tried "Exit" here.

EndIf

Run('\\hp-con-ecm\smspkge$\va100108\Integra\Oracle81Eradicator.exe')

ProcessWaitClose("oracle81eradicator.exe")

ShellExecuteWait("\\hp-con-ecm\smspkge$\va100108\integra\Oracle 11 Client.msi", "/passive /norestart")

MsgBox(4096,"Hill Phoenix Application Update", "Your HP Apps Software has been updated, Please reboot your computer")

Link to comment
Share on other sites

try

If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B2A9B452-2621-49B0-A474-AB01F9F74202}", "Oracle 11 Client") <> "" Then
    ProcessClose("AutoIt3.exe") 
    Exit
Else
    Run('\\hp-con-ecm\smspkge$\va100108\Integra\Oracle81Eradicator.exe')
    ProcessWaitClose("oracle81eradicator.exe")
    ShellExecuteWait("\\hp-con-ecm\smspkge$\va100108\integra\Oracle 11 Client.msi", "/passive /norestart")
    MsgBox(4096,"Hill Phoenix Application Update", "Your HP Apps Software has been updated, Please reboot your computer") 
EndIf

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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...