ravaged1 Posted October 22, 2010 Share Posted October 22, 2010 (edited) Having problems with my script. Think maybe I just don't understand what Im doing. I would like to check for the presence of 2 registry keys Then kick of the uninstall for whatever is present. Works in Win7 just fine but XP is not (most of the time) Has anyone else encountered this issue? Here is a simple version:RegRead('HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{43CCCBDC-3A56-4F3B-89DF-69386C3B7D62}', '') If @error < 0 Then SLX6() RegRead('HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{83CCCBDC-3A56-4F3B-89DF-69386C3B7D62}', '') If @error < 0 Then SLX7() Install() Func SLX6() MsgBox(0, 'SLX6', 'Func SLX6') Sleep(3000) Install() EndFunc ;==>SLX6 Func SLX7() MsgBox(0, 'SLX7', 'Func SLX7') Sleep(3000) Install() EndFunc ;==>SLX7 Func Install() MsgBox(0, 'install', 'Installing SLX') Exit EndFunc ;==>Install Edited October 22, 2010 by ravaged1 Link to comment Share on other sites More sharing options...
willichan Posted October 22, 2010 Share Posted October 22, 2010 #668181 My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
ravaged1 Posted October 22, 2010 Author Share Posted October 22, 2010 #668181Made no difference.The key is there and <0, >0, =0, whatever is not working right.Like I said Win7 works every time XP not so much.Worked the 1st time then after reinstalling the program it would not find the key. Yes I restarted and checked that the key was there and the same. Looks like I'll shoot for If FileExist() this RegRead is just unreliable for me. Link to comment Share on other sites More sharing options...
Developers Jos Posted October 22, 2010 Developers Share Posted October 22, 2010 (edited) Made no difference.The key is there and <0, >0, =0, whatever is not working right.Like I said Win7 works every time XP not so much.Worked the 1st time then after reinstalling the program it would not find the key. Yes I restarted and checked that the key was there and the same. Looks like I'll shoot for If FileExist() this RegRead is just unreliable for me. So what is the returnvalue and @error retuned by the RegRead() function?Show us a screen capture of the registry key that is there but not working.What Version of Winxp are you running? Edited October 22, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ravaged1 Posted October 22, 2010 Author Share Posted October 22, 2010 (edited) So what is the returnvalue and @error retuned by the RegRead() function? Show us a screen capture of the registry key that is there but not working. What Version of Winxp are you running? That may be part of it, I'm new to AutoIT so I don't know how to find what @error value is received. Running windows XP sp3 on 2 different laptops and win7 on work PC. As for Screen shot I don't have a place to upload at the moment. This is part of the actual code I'm using. ; Registy Check for SalesLogix Installs RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Unistall\{0102F1E3-EEE6-4AC3-9CFC-0B39B2A7851C}", "") If @error < 0 Then SLX6() RegRead('HKLM\Software\Microsoft\Windows\CurrentVersion\Unistall\{E5AFD400-B1ED-483E-8FB9-49D1F85153D1}', '') If @error < 0 Then SLX7() Install() Edited October 22, 2010 by ravaged1 Link to comment Share on other sites More sharing options...
ravaged1 Posted October 22, 2010 Author Share Posted October 22, 2010 So what is the returnvalue and @error retuned by the RegRead() function?Show us a screen capture of the registry key that is there but not working.What Version of Winxp are you running?To be honest with you Jos I have moved on.Found that even though they are the same program they did have a different file or two, so I just used If FileExsit.I still make a call to uninstall like this that works great.Run("MsiExec.exe /I {0102F1E3-EEE6-4AC3-9CFC-0B39B2A7851C}") but that does not use RegRead it does use the keys thou.I will be sending this out across the country to company salesmen and it just needs to work every time. Won't be around to fix it. Link to comment Share on other sites More sharing options...
Developers Jos Posted October 22, 2010 Developers Share Posted October 22, 2010 Well one observation is that in your last snippet you have a typo for "Uninstall" You have RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Unistall\{0102F1E3-EEE6-4AC3-9CFC-0B39B2A7851C}", "") which should be: RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0102F1E3-EEE6-4AC3-9CFC-0B39B2A7851C}", "") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ravaged1 Posted October 22, 2010 Author Share Posted October 22, 2010 Well one observation is that in your last snippet you have a typo for "Uninstall"You haveRegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Unistall\{0102F1E3-EEE6-4AC3-9CFC-0B39B2A7851C}", "")which should be:RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0102F1E3-EEE6-4AC3-9CFC-0B39B2A7851C}", "")You know what? Even tho I have been trying different renditions of the code I have just been copying that string around only verifying that the key was correct and never noticing that typo. also explains why Win7 worked because I did that by hand. lolThanks for making me feel stupid. I'm glad it's Friday. Thanks again. Link to comment Share on other sites More sharing options...
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