ここで私自身に答えるつもりです。
解決策は、セットアッププロジェクトのプロパティGUIでカスタムアクションを表示することでした。そこから、カスタムアクションを選択すると、CustomActionDataを編集できます。この場合、次のように入力します。
/AllUsers=[ALLUSERS]
そこから、カスタムアクションCSコードからすべてのユーザーがインストールしたかどうかを検出できました。
private bool IsAllUsersInstall()
{
// An ALLUSERS property value of 1 specifies the per-machine installation context.
// An ALLUSERS property value of an empty string ("") specifies the per-user installation context.
// In the custom action data, we have mapped the parameter 'AllUsers' to ALLUSERS.
string s = base.Context.Parameters["AllUsers"];
if (s == null)
return true;
else if (s == string.Empty)
return false;
else
return true;
}
これが誰かを助けてくれることを願っています:)