ダイアログボックスの1つにListBoxとAdd/Removeボタンを持つインストーラがあります。 Items to ListBoxは、自分のCAを追加して削除します。Wix:ListBoxから設定ファイルに値を保存
Microsoft.Deployment.WindowsInstaller.View listBoxView = session.Database.OpenView("select * from ListBox where Property = '" + listBoxProperty + "'");
listBoxView.Execute(null);
int count = 0;
while (listBoxView.Fetch() != null)
count++;
Record newListBoxRecord = new Record(4);
newListBoxRecord[1] = listBoxProperty;
newListBoxRecord[2] = ++count;
newListBoxRecord[3] = listItemValue;
newListBoxRecord[4] = listItemValue;
ICollection<ValidationErrorInfo> errors = listBoxView.ValidateNew(newListBoxRecord);
if (errors == null)
listBoxView.Modify(ViewModifyMode.InsertTemporary, newListBoxRecord);
項目は正常に追加され削除されますが、後でアプリケーション設定ファイルに保存する必要があります。 Defferedアクションはインストーラーデータベースにアクセスできないので、InstallFinalizeの後にImmediateアクションを使用しました。しかし、私がListBoxテーブルを読むと、それは空です。私はInsertTemporaryの修正モードのためにそれが起こることを奨励します。挿入モードでは、「実行中に関数が失敗しました。データベース:テーブルの更新に失敗しました。エラー。