は、私が見つけた解決策は、私は、ユーザーが適切な権限を持っていない場合、UACのために要求されますブートストラップと私のインストーラを合併しました。
この方法を使用したくない場合は、このコードを参考にしてください。
のpublic staticのActionResultのCHECKPRIVILEGES(セッションセッション)
{
bool isadmin = false;
System.Security.Principal.WindowsIdentity wi = System.Security.Principal.WindowsIdentity.GetCurrent();
System.Security.Principal.WindowsPrincipal wp = new System.Security.Principal.WindowsPrincipal(wi);
if (wp.IsInRole("Administrators"))
isadmin = true;
else
isadmin = false;
if (isadmin)
{
return ActionResult.Success;
}
else
{
if (System.Environment.OSVersion.Version.Major >= 6) // Windows Vista or higher
MessageBox.Show("Administrator priveleges are required to install the application. Please right click the setup file and select 'Run as administrator'.", "Mesaage", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
MessageBox.Show("Administrator priveleges are required to install the application.", "Mesaage", MessageBoxButtons.OK, MessageBoxIcon.Error);
return ActionResult.Failure;
}
}