Robdutoit
(Hey THIS is FUN)
2020-04-20 10:37 PM
Check Firefox Version of Network Computers

I am not sure what kixtart function I should be looking for here.

I have written a script that checks the registry for the Version of Firefox installed and it returns this value, which is what I want - PC01 Firefox 75.0 (x64 en-US)

 Code:
$ReturnValue = ReadValue("HKEY_CURRENT_USER\SOFTWARE\Mozilla\Mozilla Firefox", "CurrentVersion")

IF Open( 3 , "c:\profiles\firefox.txt" , 5 ) = 0
  $x = WriteLine( 3 , "%ComputerName%" + " Firefox " + $ReturnValue + @CRLF)
  IF Close(3)
    Beep
    ? "Error closing file!"
ENDIF
ELSE
  BEEP
  ? "failed to open file, error code : [" + @ERROR + "]"
ENDIF


I know that I have done this some years ago where I was in the past able to tell the script to only write the computer name and status once, just updating that line each login, but I can't remember what I did. I guess I need to use Readline to find the line and overwrite it, but there doesn't seem to be a command to delete that line and rewrite it. So I must have done it differently. Once I have it working, I will change the location to somewhere on the server.


Glenn BarnasAdministrator
(KiX Supporter)
2020-04-21 01:28 AM
Re: Check Firefox Version of Network Computers

I'd simplify this to use WriteProfileString($File, 'Firefox', 'Version', $ReturnValue)
Eliminates the whole open/read/write logic. Creates a file with this content:
 Code:
[Firefox]
Version=<version string here>
You can use $Ver = ReadProfileString($File, 'Firefox', 'Version') to get the data.
Glenn


Robdutoit
(Hey THIS is FUN)
2020-04-21 05:00 PM
Re: Check Firefox Version of Network Computers

Aah yes. I think I did use a writeprofilestring last time to do this. I will give it a go and see if I can get it working. Thanks

Robdutoit
(Hey THIS is FUN)
2020-04-22 03:52 PM
Re: Check Firefox Version of Network Computers

Thank you very much. I managed to get that to work. Hopefully this will help to find computers where Firefox is not updating because it wants the admin privileges to do so (when it shouldn't). And I should now be able to find the computers with the wrong Firefox ID number which is causing a lot of problems deploying the user.js file. As well as ensuring Firefox is running the US 64 bit version.

For some strange reason Server 2019 does not have the Firefox version in Hkey_Current_User, only in Hkey_Local_machine. However neither Windows 10 nor Server 2016 will read the Firefox version from Hkey_local_machine, but Windows 7 apparently will.

So I have managed to sort the script so that it shows the Firefox version including 32/64 bit as well as US/En-GB versions and shows the Profile ID number for Windows 10 and Windows 7. Servers I can only get the profile ID number to show!

I am not worried about the Servers, but it is rather strange why I cannot get the script to read the browser version from HKLM with W10 and Server 2016. It is the same location as for Windows 7!

Otherwise sorted! Thanks


ShaneEP
(MM club member)
2020-04-23 06:39 PM
Re: Check Firefox Version of Network Computers

Is it a 64 bit issue? Have you tried changing the WOW64AlternateRegView option?

 Code:
$nul = SetOption("WOW64AlternateRegView", "ON")


Robdutoit
(Hey THIS is FUN)
2020-04-24 12:50 PM
Re: Check Firefox Version of Network Computers

Yes ShaneP, you are absolutely right. It did turn out to be the 64 bit issue!

I had so many problems updating my scripts a couple of years ago when I moved from Server 2008 and Windows 7 to Windows 10 and Server 2016. Most of those issues were to do with registry permissions so I just naturally assumed it was some registry permissions issue even though I checked and couldn't find any issues with the registry.

Really interesting how when one's mind is fixated on the cause being abc, one doesn't consider xyz!

Now that I have it all working, I can fix computers where Firefox is not updating and sort out computers where Firefox is using the wrong ID. Thank you.


ShaneEP
(MM club member)
2020-04-24 04:02 PM
Re: Check Firefox Version of Network Computers

Awesome. Glad it turned out to be an easy fix!