Archive: Need help urgently - "error opening file for writing"


Need help urgently - "error opening file for writing"
Hello All,

My first post here, and I am in a bind.

When installing files to an empty directory which already exists, NSIS throws the error ""error opening file for writing" for every single file.

I have tried:

SetOverwrite on

Also, I tried:

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

These don't fix the problem. Is there any solution to this issue?

-Alex


What's the complete error message? Sounds like you forgot to use SetOutPath.


* Code looks like this:

SetOverwrite on
SetOutPath $UPGRADE_PATH

DetailPrint "Skipping Info.mdb for upgrade."
File /r /x "Info.mdb" "..\Files\*.*"

* Complete error message is:

"Error opening file for writing:"

\Data\Guide.mdb

Click Abort to stop the installation,
Retry to try again, or
Ignore to skip this file.


If that's the error, $UPGRADE_PATH is empty. The error always displays the full path of the file it's trying to write.


I think I found my bug - $UPGRADE_PATH was empty, so there was nowhere to output the files to. Thanks for your assistance, it led me to find the answer I needed.