Archive: Error opening file for writing even when OverWrite is ON


Error opening file for writing even when OverWrite is ON
  Hello,

My "Executables" section has the following statement:

Section"Executables" SEC01

SetOutPath "$INSTDIR"
LogSet On
>
Then I do a conditional inclusion on Win2K by using the following code:


 GetVersion::WindowsName

Pop $R0
StrCmp $R0"Windows XP" +4
StrCmp $R0"Windows Server 2003" +3
File "..\lib\gdiplus.dll"
File "..\lib\shfolder.dll"
Strangely, I always get the error from NSIS:

Error opening file for writing. Click abort to stop the installation

This only happens if the file is already existing in the installation folder. If I delete the file and start the installation it goes on OK.

What am I missing?

-- Ritesh

Is this a permission issue special to Win2K?

I just checked and the file which goes for the installer is NOT READ ONLY.

What might be the issue?


Files inherit the permissions from the folder that they reside in.
In which case try:

AccessControl::GrantOnFile "$INSTDIR" "Everyone" "FullAccess"

Please note that this plugin throws errors in MessageBox's for some stupid reason (rather than using the NSIS stack).
The plugin is available for download on the Wiki.

I'll have to make modifications to the plugin sometime so it doesn't use MessageBox's for errors.

-Stu