为什么我的应用程序在Windows 10上放置在C:\Program Files但在Windows 7上放置时需要管理员权限? [英] Why does my application requires admin priviliges when placed in C:\Program Files on windows 10 but not on windows 7?

查看:747
本文介绍了为什么我的应用程序在Windows 10上放置在C:\Program Files但在Windows 7上放置时需要管理员权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My Java RCP application (App.exe) was recently converted from 32-bit to 64-bit. Since it is a 64-bit application i have used NSIS to create an installer which will dump all the required files along with App.exe in C:\Program Files. When the App.exe is run, i am getting a security exception(Access denied) when the application tries to open files (in C:\Program Files) in edit mode to dump the results/logs. When i run App.exe as administrator it works fine. It also works fine in windows 7 64-bit machine even when run in non-admin mode.

任何想法,如何在非管理模式下运行 App.exe

Any idea, as what to do to run App.exe in non-admin mode ?


注意:这不是 NSIS 的问题,因为32位应用程序的工作正常。

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


推荐答案

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

Basically, the programs files directory is always protected.

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

You should check the WIN 7 users privileges and the user's UAC settings.

同时.. ..

您可能想重新考虑存储数据的位置。

You might want to reconsider where to store your data.

有关于这里


为了说明问题, ProgramData 包含非用户特定的应用程序数据。此数据将可供计算机上的所有用户使用。任何全局数据都应该放在这里。

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 文件夹包含配置设置,特定用户的下载信息/文件。因此,例如,任何用户特定的首选项和配置文件配置都可以存储在AppData文件夹中。 AppData文件夹进一步分为三个子文件夹

漫游 - 此文件夹包含可以将您的用户个人资料从计算机移动到另一个文件夹的数据。

本地 - 此文件夹包含的数据不会随您的用户个人资料一起移动。

LocalLow - 您可以输入低级访问信息,例如与网络相关的信息浏览器在此文件夹中以受保护模式运行。

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.

这篇关于为什么我的应用程序在Windows 10上放置在C:\Program Files但在Windows 7上放置时需要管理员权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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