How to trigger the UAC in vista
Page 1 of 113 Replies - 7285 Views - Last Post: 22 June 2012 - 12:03 PM
#1
How to trigger the UAC in vista
Posted 26 April 2009 - 08:26 AM
does anyone know the actual code to put into the my.settings file for this? or something like that I saw it in a post now I cant find it again 0_o .
Replies To: How to trigger the UAC in vista
#2
Re: How to trigger the UAC in vista
Posted 26 April 2009 - 08:30 AM
What do you mean by trigger the UAC?
#3
Re: How to trigger the UAC in vista
Posted 26 April 2009 - 08:37 AM
#4
Re: How to trigger the UAC in vista
Posted 26 April 2009 - 08:59 AM
You don't trigger it, the protection system in vista triggers it. (The registry is one of those protected places)
Even an Administrator User group has to give permission. Only one it doesn't ask, with UAC on, is the System Administrator (Administrator).
Get used to UAC it in Windows 7. In 64bit Window Vista & 7 UAC is not there, as Microsoft believe that if you're developing for a 64bit OS then you should be able to follow the guidelines.
If you don't want it appear change your program to follow the rules: See the document on VB.net resources page.
Stop thinking that VISTA Administrator = XP Administrator. (There not the same.)
The ultimate aim for the Vista Developer is develop your application/program to run under Limited User group status right, not Administrator group rights.
Set one up on your development system run your application under conditions, you'll be surprised by what breaks. (Even Microsoft applications broke.)
Even an Administrator User group has to give permission. Only one it doesn't ask, with UAC on, is the System Administrator (Administrator).
Get used to UAC it in Windows 7. In 64bit Window Vista & 7 UAC is not there, as Microsoft believe that if you're developing for a 64bit OS then you should be able to follow the guidelines.
If you don't want it appear change your program to follow the rules: See the document on VB.net resources page.
Stop thinking that VISTA Administrator = XP Administrator. (There not the same.)
The ultimate aim for the Vista Developer is develop your application/program to run under Limited User group status right, not Administrator group rights.
Set one up on your development system run your application under conditions, you'll be surprised by what breaks. (Even Microsoft applications broke.)
#5
Re: How to trigger the UAC in vista
Posted 26 April 2009 - 09:19 AM
AdamSpeight2008, on 26 Apr, 2009 - 07:59 AM, said:
The ultimate aim for the Vista Developer is develop your application/program to run under Limited User group status right, not Administrator group rights.
Set one up on your development system run your application under conditions, you'll be surprised by what breaks. (Even Microsoft applications broke.)
Set one up on your development system run your application under conditions, you'll be surprised by what breaks. (Even Microsoft applications broke.)
1. I dont have windows 7 so cant test that environment
2. this app is designed specificly for Administrators
the reason is, is that when I excicute the code it always says that I dont have permission to edit the registry event though I blantently do
#6
Re: How to trigger the UAC in vista
Posted 26 April 2009 - 09:51 AM
Asscotte, on 26 Apr, 2009 - 03:19 PM, said:
AdamSpeight2008, on 26 Apr, 2009 - 07:59 AM, said:
The ultimate aim for the Vista Developer is develop your application/program to run under Limited User group status right, not Administrator group rights.
Set one up on your development system run your application under conditions, you'll be surprised by what breaks. (Even Microsoft applications broke.)
Set one up on your development system run your application under conditions, you'll be surprised by what breaks. (Even Microsoft applications broke.)
1. I dont have windows 7 so cant test that environment
Asscotte, on 26 Apr, 2009 - 03:19 PM, said:
2. this app is designed specificly for Administrators
the reason is, is that when I excicute the code it always says that I dont have permission to edit the registry event though I blantently do
the reason is, is that when I excicute the code it always says that I dont have permission to edit the registry event though I blantently do
1. Re-Read the text you quoted. (Hint: I made it Red & Bold)
2. Did you understand what i wrote.
With UAC turned on only the System Administrator is not prompted, not Administrators.
That depends on where in the registry you want to edit.
#7
Re: How to trigger the UAC in vista
Posted 26 April 2009 - 01:05 PM
Sure, but how installers do it?
They are exceptionally allowed to change the register?
I am using XP though...
They are exceptionally allowed to change the register?
I am using XP though...
#8
Re: How to trigger the UAC in vista
Posted 26 April 2009 - 01:57 PM
Installers are prompted.
Generally speaking Limit Users wouldn't be Installing the software, but if they did it prompts an Administrator's password.
Generally speaking Limit Users wouldn't be Installing the software, but if they did it prompts an Administrator's password.
#9 Guest_GertMenkel*
Re: How to trigger the UAC in vista
Posted 11 May 2010 - 09:09 AM
If you use Visual Studio 2008, you should try going to My Project -> Application -> View UAC Settings.
If you edit some values in there, the user will be asked for a admin password every time the application is launched.
If you edit some values in there, the user will be asked for a admin password every time the application is launched.
#10
Re: How to trigger the UAC in vista
Posted 10 September 2010 - 07:20 AM
This will prompt:
Imports System.Security.Principal
Module VistaSecurity
'Declare API
Private Declare Ansi Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
Private Const BCM_FIRST As Int32 = &H1600
Private Const BCM_SETSHIELD As Int32 = (BCM_FIRST + &HC)
Public Function IsVistaOrHigher() As Boolean
Return Environment.OSVersion.Version.Major < 6
End Function
' Checks if the process is elevated
Public Function IsAdmin() As Boolean
Dim id As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim p As WindowsPrincipal = New WindowsPrincipal(id)
Return p.IsInRole(WindowsBuiltInRole.Administrator)
End Function
' Add a shield icon to a button
Public Sub AddShieldToButton(ByRef b As Button)
b.FlatStyle = FlatStyle.System
SendMessage(b.Handle, BCM_SETSHIELD, 0, &HFFFFFFFF)
End Sub
' Restart the current process with administrator credentials
Public Sub RestartElevated()
Dim startInfo As ProcessStartInfo = New ProcessStartInfo()
startInfo.UseShellExecute = True
startInfo.WorkingDirectory = Environment.CurrentDirectory
startInfo.FileName = Application.ExecutablePath
startInfo.Verb = "runas"
Try
Dim p As Process = Process.Start(startInfo)
Catch ex As Exception
Return 'If cancelled, do nothing
End Try
Application.Exit()
End Sub
End Module
#11
Re: How to trigger the UAC in vista
Posted 10 September 2010 - 06:29 PM
Did you realize this thread was over a year old?!?! Good stuff though...
#12
Re: How to trigger the UAC in vista
Posted 10 September 2010 - 07:25 PM
#13
Re: How to trigger the UAC in vista
Posted 10 September 2010 - 07:33 PM
They are the necromizer...
#14
Re: How to trigger the UAC in vista
Posted 22 June 2012 - 12:03 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|