Copy to Program Files under Windows Vista/7

一世执手 提交于 2019-12-23 17:48:04

问题


I have written a wizard in C++ which installs some files to the program files folder under windows. As I understand, I need Admin rights to write to program files under Vista/7. So my question is: Is there a way to turn on Admin rights while the application is running respectively only for one wizard page? Or do I have to start another process with Admin rights for this one wizard page?


回答1:


Typically you have a shield logo'd button and then shell out to another process whose manifest requests elevation.

But really it sounds like you're writing an installer so you should use something designed for that like WiX.

See also this similar question and this cited article from one of the answers thereof



来源:https://stackoverflow.com/questions/1795784/copy-to-program-files-under-windows-vista-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!