Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InstallShield how to never overwrite a file

I have one file in my filestructure (a FireBird database) that, once it is installed the first time, should never be overwritten again. This seems like an easy enough task, but I've wasted an inordinate amount of time trying fruitlessly to find an answer.

If you right click on the file and select "Properties", there is only an "Always Overwrite" checkbox. I would simply keep the version number the same, which I'm told would prevent a file from being overwritten, but that could be dangerous in my situation, and in the actual file properties, tere is no place to even be able to put a version number.

I had assumed this would be have fairly straightforward solution, but I certainly haven't found one yet.

Thank you in advance for any help, guys. You rock.

like image 718
Cyprus106 Avatar asked Feb 13 '12 21:02

Cyprus106


People also ask

How do I stop a file from overwriting?

Select the Components tab and right-click on the component name. Select Details; the Component Details dialog appears. Mark the checkbox option to "Never overwrite if keypath exists." In addition, make sure that the file is the keypath of the Component in the File Key Path field. Click OK.

What is a key file in InstallShield?

A key file is a file that the Windows Installer uses to detect the component's presence on the target machine and determine whether it needs to be updated.

What does it mean to overwrite existing files?

Overwriting is the rewriting or replacing of files and other data in a computer system or database with new data. One common example of this is receiving an alert in Microsoft Word that a file with the same name already exists and being prompted to choose whether you want to restore the old file or save the new one.

What is InstallShield MSI?

InstallShield® is the world's leading Windows installation development solution. InstallShield is designed to enable development teams to be more agile, collaborative and flexible when building reliable InstallScript and Windows Installer MSI installations for desktop, server, Web, virtual and traditional applications.


1 Answers

Two approaches:

1) The "easiest" way for InstallShield to never overwrite a file is for it to never install it in the first place. Install it as a.txt and have your application copy it to b.txt on first run and I nstallShield will never even know about b.txt in the first place.

2) Create a component in InstallShield and add your database as the keyfile. Presumably the contents of the database will change over time and result in a creation date and modification date that are different. In this scenario, InstallShield's ( Windows Installer actually ) default file versioning rules ( OMUS ) dictate that the file will not be overwritten.

3) If #2 is still not working somehow then set the Never Overwrite attribute on the component to Yes.

Remember, file costing is based on the KeyFile. Whatever the keyfile evaulates to, all the other files in the component will do the same thing with regard to overwrite. "Always Overwrite" is "version lying" where we falsely tell MSI that the file Verison is 65535.0.0.0 and thus the Create / Modification rule is superseded by the Versioned trumps Non-Versioned files rule.

like image 144
Christopher Painter Avatar answered Sep 28 '22 13:09

Christopher Painter