在Inno Setup中修改选定的目录访问权限

问题描述

在我的项目中,我有一个TInputDirWizardPage,用户可以在其中选择用于数据库备份的目录。因此它可以是任何驱动器。我需要将NETWORK SERVICE帐户添加到此目录的用户列表中并进行修改。

enter image description here

是否可以在[Dir]部分中进行设置?如果没有,我该如何实施?

解决方法

是的,[Dirs] section可以设置“网络服务”的权限:

[Dirs]
Name: {code:GetDir}; Permissions: networkservice-readexec

[Code]
var 
  InputDirPage: TInputDirWizardPage;

function GetDir(Param: string): string;
begin
  Result := InputDirPage.Values[0];
end;

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...