Hi,
We are having a problem moving files from previous versions of an application.
OBJECTIVES
We want to move a database file from an old location (in program files directory) to a new location (in common application data). We are using a "File Copy/Move" operation to do it. The source directory location is a property based folder and its path is got by a a search (property name: ORIGINAL_DATABASE_PATH).
PROBLEM
We already have previous installations that use the "File Copy/Move" operation to move the files. So in these moment we have some customers with their database located in "Program Files" directory and others with their database located in "Common Application Data" directory. This means that the property ORIGINAL DATABASE_PATH may be equals to the target database location or not.
If we set the "File Copy/Move" operation as a Move operation then the database file is deleted when ORIGINAL DATABASE_PATH equals the target database path. All data is lost in this case.
If we set the "File Copy/Move" operation as a Copy operation then the database file isn't deleted from its original location when ORIGINAL DATABASE_PATH is different to the target database path.
We've seen we may use "Custom Actions">"Standard Actions">"MoveFiles">"Execution Condition" to set a condition to avoid the file move operation when (ORIGINAL_DATABASE_PATH <> MyApplicationDataDirectory_DIR) but this would stop any file movement so in the future we could do other "File Copy/Move" operation with other condition. Isn't it?
It seams a bug of Advanced installer. Any file move operation with the same source and target file path will end up with the file removal. That converts the move operation in a remove operation (very dangerous).
May you help us to solve this issue?
Thanks in advance.
Andrés Berenguer
INDESER
FOLLOW US
Get the latest news in Application Packaging