torpark
26th October 2007 18:45 UTC
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.
kichik
26th October 2007 19:07 UTC
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.
torpark
26th October 2007 19:39 UTC
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.
Joel
27th October 2007 01:08 UTC
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.
Afrow UK
27th October 2007 11:35 UTC
Check the access control lists on the Program Files folder.
Properties>Security (make sure Use simple file sharing is unchecked in Folder Options).
Stu
torpark
29th October 2007 01:52 UTC
Problem Found!
CreateDirectory created the program files directory as read-only. How did that happen? How do we change that?
Afrow UK
29th October 2007 10:29 UTC
Why should you use CreateDirectory to create it? Surely it will already exist? Use SetFileAttributes.
Stu