blumi Posted July 7, 2011 Posted July 7, 2011 Hi, I have a very simple script which has some RegRead commands in it. I have used them often before ago but sind a few weeks I have some problems with it. Operating System Win 7 x64 SP#1 AutoIt Version 3.3.6.1 When I run the script with SciTE (F5) it does not work. When I compile the script for x86 the .exe does not work. When I compile the script for x64 the .exe does work. Did an uninstall of AutoIt and a new install, the same problem. I am very confused. Has anybody an idea what can I do or check? expandcollapse popup$ScriptName = "Forefront Client Security Uninstaller" ; Microsoft Operations Manager 2005-Agent deinstallieren If (@OSArch = "X64") Then $string = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F692770D-0E27-4D3F-8386-F04C6F434040}", "DisplayName") EndIf If (@OSArch = "X86") Then $string = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F692770D-0E27-4D3F-8386-F04C6F434040}", "DisplayName") EndIf ; Wert überprüfen $pos = StringInStr($string, "Microsoft Operations Manager 2005-Agent") If ($pos = 1) Then $CheckRegistry = True Else $CheckRegistry = False EndIf ; Uninstall aufrufen If ($CheckRegistry = True) Then MsgBox(64, $ScriptName, "Microsoft Operations Manager 2005-Agent wird deinstalliert", 3) RunWait('msiexec /qb /x {F692770D-0E27-4D3F-8386-F04C6F434040}') MsgBox(64, $ScriptName, "Microsoft Operations Manager 2005-Agent wurde deinstalliert", 3) EndIf Sleep (1000) ; Microsoft Forefront Client Security-Antimalwaredienst deinstallieren $string = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4D4FC0FF-F197-401F-842E-E118F1D2647E}", "DisplayName") ; Wert überprüfen $pos = StringInStr($string, "Microsoft Forefront Client Security-Antimalwaredienst") If ($pos = 1) Then $CheckRegistry = True Else $CheckRegistry = False MsgBox(64, $ScriptName, "Microsoft Forefront Client Security-Antimalwaredienst konnte nicht in der Registry gefunden werden") EndIf ; Uninstall aufrufen If ($CheckRegistry = True) Then MsgBox(64, $ScriptName, "Microsoft Forefront Client Security-Antimalwaredienst wird deinstalliert", 3) RunWait('msiexec /qb /x {4D4FC0FF-F197-401F-842E-E118F1D2647E}') If (WinExists("Microsoft Forefront Client Security-Antimalwaredienst", "Die folgenden Anwendungen sollten geschlossen werden")) Then ControlClick("Microsoft Forefront Client Security-Antimalwaredienst", "Die folgenden Anwendungen sollten geschlossen werden", "Button1") EndIf MsgBox(64, $ScriptName, "Microsoft Forefront Client Security-Antimalwaredienst wurde deinstalliert", 3) EndIf Sleep (1000) ; Microsoft Forefront Client Security State Assessment Service deinstallieren $string = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5343BE4E-B247-41D0-B81D-4E7C55460910}", "DisplayName") ; Wert überprüfen $pos = StringInStr($string, "Microsoft Forefront Client Security State Assessment Service") If ($pos = 1) Then $CheckRegistry = True Else $CheckRegistry = False MsgBox(64, $ScriptName, "Microsoft Forefront Client Security State Assessment Service konnte nicht in der Registry gefunden werden") EndIf ; Uninstall aufrufen If ($CheckRegistry = True) Then MsgBox(64, $ScriptName, "Microsoft Forefront Client Security State Assessment Service wird deinstalliert", 3) RunWait('msiexec /qb /x {5343BE4E-B247-41D0-B81D-4E7C55460910}') MsgBox(64, $ScriptName, "Microsoft Forefront Client Security State Assessment Service wurde deinstalliert", 3) EndIf
jaberwacky Posted July 7, 2011 Posted July 7, 2011 So this must mean that you have a 64 bit machine. Are your reg reads correct? Try it on an x86 as well. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Zedna Posted July 7, 2011 Posted July 7, 2011 I'm not sure about Wow6432Node compatibility/restrictions but try to compile your script with latest beta 3.3.7.13 Resources UDF ResourcesEx UDF AutoIt Forum Search
JFX Posted July 7, 2011 Posted July 7, 2011 Check the help file for RegRead. Does it help if you change HKEY_LOCAL_MACHINE to HKEY_LOCAL_MACHINE64 ?
Tripredacus Posted July 7, 2011 Posted July 7, 2011 I ran into this problem as well. Without specifying the 64 on the HKLM, AutoIT will process it to the 3264node automatically. So basically set your 32bit app to use the same reg key and it should work on 32bit and 64bit. I made a recent post about this here: Twitter | MSFN | VGCollect
blumi Posted July 12, 2011 Author Posted July 12, 2011 Check the help file for RegRead.Does it help if you change HKEY_LOCAL_MACHINE to HKEY_LOCAL_MACHINE64 ?With this change all x86 compiled scripts run fine on a x64 machine.
AdmiralAlkex Posted July 12, 2011 Posted July 12, 2011 (edited) Checking @OSArch is your problem, that just doesn't make sense the way you're doing it. You want @AutoItX64. Also using two If's to do ones work is pointless. All those extra brackets you have in every If isn't necessary either. Try it like this instead: If @AutoItX64 = 1 Then $string = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F692770D-0E27-4D3F-8386-F04C6F434040}", "DisplayName") Else $string = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F692770D-0E27-4D3F-8386-F04C6F434040}", "DisplayName") EndIf Edit: Actually I'm not sure what you want to do (all your If's are still "wrong" (for one reason or another) though). Edited July 12, 2011 by AdmiralManHairAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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