Archive: problem with SetOverwrite


problem with SetOverwrite
Hello,

i need to set the overwrite-flag at runtime. I have readed in the docu (4.4 Realtive Jumps), that this is not possible, because it is a compiler-flag.

I tryed a code alike this:

SetOverwrite On

ReadINIStr $R0 $7 "Field 3" State
StrCmp $R0 "1" Overwrite_Texte

SetOverwrite Off
Overwrite_Texte:


What can i do ?


Thank you very much for your help !


You can do something such as this:

StrCmp $R0 1 overwrite
SetOverwrite off
File ...
Goto end

overwrite:
SetOverwrite on
File ...

end:


Hello kichik,

your tip works !

Why don't grow the size of the installer ?


Thank you very much for your fast help !!!


Because NSIS has a datablock optimizer. It will not add the same file twice. It does however make the section's required size grow (the one you see on the components page and the directory page). If you want to avoid that, simply put one of the File commands in a function and call that function.