1

我正在尝试编写一个 WiX 安装程序,它将安装一个具有众所周知的权限的 MSMQ 队列,例如 NetworkService。

看起来 MessageQueuePermission 标记允许指定用户标记,但如何指定知名用户?

4

1 回答 1

3

以下 WiX 组件有效:

<?xml version="1.0" encoding="utf-8"?>
<!-- Message queues installation (MSMQ is used by NServiceBus). -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:msmq="http://schemas.microsoft.com/wix/MsmqExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     >
  <Fragment>
    <ComponentGroup Id="MessageQueues">
      <Component Id="MessageQueuesComponent"
                 Directory="INSTALLLOCATION"
                 Guid="C4BBEF3F-63A3-427E-A661-7A6E6BAFD543">
        <CreateFolder />

        <util:User Id="UserEveryOne"
                   CreateUser="no"
                   Name="Everyone"
                   />

        <!--Create the input queue.-->
        <msmq:MessageQueue
            Id="myinputqueue"
            Label="myinputqueue"
            PathName=".\private$\myinputqueue"
            PrivLevel="none"
            Transactional="yes">
          <msmq:MessageQueuePermission
            Id="myinputqueue"
            DeleteQueue="yes"
            QueueGenericAll="yes"
            ReceiveMessage="yes"
            TakeQueueOwnership="yes"
            User="UserEveryOne"
            WriteMessage="yes"
            />          
        </msmq:MessageQueue>

      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>
于 2012-06-22T16:33:46.370 回答