내가 발견이 솔루션은 내가 사용자가 적절한 권한이없는 경우 UAC를 묻는 메시지가 표시됩니다 부트 스트 래퍼 내 설치를 합병했다.
이 방법을 사용하지 않으려면이 코드가 도움이 될 수 있습니다.
공용 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;
}
}