Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
217 views
in Technique[技术] by (71.8m points)

c++ - Set app to require elevation?

I'm working on the bootstrap application of a new installer for some of our products. So far, I've been relying on two things that I read about somewhere:

  1. Applications whose name contains "setup" or "install" will run elevated by default.
  2. Applications that run elevated will launch other applications in elevated mode.

Recent testing has found that one or both of these statements is false, because one of the applications that I'm launching is a third party installer that requires elevation, and it's failing because of the elevation requirement.

How do I set my application to require elevation? I know it has something to do with the manifest file. As I'm working in Visual Studio 2008, and the manifest file is generated, I'd like to know what to enter into the project's properties and where to make it require elevation.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

When I couldn't find application manifest as a new item that could be added to my project, I went into the online help and found this:

configure the VS2008 in Configuration Properties - Linker - Manifest File - UAC Execution Level (requireAdministrator)

That did the trick.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...