简体   繁体   English

NSIS RMDir 无法删除用户在 ProgramData 中创建的文件

[英]NSIS RMDir failing to delete user created files in ProgramData

We have a Windows application with a component that writes to the ProgramData folder.我们有一个带有写入 ProgramData 文件夹的组件的 Windows 应用程序。 When the uninstaller is run, the files that are generated by this component are not removed.运行卸载程序时,不会删除此组件生成的文件。 Using UAC::RunElevated, we first install a third party component into ProgramData使用 UAC::RunElevated,我们首先将第三方组件安装到 ProgramData 中

SetOutPath "$RENDERER_INSTALL_DIR"

LogSet On
File /r "${MAGNIFY_DIR}/secRenderer/Arelle/*"
LogSet Off

AccessControl::GrantOnFile "$RENDERER_INSTALL_DIR" "(S-1-5-32-545)" "FullAccess"

During operation, this component writes to its own install directory in ProgramData在运行期间,该组件会写入自己在 ProgramData 中的安装目录

During uninstallation, we attempt to delete the folder created above, again using UAC::RunElevated在卸载过程中,我们尝试删除上面创建的文件夹,再次使用 UAC::RunElevated

RMDir /r $RENDERER_INSTALL_DIR

However, the files created by operating the component are not removed.但是,不会删除通过操作组件创建的文件。

We have observed that these files are owned by the user who used the component, rather than the Administrator, who nonetheless has full read, write and delete permissions.我们观察到这些文件归使用该组件的用户所有,而不是由管理员拥有,管理员拥有完整的读、写和删除权限。

How do we make this work?我们如何进行这项工作?

There are two many unknowns here to really answer the question.这里有两个未知数可以真正回答这个问题。

Why is the UAC plug-in involved?为什么会涉及到UAC插件? It is only useful to lower your system access!只有降低您的系统访问权限才有用! It is also tricky to use correctly so I would recommend that you try without it.正确使用也很棘手,因此我建议您尝试不使用它。

Does this 3rd-party component change the ACL?这个第 3 方组件是否会更改 ACL? Check the ACL before uninstalling.卸载前检查ACL。

Is it possible that file system virtualization is tricking you?文件系统虚拟化有没有可能欺骗你? Check the VirtualStore folder.检查 VirtualStore 文件夹。

What does Process Monitor say? 进程监视器说什么? Are you getting ACCESS_DENIED or some other error?您是否收到 ACCESS_DENIED 或其他错误?

Giving all users full access to folders under ProgramData is not recommended and any component that requires this does not follow the Windows Logo guidelines.不建议向所有用户授予对 ProgramData 下文件夹的完全访问权限,并且任何需要此权限的组件都不遵循 Windows 徽标指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM