Page 1 of 1 1
Topic Options
#213850 - 2020-04-20 10:37 PM Check Firefox Version of Network Computers
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
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.

Top
#213851 - 2020-04-21 01:28 AM Re: Check Firefox Version of Network Computers [Re: Robdutoit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#213852 - 2020-04-21 05:00 PM Re: Check Firefox Version of Network Computers [Re: Glenn Barnas]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
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
Top
#213853 - 2020-04-22 03:52 PM Re: Check Firefox Version of Network Computers [Re: Robdutoit]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
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

Top
#213854 - 2020-04-23 06:39 PM Re: Check Firefox Version of Network Computers [Re: Robdutoit]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Is it a 64 bit issue? Have you tried changing the WOW64AlternateRegView option?

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


Edited by ShaneEP (2020-04-23 06:39 PM)

Top
#213855 - 2020-04-24 12:50 PM Re: Check Firefox Version of Network Computers [Re: ShaneEP]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
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.

Top
#213856 - 2020-04-24 04:02 PM Re: Check Firefox Version of Network Computers [Re: Robdutoit]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Awesome. Glad it turned out to be an easy fix!
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.057 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org