SetOverwrite scope
Hi,
I just started doing NSIS installer, and there is one thing that I cannot understand...
I have a custom window where I can select if I should do a new installation (SetOverwrite on) or an update (SetOverwrite off) for some files. This is working great.
But SetOverwrite on/off doesn't seems to be working always.
This doesnt work even if MessageBoxes confirm that the correct SetOverwrite was done:
Section "!Section 1"
SetOutPath $INSTDIR
SetOverwrite on
; Recreate everything BUT web.config
File /a /r /x "web.config" "${SRCDIR}\*.*"
SectionEnd
Section "Section 2"
SetOutPath $INSTDIR
${If} $SETUP_MODE == "1"
SetOverwrite off ; Don't overwrite present files
${ElseIf} $SETUP_MODE == "0"
SetOverwrite on
${EndIf}
; This overwrite my file, even if I just wrote into it (INSTDIR)!
File "${SRCDIR}\web.config"
SectionEnd
It works if I do one of the folowing:
${If} $SETUP_MODE == "1"
SetOverwrite off ; Don't overwrite present files
File "${SRCDIR}\web.config"
${ElseIf} $SETUP_MODE == "0"
SetOverwrite on
File "${SRCDIR}\web.config"
${EndIf}
Or it works (as it should) if I do this:
SetOverwrite off
File "${SRCDIR}\web.config"
--
So, What is the scope of SetOverwrite ???