PDA

View Full Version : File Overwrite in Folder Reference


tigran
09-12-2007, 02:23 PM
Guys,

I'm trying to figure out the solution for the following problem:

1. I installed an application by using SetupFactory 7. SetupFactory allowed me to specify th overwrite flag for folder references: always overwrite, never overwrite, overwrite based on time stamp, etc.

2. Now, I'm building a patch for the application with VisualPatch 3. I added the folder references, but they don't let you specify the overwrite flag.

Some files in my application should never be overwritten once installed (achieved by setting 'Never overwrite existing file' in SetupFactory). VisualPatch however, will analyze the files in all versions of the patch and WILL replace them, which is exactly what I don't need. Similar situation with the 'Overwrite if existing file is same or older' flag.

Can you point me to a solution to this problem? Thanks

Lorne
09-13-2007, 01:54 PM
What kind of files are they?
What is the reason that you don't want to patch those files?

If the files are user-editable (e.g. INI file) and you don't want to overwrite them if the user has edited them, VP3 will already take care of that -- it only patches a file if it (the target file) matches the signature of the equivalent file in the old version (the old file).

If the files are not user-editable, but you don't want to replace any previously installed versions of those files, that's a bit trickier :) but I can think of two ways that should work:

1. Assign a condition to those files that will resolve to false at run time.

For example, you could set the Script Condition on the Conditions tab to "false" for that folder reference, which should prevent all its the files from being patched.

Note that you can apply different settings to individual files within a folder reference by adding the files to the list in addition to the folder reference -- the individual file settings override the folder reference settings.

2. Just omit the files that you don't want patched -- but only if the "Delete legacy files" option is turned off in the project settings.

jlsf2
09-27-2007, 09:35 AM
Regarding "Script Condition".

When does the evaluation take place?

e.g. Can I have the patch read the Registry and set a boolean based on what it finds and have that boolean in the Script Condition field?

Thanks.

Lorne
09-27-2007, 10:46 AM
The script condition is checked at run time, before the individual patches are applied. So yes, you should be able to do that.