Windows Installer 引导程序 - 权限
我有 SQL Server 2008 R2、.NET Framework 3.5、.NET Framework 4 等的自定义引导程序。我正在使用 Visual STudio 2010 的部署项目来部署 .NET 4 应用程序。我知道这些都会消失。
如果用户没有特定的 Windows 权限,是否可以指定引导程序失败? SQL Server 的安装程序似乎可以自行处理此问题,但会提供非常隐晦的错误代码和文本,用户很难跟踪这些错误代码和文本。我知道我可以为 Windows 版本设置绕过,并且 SqlCheck.exe 会执行某种版本检查。我是否必须创建自己的应用程序来检查用户的权限,并且引导程序可以检查其返回代码,类似于 SqlCheck.exe?
这可以使用 Bootstrapper Manifest Generator 来完成吗?Visual Studio 2010 是否支持 BMG?似乎不再受支持,但我不确定 VS 2010 / Windows Installer 4.5 是否有任何特定内容 http://archive.msdn.microsoft.com/bmg
I have custom bootstrappers for SQL Server 2008 R2, .NET Framework 3.5, .NET Framework 4, etc. I am using Visual STudio 2010's Deployment project to deploy a .NET 4 application. I know these are going away.
Is there a way I can specify a bootstrapper to Fail if the user does not have specific Windows Privledges? SQL Server's Setup seems to take care of this on its own, but gives very cryptic error codes and texts that are hard to trace for users. I know that I can set Bypasses for Windows versions, and SqlCheck.exe performs some sort of version check. Would I have to create my own application that checks the user's permissions, and the bootstrapper could check the return code of that, similar to SqlCheck.exe?
Can this be accomplished using the Bootstrapper Manifest Generator, and is the BMG even supported by Visual Studio 2010? Appears to not be supported anymore, but I"m not sure if there's anything specific to VS 2010 / Windows Installer 4.5
http://archive.msdn.microsoft.com/bmg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用标准 Visual Studio 引导程序最多可以检查 AdminUser 属性值。预定义的 .NET Framework 4.0 Client Profile 先决条件使用类似的条件。您可以在此文件夹中找到其清单:
引导程序清单生成器也应该支持它。
但是,这是一件大事,在较新的 Windows 版本上,所有用户都可以通过提升来获得管理员权限。因此,从安装程序的角度来看,任何用户都被视为管理员,即使他不是。
所以这种方法在 Vista 或更高版本上几乎没有用处。
您可以尝试创建自己的自定义 EXE 引导程序来处理先决条件并检查用户权限。但您很可能会遇到同样的问题。
根据我的经验,最好的方法是让每个安装程序在必要时自我提升。他们中的大多数都有内置的机制,尤其是来自微软的机制。
如果您在使用这种方法时遇到问题,我很确定它们不是由特权引起的。很可能您的先决条件配置不正确(例如命令行不正确)。
The most you can do with the standard Visual Studio bootstrapper is to check the AdminUser property value. The predefined .NET Framework 4.0 Client Profile prerequisite uses a similar condition. You can find its manifest in this folder:
This should also be supported by the bootstrapper manifest generator.
But, and this is a big one, on newer Windows versions all users can get Administrator privileges through elevation. So from the installer point of view, any user is seen as an Administrator, even if he's not.
So this approach is pretty much useless on Vista or higher.
You could try creating your own custom EXE bootstrapper which handles prerequisites and checks user privileges. But you will most likely encounter the same problem.
From my experience, the best approach is to let each installer elevate itself if necessary. Most of them have built-in mechanisms for this, especially the ones from Microsoft.
If you encounter problems with this approach, I'm pretty sure they are not caused by privileges. Most likely your prerequisite is not configured correctly (for example an incorrect command line).