windows 在没有管理员权限的情况下运行 EXE 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21867755/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:23:36  来源:igfitidea点击:

Running EXE file without administrator privileges

windowscmdexeinstallshielduac

提问by user3002092

I have created a Word Add-In setup.exe file with installshield and I'm trying to find out how to install it without needing administrative privileges. Furthermore, I need the installation to be silent(No UI). I was able to get that to work by extracting the msi file from the executable and run it using

我已经创建了一个带有 installshield 的 Word Add-In setup.exe 文件,我正在尝试找出如何在不需要管理权限的情况下安装它。此外,我需要静默安装(无 UI)。我能够通过从可执行文件中提取 msi 文件并使用它运行它来使其工作

msiexec /i setup.exe /passive

This works perfectly on my machine, but it won't work for any other user in the client's system. The client uses a different system, so when I try the same command, I see that the files are added to my program files, but it isn't in my list of installed programs and the registry keys aren't set. I am not able to make any changes to their system, so I'm trying to find a way to bypass this whether it be third party programs or a little cheat I can use in the command prompt.

这在我的机器上完美运行,但不适用于客户端系统中的任何其他用户。客户端使用不同的系统,因此当我尝试相同的命令时,我看到这些文件已添加到我的程序文件中,但它不在我的已安装程序列表中,并且未设置注册表项。我无法对他们的系统进行任何更改,因此无论是第三方程序还是我可以在命令提示符中使用的一些小技巧,我都试图找到一种方法来绕过此问题。

I have attempted the following:

我尝试了以下方法:

  • Turning off UAC prior to running the command above.
  • I have removed the node from the manifest file.
  • numerous commands in the command prompt.
  • 在运行上述命令之前关闭 UAC。
  • 我已从清单文件中删除了该节点。
  • 命令提示符中的许多命令。

Does anybody else have any other suggestions or an idea of how I can fix this?

有没有其他人有任何其他建议或我如何解决这个问题的想法?

Thanks!

谢谢!

回答by Adil Hindistan

Admin access is needed if your app is installing into an area of the system where regular user does not have rights. If you want to be able to install it without having admin rights, it should install under their own user folder (think about %appdata%). Google Chrome is an example of that.

如果您的应用程序安装到普通用户没有权限的系统区域,则需要管理员访问权限。如果你想在没有管理员权限的情况下安装它,它应该安装在他们自己的用户文件夹下(想想 %appdata%)。谷歌浏览器就是一个例子。