多くのテストの後、私は答えにたどり着きました
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>