我需要在LaunchConditions之前檢查Framework版本,操作系統版本&管理員權限。我的操作系統版本&管理條件按預期工作,但不是框架版本。 NETFRAMEWORK35沒有被填充。以下是我的代碼。LaunchConditions之前的自定義操作
<PropertyRef Id="NETFRAMEWORK35" />
<UI>
<UIRef Id='...'/>
<Error Id="2001">Please uninstall older version of this product to continue.</Error>
<Error Id="2002">This application is only supported on Windows Server 2008(64 bit) or Windows 2003(32 or 64 bit).</Error>
<Error Id="2003">Microsoft .NET Framework Version 3.5 is missing. To download please visit $(var.FrameworkDownload)</Error>
<Error Id="2004">You need to be an administrator to install this product.</Error>
</UI>
<CustomAction Id="CurrentVersionDetected" Error="2001"/>
<CustomAction Id="WrongOSVersionDetected" Error="2002" />
<CustomAction Id="FrameworkMissing" Property="NETFRAMEWORK35" Error="2003" />
<CustomAction Id="IsNotAdministrator" Error="2004" />
<InstallExecuteSequence>
<Custom Action="IsNotAdministrator" After="FrameworkMissing">
<![CDATA[NOT(Installed OR Privileged)]]>
</Custom>
<Custom Action="FrameworkMissing" After="WrongOSVersionDetected">
**<![CDATA[NETFRAMEWORK35]]> //This is make sure it is getting fired, but not**
</Custom>
<Custom Action="WrongOSVersionDetected" After="FindRelatedProducts">
<![CDATA[NOT(Installed OR VersionNT = 601 OR (VersionNT = 600 AND VersionNT64))]]>
</Custom>
<Custom Action="CurrentVersionDetected" After="AppSearch">SELFFOUND</Custom>
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="IsNotAdministrator" After="FrameworkMissing">
<![CDATA[NOT(Installed OR Privileged)]]>
</Custom>
<Custom Action="FrameworkMissing" After="WrongOSVersionDetected">
**<![CDATA[NETFRAMEWORK35]]> //This is make sure it is getting fired, but not**
</Custom>
<Custom Action="WrongOSVersionDetected" After="FindRelatedProducts">
<![CDATA[NOT(Installed OR VersionNT = 601 OR (VersionNT = 600 AND VersionNT64))]]>
</Custom>
<Custom Action="CurrentVersionDetected" After="AppSearch">SELFFOUND</Custom>
</InstallUISequence>
But strangely same action work if i put it after InstallValidate
<Custom Action="FrameworkMissing" After="InstallValidate">
**<![CDATA[NETFRAMEWORK35]]> //This is fired**
</Custom>
謝謝,我正在使用NetFx屬性。但有沒有辦法在AppSearch之前做到這一點?這是要求,即使在啓動屏幕之前? – Suresh 2011-06-10 11:47:13
@Suresh:沒有.AppSearch是什麼設置屬性。但LaunchConditions出現在AppSearch之後,所以沒有問題......? – 2011-06-10 12:04:24
問題是啓動屏幕顯示,任何錯誤都顯示爲對話框(如子窗口)。但是,如果你看我的代碼進行操作系統版本檢查,管理員檢查啓動屏幕將永遠不會顯示。當你點擊msi時,它只是一個錯誤窗口並停止。我正在嘗試爲框架版本獲得類似的行爲。我清楚了嗎? – Suresh 2011-06-10 12:46:37