Hi everybody,
I completed my scripts and I managed to compile them with py2exe.
This script will edit some images and will save the output in a specific subfolder of the program (if the user will install it in the default location it will be something like
c:\program files\MyProgram\output

The problem is that, for instance, guest users will not have writing access to the output folder since it is in the program files folder.
Is there a way to give to all the users of a computer the right to read and write my program folder (and its subfolder and files)?
I cannot ask them to install it in a folder where they have full access, so I have to find a way to give them the necessary rights.
I saw that SetACL does something like this probably, but I don't know how to list all the users of a computer with Python, for instance.

Maybe you could setup user directories by os.path.expanduser.

Thanks pyTony,
in the meantime I found the solution I was searching.
I just created a batch file for SetACL.exe (LGPL license) to give permissions to all users.
I copy it here in case someone else will need it too

set _=%CD%
SetACL.exe -on "%_%" -ot file -actn ace -ace "n:S-1-1-0;p:read,write;s:y"

and put it together with SetACL in the installation folder and run it.

It allows to all users (S-1-1-0 from the Well-known SIDs
of microsoft http://support.microsoft.com/kb/243330/en-us) to read and
write (p:read,write) the folder where the file is (set _=%CD%).
Specific user/s or group/s can be selected too.
It can be extended to be recursive for files and/or folders in the same location.

Thanks again for your help.
Cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.