By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,881 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,881 IT Pros & Developers. It's quick & easy.

Assemblies requiring admin on Vista

P: n/a
Dear all,

Reasonably new to .NET I am confused. Some of the .exe assemblies I am
creating using VS2005 are requiring User Account Control confirmation on
Vista, but some are not. I am not intentionally (could have done it by
accident I suppose) specifiying anywhere that they should need Admin
privileges.

If I use the default project names i.e. WindowsApplication1 and so forth,
they dont need Admin. If I change the name to UpdateClient for example, then
they do.

Why is this?

Many thanks in advance!

Carl

Apr 21 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Carl,

Seems that you use some methods which request admin privileges.
So, if you want to run your application as elevated just mark your app out
with the manifest where declare UAC status

See sample there http://blogs.msdn.com/shawnfa/archiv...06/568563.aspx

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

CWDear all,
CW>
CWReasonably new to .NET I am confused. Some of the .exe assemblies I
CWam creating using VS2005 are requiring User Account Control
CWconfirmation on Vista, but some are not. I am not intentionally
CW(could have done it by accident I suppose) specifiying anywhere that
CWthey should need Admin privileges.
CW>
CWIf I use the default project names i.e. WindowsApplication1 and so
CWforth, they dont need Admin. If I change the name to UpdateClient
CWfor example, then they do.
CW>
CWWhy is this?
CW>
CWMany thanks in advance!
CW>
CWCarl
CW>
Apr 22 '07 #2

P: n/a
Carl Woodward wrote:
Dear all,

Reasonably new to .NET I am confused. Some of the .exe assemblies I am
creating using VS2005 are requiring User Account Control confirmation on
Vista, but some are not. I am not intentionally (could have done it by
accident I suppose) specifiying anywhere that they should need Admin
privileges.

If I use the default project names i.e. WindowsApplication1 and so
forth, they dont need Admin. If I change the name to UpdateClient for
example, then they do.

Why is this?
If your application doesn't have a manifest (See Michael Nemtsev's post)
Vista tries to work out whether it's a setup program, using heuristics.
If Vista believes it is a setup program, it will get run as
administrator (assuming the user allows that), and given access to the
'real' program files so that it can 'install'.
If Vista believes it's not a setup program, it will get run as a normal
user.

By putting the word "Update" in the name of the executable, you're
making Vista believe it's a setup/update program.

Alun Harford
Apr 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.