Archive: Don't Have Write Access?!


Don't Have Write Access?!
Some users, who are admin, logged into their box, can't write to C:\Program Files\SomeDirectory etc. What is going on? How can this be? There are no programs like Norton running preventing access, yet when a routine to write a file is run to check privs, the user doesn't appear to have the capability.

Is there anything else we can do or find out what is going on?

I tried first using RequestExecutionLevel to user, then none, and now admin. All with the same effect. This is driving me crazy that the installer, and this installer alone, somehow doesn't have permission that even the user has.

Please help.


RequestExecutionLevel is for Vista only. Does this happen on Vista? If so, it's UAC. You have to pass the UAC prompt in order to write anything to Program Files.

If it's not Vista, it's probably some left over privileges on the folder or its parent folder. NSIS doesn't modify any privileges unless told so. Try completely removing the folder and install again.


Happen to some users in both XP and Vista. Left over privileges from what? We just created the directory, and then can't write to it.


I can't reproduce the problem in XP.
I don't know, maybe I didn't read well the first topic, but seems that the directory is been scanning during the creation from a 3rd part app...just maybe.


Check the access control lists on the Program Files folder.
Properties>Security (make sure Use simple file sharing is unchecked in Folder Options).

Stu


Problem Found!

CreateDirectory created the program files directory as read-only. How did that happen? How do we change that?


Why should you use CreateDirectory to create it? Surely it will already exist? Use SetFileAttributes.

Stu