为什么在卸载过程中不能使用ShellExecAsOriginalUser? [英] Why can't I use ShellExecAsOriginalUser during uninstall?

查看:133
本文介绍了为什么在卸载过程中不能使用ShellExecAsOriginalUser?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Inno Setup安装程序,需要重新启动浏览器(以安装Shell扩展程序).在安装过程中,我可以使用 ShellExecAsOriginalUser 启动explorer.exe,以便它不是以管理员权限开始的;这在Windows 8上非常重要,因为以管理员身份运行资源管理器会阻止Metro应用程序运行.

I have an Inno Setup installer that needs to restart the explorer (in order to install a shell extension). During installation, I can start explorer.exe with ShellExecAsOriginalUser so that it doesn't start with admin privileges; this is important on Windows 8, because running explorer with admin privileges prevents Metro apps from running.

麻烦的是,如文档中所述,无法在卸载过程中调用此函数(我仍然尝试这样做,但当然会失败).我不明白为什么这不可能.有什么线索吗?有解决方法吗?

The trouble is that this function can't be called during uninstall, as stated in the documentation (I tried to do it anyway, but of course it fails). I don't understand why it's not possible. Any clue? Is there a workaround?

推荐答案

在卸载过程中无法调用它,因为程序和功能"控制面板始终以提升的权限启动卸载程序(无论如何,运行单机卸载程序时);因此,原始用户"仍然是管理员用户.

It cannot be called during uninstall because the Programs and Features control panel always starts the uninstaller with elevated permissions (when running a per-machine uninstaller, anyway); the "original user" is therefore still the admin user.

在这种情况下,可能正确的做法是仅使用Inno的最新版本-其中包括

In this situation, probably the correct thing to do is to just use the latest version of Inno -- this includes Restart Manager functionality which should automatically sort Explorer out without you having to do anything.

这篇关于为什么在卸载过程中不能使用ShellExecAsOriginalUser?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆