Hi,
I'm currently running a check to see if a firefox extension is installed and if it is installed it will send a property back to the installer. It works great in XP, however in Vista it just ignores it for some reason. I also tried the script by itself in Vista with a msgbox saying "installed or "not installed" which worked great. I believe it has something to do with the installer launching the vbs. Below is the script. Basically it first does an OS check, and based on the OS it will find out the firefox profile directory. And then it'll do a search with that profile directory and the extension path. I don't believe it's a UAC problem in vista, since I'm running it as "highest available". Any help would be greatly appreciated.
Set WSHShell = CreateObject("WScript.Shell")
Dim OS
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
OS = objOperatingSystem.Caption & " " & _
objOperatingSystem.Version
Next
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "vista"
.IgnoreCase = True
.Global = True
End With
expressionmatch = RegularExpressionObject.Test(OS)
If expressionmatch Then
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("Select * from Win32_Directory where Name Like '%Users%\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\%.default'")
For Each objFolder in colFolders
PROFILE = objFolder.Name
Exit For
Next
Else
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("Select * from Win32_Directory where Name Like '%Documents and Settings%\\Application Data\\Mozilla\\Firefox\\Profiles\\%.default'")
For Each objFolder in colFolders
PROFILE = objFolder.Name
Exit For
Next
End If
dim SEARCH
SEARCH = PROFILE & "\extensions\{68f5cad1-0fed-4118-befb-5510cc1772ae}"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(SEARCH) Then
Session.Property("TOOLBARFF") = "1"
End If
FOLLOW US
Get the latest news in Application Packaging