Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify selected directory access permission in Inno Setup

In my project, I have an TInputDirWizardPage where user can select a directory for a database backup. So it can be any drive. I need to add NETWORK SERVICE account to the user list of this directory and modify it.

enter image description here

Is it possible to set this in [Dir] section? If not how can I implement this?

like image 639
sina Avatar asked Dec 15 '25 07:12

sina


1 Answers

Yes, the [Dirs] section can set permissions for the "networkservice". Use Permissions flag with networkservice-prefixed value:

[Dirs]
Name: {code:GetDir}; Permissions: networkservice-readexec
[Code]
var 
  InputDirPage: TInputDirWizardPage;

function GetDir(Param: string): string;
begin
  Result := InputDirPage.Values[0];
end;
like image 106
Martin Prikryl Avatar answered Dec 16 '25 22:12

Martin Prikryl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!