Let your installer run as an administrator
2011-10-24 14:17
489 查看
You need to ask for the permission to execute the script, and you can set the MsiBootstrapper property to TRUE as below description.
Typically, Setup.exe (also known as the bootstrapper) does not run as elevated; it runs at the current user's permission level. Therefore, the installation does not prompt for elevation when the final application installation starts. However, note that an .msi file usually prompts the user, whereas Setup.exe does not.
In the embedded UAC manifest of the bootstrapper, the requestedExecutionLevel node specifies that the installation run as the current user (asInvoker):
<requestedExecutionLevel level="asInvoker" />
However, you can elevate the application installation if you have to. For example, modifying Internet Information Services (IIS) settings in a Web Setup project requires administrative privileges, as does installing assemblies to the global assembly cache. The elevation prompt occurs after the prerequisite installations but before the application installation.
To elevate permissions for an installation, open the project (.vdproj) file. In the project file's MsiBootstrapper section, set the RequiresElevation property to True. This property is not made available through the Visual Studio integrated development environment (IDE). Therefore, you must use the project file. For more information, see RequiresElevation Property.
For more detail, you can read into my post: http://social.msdn.microsoft.com/Forums/ar/winformssetup/thread/57d4ee8e-10c5-4a7c-9bdd-82ca3458e83f
Typically, Setup.exe (also known as the bootstrapper) does not run as elevated; it runs at the current user's permission level. Therefore, the installation does not prompt for elevation when the final application installation starts. However, note that an .msi file usually prompts the user, whereas Setup.exe does not.
In the embedded UAC manifest of the bootstrapper, the requestedExecutionLevel node specifies that the installation run as the current user (asInvoker):
<requestedExecutionLevel level="asInvoker" />
However, you can elevate the application installation if you have to. For example, modifying Internet Information Services (IIS) settings in a Web Setup project requires administrative privileges, as does installing assemblies to the global assembly cache. The elevation prompt occurs after the prerequisite installations but before the application installation.
To elevate permissions for an installation, open the project (.vdproj) file. In the project file's MsiBootstrapper section, set the RequiresElevation property to True. This property is not made available through the Visual Studio integrated development environment (IDE). Therefore, you must use the project file. For more information, see RequiresElevation Property.
For more detail, you can read into my post: http://social.msdn.microsoft.com/Forums/ar/winformssetup/thread/57d4ee8e-10c5-4a7c-9bdd-82ca3458e83f
相关文章推荐
- How to Run a Program as an Administrator in Windows 7
- How to Run a Program as an Administrator in Windows 7
- How to Run a Program as an Administrator in Windows 7
- 对msi的安装包“Run As Administrator”
- mutating the [[Prototype]] of an object will cause your code to run very slowly
- How to run Cobertura as an ant build script from eclipse
- 弹出run a dll as an app对话框&amp;关机蓝屏的解决方法
- JAVA “Run as administrator” “UAC disabled” alternative solution
- 转:How to troubleshoot Enterprise Portal error ”Unable to render content due to an error. Please contact your system administrator."
- Use ILDASM.exe as an external tool in your VS2008
- AHK Run as Administrator In AHK
- Should PHP run as a CGI script or as an Apache module?
- 关于run a dll as an app的问题
- Browsing the Web and Reading E-mail Safely as an Administrator
- Force .net application run as administrator
- [C#]Enable UAC Shield icons and run as administrator
- How to create an installer for your Python program
- Nike Air Max Thea As your run or walk
- install root certificate failed, Please run as administrator/root/sudo
- Run a Command as Administrator