Pregunta

In InstallShield, it allows us to overwrite files with "Newer version then newer date" rule. Can anyone tell me it is possible to implement such a function in Advanced Installer? Thank you!

¿Fue útil?

Solución

New answer by me, especially to the "equal version" problem.

Two approaches possible:

First approach: Testing! Compare the install result with the source, at least before you ship the setup. Always a good recommendation. Then beating the developers who forgot to increase their version numbers and saying "MSI is requesting you have a clean version handling. If not, your file is not overwritten over an existing older version." Have done this. Has worked. (Not necessary in first version, but in updates.)

Second approach: Use always the property REINSTALLMODE with "e". This means always override existing file with file version (file level rule only). E.g. you put in your MSI hardcoded the property "REINSTALLMODE" with value "emus". This still allows you to override it, e.g. for repair, where it should be "vemus". More clean is to set this property only in the commandline but then you need a setup.exe or other bootstrapper.

This second approach is more comfortable, but now you have losed a very clean file version handling. If you have a shared file in two different setups (products) of your company, with version 1.0, which is really older, it will be overwrite the "newer" one which has also V1.0.

If you have no shared files, it works. But you are relying now really on the version managagement of the setup update process, so it is even more important, to assure, that the product 1.1 (not the file) can not be installed over a newer product version 1.2 or 2.0 for example.

Third approach (added later):

If you only produce Major Upgrades in MSI, e.g. no patches, and you rely on the "uninstall old version before install new version" strategy (e.g. the default in InstallShield), then "normally" you will never have a situation of overinstalling files, given some conditions (like having no shared files, again). Don't use merge moduls of MS if doing this, except you are an expert.

There are not really better alternatives.

Otros consejos

This option is not available in Advanced Installer, but you have the option to always overwrite the file existent on the machine, see Operations tab.

I begin with the potentially best answer here: Don't care about. MSI follows here very sufficient default rules, and if they do not fit in your case it is somewhat likely that you have to change your strategy; your requirement is not best practice, dangerous, has contradictions, etc...

To go more in detail:

1) If the file has a version, just don't care about the setup. Care about the development (build/CM) process. Best is to assure, that a file version is set higher each time the file is compiled. Strange enough (too) few companies achieve that simple goal...

2) The last change date of files included in Windows installer files is not significant in MSI, and this is very good decision! Dates are normally very bad discriminators. Most interesting example is when your hotfix for V1.0 is newer than the V2.0 - yes, sometimes it is necessary to support old version lines. :-) So, forget about the date. The thumb rule is: Unversioned files are normally overwritten (with few and disctinct exceptions which you don't need to know first of all).

3) You have to tell us more detailed, what is your problem (if there is one), or what you want to acchieve other than the default behaviour??! E.g. do you have problems overwriting with "same version" or with files edited by a user after setup?

--

4) Full detail info, only if interested: In MSI the file overwriting rule is global to all files, this is a bit frightening for "old" setup/script developers, but it works, you have to change your habitations a bit.

Advanced installer is only a GUI wrapper of MSI (Windows Installer), so first you have to understand MSI a bit.

Here is the whole story of MSI file overwriting on MSDN, called "File Versioning Rules" http://msdn.microsoft.com/en-us/library/windows/desktop/aa368599(v=vs.85).aspx

As always, MS does a very accurate job in MSI documentation. This is one of the best things in MSI.. (insider joke).

If you read all subsections of that link it seems quite complicated to most people I think. Once understood, it's simple like always.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top