yellowdog
(Starting to like KiXtart)
2018-11-20 12:34 PM
Error control returns abnormal value

Helo,

In order to test the presence of an application on a workstation, I use the readvalue command.
The problem is that the error returns an abnormal value equel to "2", eventhough the registry key exists on the workstation.

How is that possible ?

 Code:
IF $OSVER64 = 1
        READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox 60.3.0 ESR (x64 fr)","DisplayName")
        IF @ERROR = 0
	   EXIT
        ELSE
        ENDIF
      ELSE
        READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox 60.3.0 ESR (x86 fr)","DisplayName")
        IF @ERROR = 0
	   EXIT
        ELSE
        ENDIF
	READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox 60.3.0 ESR (x86 fr)","DisplayName")
        IF @ERROR = 0
	   EXIT
        ELSE
        ENDIF
      ENDIF


Thanks for the answer.


AllenAdministrator
(KiX Supporter)
2018-11-21 03:56 AM
Re: Error control returns abnormal value

Is this what you need?
http://www.kixtart.org/manual/Functions/KeyExist.htm


AllenAdministrator
(KiX Supporter)
2018-11-21 04:17 AM
Re: Error control returns abnormal value

Or
 Code:
if READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox 60.3.0 ESR (x64 fr)","DisplayName")=""
  ;do stuff
else
  ;do something else
endif


yellowdog
(Starting to like KiXtart)
2018-11-21 09:29 AM
Re: Error control returns abnormal value

Thanks a lot Allen, it's working better now.