|
|
#1 (permalink) |
|
Guest
Posts: n/a
|
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 issues |
|
|
|
#2 (permalink) |
|
Guest
Posts: n/a
|
What type of custom action is this exactly? Deferred? Impersonated? Running
with the system account? You can probably use standard properties like Intel64 and VersionNT64 to see what you're running on. -- Phil Wilson "MAN" <man@dantecdynamics.com> wrote in message news:E3186B6E-BB85-40C0-97AD-21A395BBAD81@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 issues > |
|
|
|
#3 (permalink) |
|
Guest
Posts: n/a
|
The Custom Action is running Impersonated.
You are right, I could probably use the propertied you mention, but this is not the issue here. The issue is that I do not get access to WMI. Mads "Wilson, Phil" <philw@wonderware.nospam.com> wrote in message news:47D5265C-D875-4CB0-8D6F-00520B70DCE8@microsoft.com... > What type of custom action is this exactly? Deferred? Impersonated? > Running with the system account? > > You can probably use standard properties like Intel64 and VersionNT64 to > see what you're running on. > -- > Phil Wilson > > > "MAN" <man@dantecdynamics.com> wrote in message > news:E3186B6E-BB85-40C0-97AD-21A395BBAD81@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 issues >> > |
|
|
|
#4 (permalink) |
|
Guest
Posts: n/a
|
I have now investigated this further.
In orca the custom action is described as follows: Action: NewCustomAction1 Type: 6 Source NewBinary19 Target: IsVista64 Does this help you ? regards Mads "Wilson, Phil" <philw@wonderware.nospam.com> wrote in message news:47D5265C-D875-4CB0-8D6F-00520B70DCE8@microsoft.com... > What type of custom action is this exactly? Deferred? Impersonated? > Running with the system account? > > You can probably use standard properties like Intel64 and VersionNT64 to > see what you're running on. > -- > Phil Wilson > > > "MAN" <man@dantecdynamics.com> wrote in message > news:E3186B6E-BB85-40C0-97AD-21A395BBAD81@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 issues >> > |
|
|
|
#5 (permalink) |
|
Guest
Posts: n/a
|
I think the problem might be that a type 6 custom action is already running
with impersonation, and Windows doesn't allow another impersonation, so I suspect that WMI fails to impersonate on a process that is already impersonating. -- Phil Wilson The Definitive Guide to Windows Installer http://www.apress.com/book/view/1590592972 "MAN" <man@dantecdynamics.com> wrote in message news:7AEE97F2-BE99-4176-9D50-478638DC4A7A@microsoft.com... >I have now investigated this further. > In orca the custom action is described as follows: > Action: NewCustomAction1 > Type: 6 > Source NewBinary19 > Target: IsVista64 > > Does this help you ? > > regards > Mads > > "Wilson, Phil" <philw@wonderware.nospam.com> wrote in message > news:47D5265C-D875-4CB0-8D6F-00520B70DCE8@microsoft.com... >> What type of custom action is this exactly? Deferred? Impersonated? >> Running with the system account? >> >> You can probably use standard properties like Intel64 and VersionNT64 to >> see what you're running on. >> -- >> Phil Wilson >> >> >> "MAN" <man@dantecdynamics.com> wrote in message >> news:E3186B6E-BB85-40C0-97AD-21A395BBAD81@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 issues >>> >> > |
|
|
|
#6 (permalink) |
|
Guest
Posts: n/a
|
hmm... it is working on some PC's...
At first I thorough it was something to do with rights or security so I have been through all security settings for WMI, RPC and DCOM on the PC. I have been through all machine policies on the PC that fails. I have been through all Group and User policies. There a nothing that I can point at that might be the cause... Anyhow, there is something special about this PC that makes the install fail. Do you have a suggestion? (Any is suggestion is a good suggestion ;o) Mads "Wilson, Phil" <philw@wonderware.nospam.com> wrote in message news:C8D073E7-F268-4D9A-A439-EDFC06C5D5DF@microsoft.com... >I think the problem might be that a type 6 custom action is already running >with impersonation, and Windows doesn't allow another impersonation, so I >suspect that WMI fails to impersonate on a process that is already >impersonating. > -- > Phil Wilson > The Definitive Guide to Windows Installer > http://www.apress.com/book/view/1590592972 > > > "MAN" <man@dantecdynamics.com> wrote in message > news:7AEE97F2-BE99-4176-9D50-478638DC4A7A@microsoft.com... >>I have now investigated this further. >> In orca the custom action is described as follows: >> Action: NewCustomAction1 >> Type: 6 >> Source NewBinary19 >> Target: IsVista64 >> >> Does this help you ? >> >> regards >> Mads >> >> "Wilson, Phil" <philw@wonderware.nospam.com> wrote in message >> news:47D5265C-D875-4CB0-8D6F-00520B70DCE8@microsoft.com... >>> What type of custom action is this exactly? Deferred? Impersonated? >>> Running with the system account? >>> >>> You can probably use standard properties like Intel64 and VersionNT64 to >>> see what you're running on. >>> -- >>> Phil Wilson >>> >>> >>> "MAN" <man@dantecdynamics.com> wrote in message >>> news:E3186B6E-BB85-40C0-97AD-21A395BBAD81@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 issues >>>> >>> >> > |
|
|
|
#7 (permalink) |
|
Guest
Posts: n/a
|
Not really. I've seen this before with WMI custom actions, and I've never
been able to find a definite reason, but I think impersonation has something to do with it, and UAC makes it more complicated. I avoid WMI custom actions. I think those Intel, VersionNT64 etc will give you the answer you want, and a simple C++ Dll custom action that calls GetSystemInfo ()will also tell you the OS architecture. -- Phil Wilson "MAN" <man@dantecdynamics.com> wrote in message news:94FC6C05-EB6B-481C-AA1C-71A524847A1C@microsoft.com... > hmm... it is working on some PC's... > At first I thorough it was something to do with rights or security so I > have been through all security settings for WMI, RPC and DCOM on the PC. I > have been through all machine policies on the PC that fails. I have been > through all Group and User policies. There a nothing that I can point at > that might be the cause... > > Anyhow, there is something special about this PC that makes the install > fail. > > Do you have a suggestion? (Any is suggestion is a good suggestion ;o) > > Mads > > > > > "Wilson, Phil" <philw@wonderware.nospam.com> wrote in message > news:C8D073E7-F268-4D9A-A439-EDFC06C5D5DF@microsoft.com... >>I think the problem might be that a type 6 custom action is already >>running with impersonation, and Windows doesn't allow another >>impersonation, so I suspect that WMI fails to impersonate on a process >>that is already impersonating. >> -- >> Phil Wilson >> The Definitive Guide to Windows Installer >> http://www.apress.com/book/view/1590592972 >> >> >> "MAN" <man@dantecdynamics.com> wrote in message >> news:7AEE97F2-BE99-4176-9D50-478638DC4A7A@microsoft.com... >>>I have now investigated this further. >>> In orca the custom action is described as follows: >>> Action: NewCustomAction1 >>> Type: 6 >>> Source NewBinary19 >>> Target: IsVista64 >>> >>> Does this help you ? >>> >>> regards >>> Mads >>> >>> "Wilson, Phil" <philw@wonderware.nospam.com> wrote in message >>> news:47D5265C-D875-4CB0-8D6F-00520B70DCE8@microsoft.com... >>>> What type of custom action is this exactly? Deferred? Impersonated? >>>> Running with the system account? >>>> >>>> You can probably use standard properties like Intel64 and VersionNT64 >>>> to see what you're running on. >>>> -- >>>> Phil Wilson >>>> >>>> >>>> "MAN" <man@dantecdynamics.com> wrote in message >>>> news:E3186B6E-BB85-40C0-97AD-21A395BBAD81@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 issues >>>>> >>>> >>> >> > |
|
|
|
#8 (permalink) |
|
Guest
Posts: n/a
|
[Please do not mail me a copy of your followup]
What are you trying to learn from that CA? If its just the 64-bit nature of the machine, then use the standard system properties mentioned by Phil. If you're trying to do something else, then let's talk about that. Its rare that there's exactly one way of doing things on a computer. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/> Legalize Adulthood! <http://legalizeadulthood.wordpress.com> |
|