OOTB way to check for admin permissions before running VS2010 Installer MSI?

蹲街弑〆低调 提交于 2020-01-05 07:26:24

问题


I'm creating an installer for a 3rd Party ActiveX DLL running in IE7-9 on XP-Win7. The MSI should perform the following:

  1. Check for admin permissions. Notify the user and exit if insufficient permissions.
  2. Check for previous version. If it exists unregister or overwrite it.
  3. Install the DLL with vsdrfCOM so that it is recognized in the IE add-on menu.

For (3), I set the vsdrfCOM but it didn't seem to work. I don't see an OOTB way to perform (1) or (2). Is that correct or is there an OOTB way?

Thanks.


回答1:


Check for admin permissions. Notify the user and exit if insufficient permissions.

This is not really supported because of the way Windows UAC works on newer Windows versions. Basically, any user can become an Administrator through elevation. Also, even Administrators don't have full privileges unless they elevate.

The solution is to decide on an installation type (per-user or per-machine) and let Windows Installer handle permissions and elevation.

Check for previous version. If it exists unregister or overwrite it.

This is done automatically when using major upgrades.

Install the DLL with vsdrfCOM so that it is recognized in the IE add-on menu.

I don't think this is enough. The installation process should register your files just like you would register them manually.

A rule of thumb is to first install your application manually (copy/paste, execute register command lines etc.). Only then you will be able to successfully configure an installer which does it automatically.



来源:https://stackoverflow.com/questions/8281669/ootb-way-to-check-for-admin-permissions-before-running-vs2010-installer-msi

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