|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Nov 2009
Posts: 1
|
Win Vista/7: No writing in directories with spaces in the name
Hello!
I'm using the following piece of code to build my setup with NSIS. I built it on Windows XP and it works fine with Windows XP and 2000. But on Windows 7 and Vista, NSIS isn't able to write files to "C:\Program files\software name". But if I use a target directory wich doesn't include spaces, for example "C:\softwarename", it works. Do you have any idea, why or what I shall do for get it working? code: Raphael |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
RequestExecutionLevel user << needs to be admin
...you also need to make sure the user is admin by calling the userinfo plugin at some point (in .oninit for example) IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2009
Posts: 3
|
Since I (and others) am having the same problems, I try to better understand:
1) with RequestExecution level set to user, no way of installing files to program files under vista/7. In my case, I have written a Photoshop script that should be put under "Program Files (x86)\Photoshop\...." folder. Correct? 2) if installing files to program files subfolders is needed (my case), then the NSIS script must have on top code: Why should I also check the user privilege in onInit function? Also to be able to freely write to and read from all the nested subfolders when the program is launched by a normal user, I should install the AccessControl plugin in NSIS and add to the script a code: Correct? Other things am I missing? Thanks a lot! Ciceti |
|
|
|
|
|
#4 | ||
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Quote:
Quote:
Instead, you should program your application to write to LocalAppData or something like that. |
||
|
|
|
|
|
#5 | ||
|
Junior Member
Join Date: Nov 2009
Posts: 3
|
Thanks, a couple of clarifications.
Quote:
Quote:
Thanks!! |
||
|
|
|
|
|
#6 | ||
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Quote:
In .onInit, you could do something like this: code: Quote:
code: But as you can see, if you give them that much, it makes little difference to just give it all. If they can write, they can destroy, so you might as well make it easy on them. |
||
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Nov 2009
Posts: 3
|
Thanks a lot.
For restriction of grants, I will try with "GenericRead + GenericWrite" that should enable writing/reading config files while preventing executing dangerous files. Do you agree? Cheers |
|
|
|
|
|
#8 | |
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Quote:
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|