为什么我可以使用UAC写入Program Files的特定目录?

时间:2021-03-27 20:49:05

This is a strange one to me. Let me list the setup:

这对我来说很奇怪。让我列出一下设置:

  • Application with a manifest (ie: wont get pushed to virtual store)
  • 带清单的应用程序(即:不会被推送到虚拟商店)

  • UAC is turned on (can't write to other program files directories, or other areas, and uac prompt appears)
  • UAC已打开(无法写入其他程序文件目录或其他区域,并出现uac提示)

  • Can write to "c:\program files\%app_name%\%directory%\" both from within my application (not run as admin) as well as a non admin command prompt
  • 可以从我的应用程序(不以管理员身份运行)以及非管理员命令提示符写入“c:\ program files \%app_name%\%directory%\”

  • Can not write to "c:\program files\%app_name%\%directory%\%subdirectory%\".
  • 无法写入“c:\ program files \%app_name%\%directory%\%subirectory%\”。

Any ideas? Are there hidden permissions or registry settings somewhere? Could it be that this directory was created when UAC was off, so now its fair game? Could it be that this directory was created in a time of XP, and its fair game?

有任何想法吗?某处有隐藏权限或注册表设置吗?难道这个目录是在UAC关闭时创建的,所以现在它的公平游戏呢?可能是这个目录是在XP时代创建的,它的公平游戏?

It makes sense to me why i can't write to the other program files directories and the subdirectory. However I have no idea why i am actually allowed to write to the %directory%?

我有理由为什么我不能写入其他程序文件目录和子目录。但是我不知道为什么我实际上被允许写入%目录%?

Side note: If I move the %directory% to another area (appdata), I still can not write to the subdirectory (confused).

旁注:如果我将%directory%移动到另一个区域(appdata),我仍然无法写入子目录(confused)。

Let me know any ideas you may have or anything I can check.

让我知道您可能有的任何想法或我可以检查的任何想法。

Thanks

1 个解决方案

#1


EDIT: Arr, sorry, I skimmed your post a little too fast, looks like this is a non-issue!

编辑:Arr,对不起,我的帖子有点太快了,看起来这不是问题!

Have you looked where the written files are actually going?

你看过写文件的实际位置了吗?

Vista has a feature where files written into Program Files folders by applications get redirected to a local per user store. This store is located at %userprofile%\AppData\Local\VirtualStore

Vista具有一项功能,即应用程序写入Program Files文件夹的文件将重定向到本地每用户存储。此商店位于%userprofile%\ AppData \ Local \ VirtualStore

This is to allow legacy applications which wrote per user settings to Program Files to still operate correctly, also allowing multiple users to use the program without conflict.

这是为了允许将每个用户设置写入Program Files的遗留应用程序仍能正常运行,同时允许多个用户使用该程序而不会发生冲突。

There's a button in explorer called 'Compatibility Files' which will take you to this user store.. perhaps your writes are ending up there?

在资源管理器中有一个名为“兼容性文件”的按钮,它会带你到这个用户商店......也许你的写作结束了吗?

I'm not sure why you cant write to the subdirectory though. Security permissions?

我不知道你为什么不能写到子目录。安全权限?

#1


EDIT: Arr, sorry, I skimmed your post a little too fast, looks like this is a non-issue!

编辑:Arr,对不起,我的帖子有点太快了,看起来这不是问题!

Have you looked where the written files are actually going?

你看过写文件的实际位置了吗?

Vista has a feature where files written into Program Files folders by applications get redirected to a local per user store. This store is located at %userprofile%\AppData\Local\VirtualStore

Vista具有一项功能,即应用程序写入Program Files文件夹的文件将重定向到本地每用户存储。此商店位于%userprofile%\ AppData \ Local \ VirtualStore

This is to allow legacy applications which wrote per user settings to Program Files to still operate correctly, also allowing multiple users to use the program without conflict.

这是为了允许将每个用户设置写入Program Files的遗留应用程序仍能正常运行,同时允许多个用户使用该程序而不会发生冲突。

There's a button in explorer called 'Compatibility Files' which will take you to this user store.. perhaps your writes are ending up there?

在资源管理器中有一个名为“兼容性文件”的按钮,它会带你到这个用户商店......也许你的写作结束了吗?

I'm not sure why you cant write to the subdirectory though. Security permissions?

我不知道你为什么不能写到子目录。安全权限?