「これはこのインストールで削除される予定です」というダイアログをユーザーに表示したい場合は、「はい」または「OK」を押すとインストールされます続けることができます。さもなければ、私はそれを中止したい。WiX - vbscript session.message関数を使用したカスタムアクション
そこで私はこのようなカスタムアクション(実行VBScript)を定義している:
<CustomAction Id="ShowUninstallInformationDlg" Impersonate="yes" Return="check" Execute="immediate" BinaryKey="ShowUninstallInformationDlg.vb" VBScriptCall=""/>
<Binary Id="ShowUninstallInformationDlg.vb" SourceFile="c:\myscripts\installer\ShowUninstallInformationDlg.vbs"/>
<InstallExecuteSequence>
<Custom Action="ShowUninstallInformationDlg" After="FindRelatedProducts">NOT Installed AND NOT PATCH AND NOT MYPRODUCT_ANYVERSION=""</Custom>
</InstallExecuteSequence>
VBSCRIPT(ShowUninstallInformationDlg.vbs):
'ShowUninstallInformationDlg
Option Explicit
Dim text
Dim productName
Dim rec
productName = Session.Property("ProductName")
text = "The following installations are going to be removed with the installation of " & productName & ":"
If Session.Property("MYPRODUCT_ANYVERSION") <> "" Then
text = text & "\n * MyOtherProduct (any version)"
End If
Set rec = Session.Installer.CreateRecord(1)
rec.StringData(0) = text
Session.Message &H0B000034, rec
私は "として使用しています種類 "& H0B000034" Session.Message "引数はMSDNの例です(http://msdn.microsoft.com/en-us/library/windows/desktop/aa371672(v=vs.85).aspx参照)。
常にスクリプトは、私は私のMSIログに次のエラーを取得する実行されている:私は大規模なSession.Messageを使用例については、Googleを検索しました
Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action ShowUninstallInformationDlg script error -2147467259, Msi API Error: Message,Kind,Record Line 19, Column 1,
、ない後続の結果と...誰が助けることができます?ありがとう!
あなたは何をしているのかをvbscriptする必要はありません。プロパティをControlEventの条件として使用して、MSIダイアログを表示することができます。 VBScriptでこれを行うと、脆弱であることが知られているテクノロジへの依存を追加するだけで、インストーラの信頼性が低下します。 –
私はすでにそれを試みましたが、私はいつも終了することなくダイアログでUIチェーンを中断できませんでした!実例がありますか? – moik