I made little test in order to understand how windows installer engine decides whether to replace a file.
I took two versions of sample.dll (the size differs).
Very important note in order to understanding the reading:
There are two fields for version in dll (right click the dll and choose properties, select the Version tab).
There is File Version field that you can see in top and real file version that is displayed below under "Other version information".
(Not always it is displayed).
In order to distinguish the fields I will call the last "Real File Version"
Here are the steps I made:
First Scenario:
1. Opened both dlls in Visual studio as a resource and changed the File Version fields to be the same. (2,0,0,0)
2. I created one install that contains 61 kb dll and installed it and created other install with the 65 kb dll and installed it.
Result was OK: the files had not been replaced.
Second Scenario:
1. I changed the Real File Version field of the installed dll (61 kb) to be 1,0,0,0. The other File version field remained 2,0,0,0.
2. I created other install with the 65 kb dll (version 2,0,0,0) and installed it.
Result: File had not been replaced, remained 61 kb with file version 2,0,0,0 and real file version 1,0,0,0.
The assumption is that msiexec engine compares the version from the file table in the msi with other file version (not the real file version).
Third Scenario:
This is in order to prove that msiexec compares the File version in the msi with the file version in destination (not the real file version).
1. I changed the File Version field of the installed dll (61 kb) to be 1,0,0,0. The other File version field was changed to 2,0,0,0.
2. I created other install with the 65 kb dll (version 2,0,0,0) and installed it.
Result: File had been replaced 65 kb with file version 2,0,0,0 and real file version 2,0,0,0.
Those scenarios prove that windows engine refers the displayed file version and not the real file version, I see this as a problem. It should takes the real file version which is numeric and not string.
What do you think?
Attached is jpg of the file properties in order to clarify the two fields.
Any help would be appreciated.
Thanks,
Limor
Edited by limors, 03 March 2004 - 11:46.