Old 20th May 2009, 03:32   #1
BioK
Junior Member
 
Join Date: May 2009
Posts: 2
Post Error opening file for writing - Windows Vista

Hi everybody, I have a problem with my installer when I run it in Windows Vista. It install files in C:\Program Files. It work well in Xp but in vista it give me this error

Error opening file for writing:
C:\Program Files\....

I've read somewhere that is because, don't have the proper folder permissions to write to the program files folder. If I right click in the installer and choose "run as administrator" it works, but is there another way to do that right in the script? Because it is not very intuitive that the user run the installer as administrator....

Waiting for answers ...
BioK is offline   Reply With Quote
Old 20th May 2009, 04:07   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Use RequestExecutionLevel admin
Comperio is offline   Reply With Quote
Old 20th May 2009, 04:57   #3
BioK
Junior Member
 
Join Date: May 2009
Posts: 2
That is exactly what I was looking for, I've tried and it work perfectly. Thanks!
BioK is offline   Reply With Quote
Old 20th May 2009, 16:05   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
it does not work in xp either, you are just testing as admin. You need to use the userinfo plugin in .onInit or .onGuiInit to check if the user is admin or not

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump