InstallShield like never overwriting a file

I have one file in my file structure (FireBird database), which, as soon as it is installed for the first time, should never be overwritten again. This seems like a pretty simple task, but I spent too much time trying to find the answer.

If you right-click on a file and select Properties, select the Always Overwrite check box. I would just keep the version number the same, which, as I was told, would prevent overwriting the file, but this can be dangerous in my situation, and there is no place in the real properties of the file even for the version number.

I assumed that this would have a fairly straightforward solution, but of course I haven't found it yet.

Thanks in advance for any help guys. You are burning.

+4
source share
1 answer

Two approaches:

1) The โ€œeasiestโ€ way for InstallShield to never overwrite a file is to never install it in the first place. Install it as a.txt and ask the application to copy it to b.txt the first time it starts, and I will never know about b.txt in the first place.

2) Create a component in InstallShield and add your database as a key file. Presumably, the contents of the database will change over time and result in a creation date and a modification date that are different. In this case, InstallShield (Windows Installer) by default, file version control rules (OMUS) dictate that the file will not be overwritten.

3) If # 2 still does not work, set the Never Overwrite attribute for the component to Yes.

Remember that file pricing is based on KeyFile. No matter what the key file tells you, all other files in the component will do the same with respect to overwriting. "Always Overwrite" is the "version lying" where we incorrectly indicate to the MSI that the Verison file is 65535.0.0.0, and therefore the Create / Modification rule is replaced by the Versioned trumps Non-Versioned version rule.

+5
source

Source: https://habr.com/ru/post/1396295/


All Articles