Archive: Setoverwrite and functions


Setoverwrite and functions
I'm having a problem with SetOverwrite and I don't see anything else relating to this.

My install sets several configuration files into a current directory and a defaults directory. When I write into the current directory, I don't want to overwrite existing files (in the case of an upgrade). I always want to overwrite the default directory.

So I do something like:

SetOutPath "${CONFIG_DEST_FOLDER}\Current\
SetOverwrite off
Call WriteConfigFiles

and then

SetOutPath "${CONFIG_DEST_FOLDER}\Default\
SetOverwrite on
Call WriteConfigFiles

But when I do this, it always writes the config files. If I move the SetOverwrite off into the WriteConfigFiles routine, it won't overwrite existing files, but of course I want it to in the second case.

WriteConfigFiles looks like:

Function WriteConfigFiles
File ${CONFIG_SRC_FOLDER}\HMI1.config
File ${CONFIG_SRC_FOLDER}\HMI2.config
File ${CONFIG_SRC_FOLDER}\HMI3.config
File ${LIB_COMMON_FOLDER}\MachineConfiguration\Machine.xslt
File ${LIB_COMMON_FOLDER}\MachineConfiguration\Machine.xsd
File ${CONFIG_SRC_FOLDER}\Unit1.config
File ${CONFIG_SRC_FOLDER}\Unit2.config
File ${CONFIG_SRC_FOLDER}\Unit3.config
FunctionEnd

To me this looks like a bug. What do you all think? I really don't want to have two routines to write the same set of files...


You should submit a bug report if it is a bug. For now though how about using a macro instead of a function. After all using a function will break the progress bar indication for those files.

Stu


Thanks! I'll submit a bug and try the macro