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

Reply
 
LinkBack Thread Tools Display Modes
Old 04-22-2010, 09:01 AM   #1 (permalink)
MAN
Guest
 
Posts: n/a
Default Custom Action failes 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 issues

  Reply With Quote
Old 04-22-2010, 06:01 PM   #2 (permalink)
Wilson, Phil
Guest
 
Posts: n/a
Default Re: Custom Action failes on some PC's......

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
>


  Reply With Quote
Old 04-23-2010, 09:01 AM   #3 (permalink)
MAN
Guest
 
Posts: n/a
Default Re: Custom Action failes on some PC's......

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
>>

>


  Reply With Quote
Old 04-23-2010, 10:01 AM   #4 (permalink)
MAN
Guest
 
Posts: n/a
Default Re: Custom Action failes on some PC's......

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
>>

>


  Reply With Quote
Old 04-23-2010, 05:01 PM   #5 (permalink)
Wilson, Phil
Guest
 
Posts: n/a
Default Re: Custom Action failes on some PC's......

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
>>>

>>

>


  Reply With Quote
Old 04-26-2010, 08:01 AM   #6 (permalink)
MAN
Guest
 
Posts: n/a
Default Re: Custom Action failes on some PC's......

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
>>>>
>>>

>>

>


  Reply With Quote
Old 04-26-2010, 07:01 PM   #7 (permalink)
Wilson, Phil
Guest
 
Posts: n/a
Default Re: Custom Action failes on some PC's......

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
>>>>>
>>>>
>>>

>>

>


  Reply With Quote
Old 04-28-2010, 07:01 PM   #8 (permalink)
Richard [Microsoft Windows Installer MVP]
Guest
 
Posts: n/a
Default Re: Custom Action failes on some PC's......

[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>
  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 10:32 PM.


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