許可されていない msi から msi を実行しようとしているため、必要なことを VS のセットアップと展開から実行できないようです。したがって、回避策として、いくつかのチェックボックスとこのような機能を備えた小さな「ラッパー」Windowsフォームアプリケーションを作成する必要がありました
private void InstallComponent(string filePath)
{
System.Diagnostics.Process installerProcess;
installerProcess = System.Diagnostics.Process.Start(filePath);
while (installerProcess.HasExited == false)
{
//indicate progress to user
Application.DoEvents();
System.Threading.Thread.Sleep(250);
}
}
そして、次の行に沿って何かを行う「インストール」ボタン
private void buttonInstall_Click(object sender, EventArgs e)
{
if (checkBoxCanonDrivers.Checked)
{
InstallComponent("CanonSetup.exe");
}
if (checkBoxEpsonDrivers.Checked)
{
InstallComponent("EpsonSetup.exe");
}
// ............
InstallComponent("MyMainApplicationSetup.exe");
}
XMLファイルなどからセットアップファイルの場所を読み取るなど、このアプリを柔軟にするためにオフにしますが、それは質問の範囲外です...