Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wix <;util:User/>;不使用更新值的属性引用_Wix_Wix3.6 - Fatal编程技术网

Wix <;util:User/>;不使用更新值的属性引用

Wix <;util:User/>;不使用更新值的属性引用,wix,wix3.6,Wix,Wix3.6,我正在尝试使用将logonAsService授予UI指定的用户。此属性值在运行时处理此util:User之前更新 我知道这一点,因为我可以给SERVICEACCOUNTFULL属性一个默认值“localhost\defaultUserValue”并设置CreateUser=“yes”,它将生成一个运行时messagebox错误,在我的自定义操作设置属性值后显示原始值。不确定为什么不能创建用户,但它显示了正确的时机。如果我将属性默认值硬编码为动态设置的值(使用CreateUser=“no”),它就

我正在尝试使用
将logonAsService授予UI指定的用户。此属性值在运行时处理此util:User之前更新

我知道这一点,因为我可以给SERVICEACCOUNTFULL属性一个默认值“localhost\defaultUserValue”并设置CreateUser=“yes”,它将生成一个运行时messagebox错误,在我的自定义操作设置属性值后显示原始值。不确定为什么不能创建用户,但它显示了正确的时机。如果我将属性默认值硬编码为动态设置的值(使用
CreateUser=“no”
),它就可以工作

作为同一组件的一部分,我拥有的
标记正确地使用了属性的更新值,但
不会

请记住,我正在验证createUser步骤是否发生在设置属性值的自定义操作程序之后。但现在我要奇怪地提到,createUser操作执行在日志中,就在获取属性值的自定义操作的上方,其
Before=“InstallFiles”

帮忙?谢谢

===========

嗨,罗布

不太确定你需要看什么,但我认为这些是相关的:

<Component Id="Service" Guid='*'>
  <File Source='$(var.root)My Service.exe' />
  <ServiceInstall Id="ServiceInstall"
    Name="MyServer"
    DisplayName="My Server"
    Type="ownProcess"
    Start="auto"
    ErrorControl="normal"
    Description="My Server Windows Service"
    Interactive="no"
    Account="[SERVICEACCOUNTFULL]"
    Password="[SERVICEACCOUNTPASSWORD]" />
  <ServiceControl Id="StopMyServer" Name="MyServer" Stop="both" Wait="yes" Remove="uninstall" />
  <util:User Id="UpdateServiceAccountLogonAsService" UpdateIfExists="yes" 
    CreateUser="no" Name="[SERVICEACCOUNTFULL]" LogonAsService="yes"/>
</Component>

...

<Binary Id="ConfigBinary" SourceFile="$(var.....TargetDir)$(var.Configuration.TargetName).CA.exe" />

<Property Id="Net">net.exe</Property>
<CustomAction Id="NetStart" Property="Net" ExeCommand="START MyServer" Return="check" />

<Property Id="PerformNetStart" Value="0" />
<CustomAction Id='SetPerformNetStart' Property='PerformNetStart' Value='1' />
<CustomAction Id="RunConfiguration" BinaryKey="ConfigBinary" DllEntry="RunConfiguration" Execute="immediate" Return="check" />
<CustomAction Id='IsPrivileged' Error='You must be an admin to install this feature' />

<InstallExecuteSequence>
    <Custom Action='IsPrivileged' Before='RunConfiguration'>
    <![CDATA[Not Privileged AND &FeatureServer > 2 ]]>
    </Custom>
    <Custom Action="RunConfiguration" Before="InstallFiles">
    <![CDATA[&FeatureServer > 2 AND Not Installed ]]>
    </Custom>
    <Custom Action="SetPerformNetStart" Before="InstallFiles">
    <![CDATA[&FeatureServer > 2 AND Not Installed ]]>
    </Custom>
    <Custom Action="NetStart" After="InstallFinalize">
    PerformNetStart = 1
    </Custom>
</InstallExecuteSequence>
以下是硬编码有效值运行的日志:

MSI (s) (F0:F8) [18:29:29:191]: Created Custom Action Server with PID 4796 (0x12BC).
MSI (s) (F0:CC) [18:29:29:211]: Running as a service.
MSI (s) (F0:CC) [18:29:29:213]: Hello, I'm your 32bit Impersonated custom action server.
MSI (s) (F0!48) [18:29:29:240]: PROPERTY CHANGE: Adding CreateUserRollback property. Its value is '**********'.
MSI (s) (F0!48) [18:29:29:243]: Doing action: CreateUserRollback
Action 18:29:29: CreateUserRollback. 
Action start 18:29:29: CreateUserRollback.
CreateUserRollback: 
Action ended 18:29:29: CreateUserRollback. Return value 1.
MSI (s) (F0!48) [18:29:29:247]: PROPERTY CHANGE: Adding CreateUser property. Its value is '**********'.
MSI (s) (F0!48) [18:29:29:247]: Doing action: CreateUser
Action 18:29:29: CreateUser. 
Action start 18:29:29: CreateUser.
CreateUser: 
Action ended 18:29:29: CreateUser. Return value 1.
Action ended 18:29:29: ConfigureUsers. Return value 1.
MSI (s) (F0:F0) [18:29:29:252]: Skipping action: IsPrivileged (condition is false)
MSI (s) (F0:F0) [18:29:29:252]: Doing action: RunConfiguration
Action 18:29:29: RunConfiguration. 
Action start 18:29:29: RunConfiguration.
MSI (s) (F0:E0) [18:29:29:286]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIC008.tmp, Entrypoint: RunConfiguration
SFXCA: Extracting custom action to temporary directory: C:\Users\Jason\AppData\Local\Temp\MSIC008.tmp-\
SFXCA: Binding to CLR version v4.0.30319
Calling custom action ...Configuration!...RunConfiguration
Begin RunConfiguration
Setting MSI values from RunConfiguration
MSI (s) (F0!48) [18:29:47:629]: PROPERTY CHANGE: Modifying RUNTIMECONNECTIONSTRING property. Its current value is 'DEFAULT'. Its new value: 'Data Source=.;Initial Catalog=DB;Integrated Security=True'.
MSI (s) (F0!48) [18:29:47:629]: PROPERTY CHANGE: Modifying SERVICEACCOUNTFULL property. Its current value is 'MyDomain\DEFAULTVALUE'. Its new value: 'MyDomain\svcAccount'.
...
Returning from RunConfiguration
它是以这种向后的顺序记录的,这可以解释问题,除了当我在CreateUser=“yes”上发出CreateUser操作错误时,它显然会在配置自定义操作返回后发生几次。但也许它以某种奇怪的方式排队,而真正的问题是执行顺序——在这种情况下,我仍然不知道如何控制顺序


这是一个很好的诊断信息吗?

问题是,设置
用户使用的属性的自定义操作
RunConfiguration
运行得太晚。在
InstallFiles
之前安排
RunConfiguration
而不是在
ConfigureUsers
之前安排操作。比如:

<Custom Action="RunConfiguration" Before="ConfigureUsers">
<![CDATA[&FeatureServer > 2 AND Not Installed ]]>
</Custom>

2和未安装]]>

问题在于,设置
用户使用的属性的自定义操作
RunConfiguration
运行得太晚。在
InstallFiles
之前安排
RunConfiguration
而不是在
ConfigureUsers
之前安排操作。比如:

<Custom Action="RunConfiguration" Before="ConfigureUsers">
<![CDATA[&FeatureServer > 2 AND Not Installed ]]>
</Custom>

2和未安装]]>

如果不起作用,您能否添加有关如何设置
SERVICEACCOUNTFULL
的信息。这可能会提供很多信息。谢谢!我对问题进行了更详细的编辑。您能否添加有关如何在不起作用的情况下设置
SERVICEACCOUNTFULL
的信息。这可能会提供很多信息。谢谢!我用更多的细节编辑了这个问题。太棒了,谢谢!首先感谢您提供的工具集!太棒了,谢谢!首先感谢您提供的工具集!