Archive: Priviledges on a directory?


Priviledges on a directory?
I have made an installer for a program and everything works fine... if you have admin priviledges.

There must be a possibility to install with 'guest rights'.
So, is it possible to check of the user can write in c:/Program Files/ ?

I have searched and only found The AccessControl of Mathias Hasselmann, but it is not usefull.

I want to check of the directory is writetable with the user who wants to install. If it is not writable i would disable the install button.


Would creating a text file in it work?

E.g.
ClearErrors
FileOpen $R0 "$PROGRAMFILES\temp.tmp" w
FileClose $R0
IfErrors 0 +2
MessageBox MB_OK "Write error!"

-Stu


call kernel32::CreateFile with the system plugin on the FOLDER with the FILE_ADD_SUBDIRECTORY and GENERIC_WRITE for desiredAccess and FILE_FLAG_BACKUP_SEMANTICS for flagsandattr (nt only)