java - 为什么我的应用程序放在 C :\Program Files on windows 10 but not on windows 7? 中时需要管理员权限

标签 java windows eclipse-rcp rcp windows-10-desktop

我的 Java RCP 应用程序 (App.exe) 最近从32 位转换为 64 位。由于它是一个 64 位应用程序,我使用 NSIS 创建一个安装程序,它将转储所有必需的文件以及 C:\Program Files 中的 App.exe。当App.exe运行时,当应用程序尝试在编辑模式下打开文件(在C:\Program Files中)以转储结果/日志时,我收到安全异常(访问被拒绝)。当我以管理员身份运行App.exe时,它工作正常。即使在非管理模式下运行,它也可以在 Windows 7 64 位计算机上正常工作。

知道如何在非管理员模式下运行App.exe吗?

Note : This is not the problem of NSIS as samething was working fine as a 32-bit application.

最佳答案

基本上,程序文件目录始终受到保护。

您应该检查 WIN 7 用户权限和用户的 UAC 设置。

同时....


您可能需要重新考虑在何处存储数据。

有一篇关于此的帖子 here

To put it straight, ProgramData contains application data that is not user specific.This data which will be available to all users on the computer. Any global data should be put in here.

AppData folder contains configuration settings, downloaded information/files for a particular user. So, for example any user specific preferences and profile configurations can be stored in the AppData folder. The AppData folder is further divided into three subfolders
Roaming - This folder contains data that can move with your user profile from a computer to another.
Local - This folder contains data that will not move with your user profile.
LocalLow - You can put in lowlevel access information such as information related to web browser running in a protected mode in this folder.

关于java - 为什么我的应用程序放在 C :\Program Files on windows 10 but not on windows 7? 中时需要管理员权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50758075/

相关文章:

.net - 如何安装同一个windows服务的多个实例

c++ - 如何在 C++ 中 "modify"系统 ("pause")

java - Eclipse RCP 4.x - 定义工作区位置

java - 使用 Dozer Java API 配置自定义转换器

C++ 将图像保存为 SVG

java - eclipse RCP : Custom console

jsp - Eclipse RCP 插件 + 嵌入式 Jetty + JSF

java - : org. glassfish.tyrus.spi.ClientContainer 引起的错误

java - 是否可以在构造函数中声明变量 [Java]

java - FileUtils.copyInputStreamToFile 未上传到我当前的 Java 目录?