2

I have to set ACL of "C:\" folder (only this folder, not its subfolders!) to accept read/write from all users. Is it possibile by Inno setup script?

Tobia
  • 9,165
  • 28
  • 114
  • 219
  • 1
    To be more specific, by all users you mean the `Everyone` group ? And, are you creating that folder by your script (if so, there is the [`Permissions`](http://www.jrsoftware.org/ishelp/index.php?topic=dirssection&anchor=Permissions) parameter for that) ? – TLama Aug 20 '13 at 08:57
  • Yes, Everyone should be ok. Obviously "C:\" is not created by my app... :-) I could not use [Dir] Permissions because seems to be recurive to all subfolders (I don't want this). – Tobia Aug 20 '13 at 09:00
  • 1
    Ok, I asked because I thought it is `c:\folder` in your question :-) And I forgot it's recursive. – TLama Aug 20 '13 at 09:04
  • 1
    xD sorry... I mean "C:\" folder. – Tobia Aug 20 '13 at 09:13
  • Unless this is for an in-house (bespoke) app only, please do not even think about doing this sort of thing. It's a security nightmare waiting for a PC to happen on. – Miral Aug 20 '13 at 20:52
  • This is a POS software that uses a third-part library that uses tmpnam() C++ function (http://www.cplusplus.com/reference/cstdio/tmpnam/). This library make a temp file in c:\ (instead of %temp% path) and this is because i need to free C:\ for all user. I can not change that library. – Tobia Aug 21 '13 at 07:38

1 Answers1

3

you can use icacls.exe from inno setup to set permissions

try to execute the following with the Exec or shellexec functions in the inno-setup

icacls "C:\" /grant Users:F

this might helpful, please check icacls Information

Gangadhar
  • 10,248
  • 3
  • 31
  • 50
  • 1
    This looks like the most painless solution. I would suggest to use Windows API because you could get the result of that operation, but the first problem is that I don't know how (if there would be a C++ example, then maybe), and the second problem is that I don't know if all the Windows API functions needed for such operation are translateable in a hack-free way into InnoSetup. [+1] – TLama Aug 20 '13 at 12:14
  • 2
    Is this good also for XP? I agree with TLama... but i can not find any other solution – Tobia Aug 20 '13 at 17:05