VBScript Issues in Vista - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

alexzizzi
Posts: 13
Joined: Wed Apr 30, 2008 10:44 pm

VBScript Issues in Vista

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
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: VBScript Issues in Vista

Hi,

I'm not sure why you are encountering this behavior. Can you please send us the AIP (project) file with the problem to support at advancedinstaller dot com so we can investigate it? Also, please attach a verbose log of the install process.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”