Go Back   PackageDeploy Application Packaging Forums > Package Development > Application Packaging > Windows MSI

Reply
 
LinkBack Thread Tools Display Modes
Old 04-22-2010, 08:01 AM   #1 (permalink)
MAN
Guest
 
Posts: n/a
Default vbscript calling WMI is failing running as Custom action during installation...on some PC's....

I have an issue that I have been trying to solve for quite a while now.

When the vbscript is executed from a command line there is no issue, but
when executed as a custom action during installation it failes. Here is the
script:
-------------------------------------------
Dim objLocator, objService, obj, BuildNumber

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer( , "root\cimv2") <---- it failes
here on some PC's
objService.Security_.ImpersonationLevel = 4
Set obj = objService.Get("Win32_OperatingSystem=@")

BuildNumber = obj.BuildNumber

If obj.BuildNumber >= 6000 Then
If InStr(obj.OSArchitecture,"64") Then
OS = True
End If
End If


If OS Then
'IsVista64 = True
MsgBox "You are running 64-bit"
Else
'IsVista64 = False
MsgBox "You are running 32-bit"
End If
-------------------------------------------
First I thourght that the issue has something to do with rights, but I have
not been able to fine any setting that could solve the issye

  Reply With Quote
Old 04-23-2010, 02:01 AM   #2 (permalink)
Wilson, Phil
Guest
 
Posts: n/a
Default Re: vbscript calling WMI is failing running as Custom action during installation...on some PC's....

Still waiting for an answer in platformsdk.msi.....

--
Phil Wilson


"MAN" <mads.andersen@dantecdynamics.com> wrote in message
news:3CEEA351-45CA-4B16-B8A2-982E342FD639@microsoft.com...
>I have an issue that I have been trying to solve for quite a while now.
>
> When the vbscript is executed from a command line there is no issue, but
> when executed as a custom action during installation it failes. Here is
> the script:
> -------------------------------------------
> Dim objLocator, objService, obj, BuildNumber
>
> Set objLocator = CreateObject("WbemScripting.SWbemLocator")
> Set objService = objLocator.ConnectServer( , "root\cimv2") <---- it failes
> here on some PC's
> objService.Security_.ImpersonationLevel = 4
> Set obj = objService.Get("Win32_OperatingSystem=@")
>
> BuildNumber = obj.BuildNumber
>
> If obj.BuildNumber >= 6000 Then
> If InStr(obj.OSArchitecture,"64") Then
> OS = True
> End If
> End If
>
>
> If OS Then
> 'IsVista64 = True
> MsgBox "You are running 64-bit"
> Else
> 'IsVista64 = False
> MsgBox "You are running 32-bit"
> End If
> -------------------------------------------
> First I thourght that the issue has something to do with rights, but I
> have not been able to fine any setting that could solve the issye


  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:34 AM.


vBulletin, Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
2007 - 2012 PackageDeploy.com