Archive: Confuzed on IfFileExists command. (usage)


Confuzed on IfFileExists command. (usage)
  I am almost done creating a script, I am confuzed on the usage of the IfFileExists command. Here is what I want to do.

IFFILEEXISTS MM_*.mdb then I want the installer to skip the files MM_*.mdb.

IFFILEEXISTS WhatsNew.mdb I want to ALWAYS overwrite with a newer version.

Thanks

-Chris



Function "SomeThing"
ifFileExists $SYSDIR\myfile.dll 0 NoThere
... ;If is it there
NoThere:
...;Nop, is not here
FunctionEnd



Helps? :D

I created this:


Function "Check if data files exist"
ifFileExists MM_*.mdb 0 NoThere
... ;If is it there
NoThere:
...;Nop, is not here
FunctionEnd

Function "Check if data files exist"
ifFileExists WhatsNew.mdb 0 NoThere
... ;If is it there
NoThere:
...;Nop, is not here
FunctionEnd


after I see if the files exist or not I want the installer to keep going.

It was a little hard to understand your response.

You don't need IfFileExists to overwrite. NSIS defaults to always overwrite so unless you have used SetOverwrite to set the overwrite flag to something else you're set.


ok, so how would I format the command to not overwrite a specific set of files?

SO far I have:


Function "Check if data files exist"
ifFileExists MM_*.mdb NoThere
;If is it there
NoThere:
;Nop, is not here
FunctionEnd


Use SetOverwrite off, no need for IfFileExists.


I need overwrite to be off for all files except MM_*.mdb

ok, thats one problem fixed.. it will always overwrite. :)


An example:


SetOverwrite off

File bla
.txt
File blue.txt
SetOverwrite on
File MM_*.mdb
SetOverwrite off
File onemore.txt
File myprog.exe
File yougetthepoint.itk
>

Thanks, examples are awesome!