1

システムが Windows Server 2008 r2 であるかどうかを判断しようとしています。Windows 7 には同じ VersionNT 番号が付属しているため、MSINTProductType を使用しようとしましたが、このメッセージは Windows 7 システムでまだスローされています。

現時点での私のWIXコードは次のとおりです。

<Condition Message="For windows 2008 R2 system application server role service is required>
    VersionNT = 601 AND MsiNTProductType = 3 Not AppServer
<Condition/>

<Property Id="APPSERVER">
    <RegistrySearch Id="AppServerInstalled"
                    Root="HKLM"
                    Key="SOFTWARE\Microsoft\Windows\CurrentVersion"
                    Type="Raw"/>
 </Property>
4

3 に答える 3

1

http://wix.tramontana.co.hu/tutorial/getting-started/useful-extrasから:

<Condition Message='Windows 95'>Version9X = 400</Condition>
<Condition Message='Windows 95 OSR2.5'>Version9X = 400 AND WindowsBuild = 1111</Condition>
<Condition Message='Windows 98'>Version9X = 410</Condition>
<Condition Message='Windows 98 SE'>Version9X = 410 AND WindowsBuild = 2222</Condition>
<Condition Message='Windows ME'>Version9X = 490</Condition>
<Condition Message='Windows NT4'>VersionNT = 400</Condition>
<Condition Message='Windows NT4 SPn'>VersionNT = 400 AND ServicePackLevel = n</Condition>
<Condition Message='Windows 2000'>VersionNT = 500</Condition>
<Condition Message='Windows 2000 SPn'>VersionNT = 500 AND ServicePackLevel = n</Condition>
<Condition Message='Windows XP'>VersionNT = 501</Condition>
<Condition Message='Windows XP SPn'>VersionNT = 501 AND ServicePackLevel = n</Condition>
<Condition Message='Windows XP Home SPn'>VersionNT = 501 AND MsiNTSuitePersonal AND ServicePackLevel = n</Condition>
<Condition Message='Windows Server 2003'>VersionNT = 502</Condition>
<Condition Message='Windows Vista'>VersionNT = 600</Condition>
<Condition Message='Windows Vista SP1'>VersionNT = 600 AND ServicePackLevel = 1</Condition>
<Condition Message='Windows Server 2008'>VersionNT = 600 AND MsiNTProductType = 3</Condition>
<Condition Message='Windows 7'>VersionNT = 601</Condition>
于 2013-04-26T11:09:18.733 に答える
0

個人的には、Windows の世界では本質的に同じものであるため、Workation と Server のチェックは作成しません。たとえば、ここに SQL Server 2012 および TFS Server 2012 で Windows 8 を実行しているタブレットがあります。Win 8 には必要なものがすべて揃っています。 '。

サーバーにのみあるものに依存している場合は、代わりにその依存関係チェックを記述してください。

于 2013-04-26T13:22:11.453 に答える
-1

多くのテストの後、私は答えにたどり着きました

Windows 2008 r2 サーバーで作業している場合にメッセージをスローするには、次の条件ステートメントを使用できます。

  <Condition Message="Windows Server 2008R2 installed">
        <NOT (VersionNT = 601 AND MsiNTProductType > 1 )]]>
  </Condition>

アプリケーション サーバーがインストールされているかどうかを判断するためのカスタム アクションを作成しました。

<CustomAction()>
Public Shared Function CheckForAppServer(ByVal pobjSession As Session) As ActionResult
    pobjSession.Log("Beginning Check for Application Server")
    Dim lobjRegKey As RegistryKey
    If Environment.Is64BitOperatingSystem Then
        pobjSession.Log("64bit Opperating system detected")
        lobjRegKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)
    Else
        pobjSession.Log("32bit Opperating system detected")
        lobjRegKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)
    End If
    Dim lobjApplicationServerRegKey As Object = lobjRegKey.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\AppServer", True)
    If lobjApplicationServerRegKey Is Nothing Then
        pobjSession.Log("Application Server registry key not found")
        pobjSession("APPSERVER") = "0"
    Else
        pobjSession.Log(lobjApplicationServerRegKey.ToString)
        pobjSession.Log("Application Server registry key found")
        pobjSession("APPSERVER") = "1"
    End If
    Return ActionResult.Success
End Function

カスタム アクションを読み込み、InstallUISequence と Install Execute Sequence を更新して、条件付きメッセージがスローされる前にプロパティが設定されるようにします。

  <InstallUISequence>
        <Custom Action="CA_CheckForAppServer" Before="LaunchConditions" >NOT Installed</Custom>
      </InstallUISequence>
 <InstallExecuteSequence>
 <Custom Action="CA_CheckForAppServer" Before="LaunchConditions" >NOT Installed</Custom>
 </InstallExecuteSequence>

条件付きメッセージを次のように更新する

   <Condition Message="Windows Server 2008R2 requires the application server to be enabled">
        <![CDATA[APPSERVER <> 0 OR NOT (VersionNT = 601 AND MsiNTProductType > 1 )]]>
      </Condition>
于 2013-04-30T10:06:35.360 に答える