File version in MSI

V

Viviana Vc

Hi all,

I am familiar with the fileversioning rule of the MSI. My question is:
the version that counts here is the version written in the .rc file of
the file that will be then built (version you see when right-click file
-> Property -> Version tab), or is the version that is written in the
MSI tables and which can be different from the one from .rc file?

Thank you,
Viv
 
P

Phil Wilson

The File Version in the File table in the MSI file is supposed to be the
same as the actual version in the resources of the code file. I think it's
primarily an optimisation so that MSI can easily determine the file version
during updates, repairs etc.

Occasionally you hear about people putting a different version in the File
table to force an overwrite, that kind of thing. The problem with that is
that the actual file version therefore never matches the version in the MSI
file, so it's likely that you'll get repairs (and requests for the source
medium) to restore the file that always looks like the wrong version.
 
V

Viviana Vc

Hi Phil,
Occasionally you hear about people putting a different version in the File
table to force an overwrite, that kind of thing. The problem with that is
that the actual file version therefore never matches the version in the MSI
file, so it's likely that you'll get repairs (and requests for the source
medium) to restore the file that always looks like the wrong version.

So you are saying that Windows Installer checks the actual file version
(the version from the rc file) and compares it against whatever is in
MSI as file version and because these don't match it will try to do
repairs. Is this correct?

Well, Windows Installer has this fileversioning rule just because the
assumption is that all the files have to be backward comaptible and for
my product this is not the case. I have several exes that communicate to
each other and if only one gets updated for whatever reason and the
others don't my product might not work anymore, so I always need all the
files from a package to be installed regardless of what exists on the
user's machine. I don't think there is another way than just using the
"always overwrite" trick from IS which actually changes the file version
in the MSI tables.
file, so it's likely that you'll get repairs (and requests for the source
medium) to restore the file that always looks like the wrong version.

Why would request the source medium? Isn't everything cached somewhere
on the hard-drive for later repairs?

Thanks,
Viv
 
P

Phil Wilson

In line....

--
Phil Wilson
[Microsoft MVP-Windows Installer]
Viviana Vc said:
Hi Phil,


So you are saying that Windows Installer checks the actual file version
(the version from the rc file) and compares it against whatever is in
MSI as file version and because these don't match it will try to do
repairs. Is this correct?

[[ The actual version of the installed file does not match the value in the
File table, so in a repair situation MSI may always want to reinstall the
file. ]]
Well, Windows Installer has this fileversioning rule just because the
assumption is that all the files have to be backward comaptible and for
my product this is not the case. I have several exes that communicate to
each other and if only one gets updated for whatever reason and the
others don't my product might not work anymore, so I always need all the
files from a package to be installed regardless of what exists on the
user's machine. I don't think there is another way than just using the
"always overwrite" trick from IS which actually changes the file version
in the MSI tables.


Why would request the source medium? Isn't everything cached somewhere
on the hard-drive for later repairs?

[[ The cached MSI file does nor contain files - it's just the basic MSI file
without the cab files that are in the original MSI file. ]]
 
V

Viviana Vc

Hi Phil,

Is it correct when I say that _all_ the MSI files used by Windows
installer are cached in WindowsFolder\Installer under a random name?
[[ The cached MSI file does nor contain files - it's just the basic MSI file
without the cab files that are in the original MSI file. ]]

Does that mean that whenever you do a modify you will need the original
media to get the new files from there?

Thanks,
Viv
 
P

Phil Wilson

Yes to 1, you'll see msp files in the installer cache.

Yes to 2, if the modification is to add a feature that needs files.

--
Phil Wilson [MVP Windows Installer]
----
Viviana Vc said:
Hi Phil,

Is it correct when I say that _all_ the MSI files used by Windows
installer are cached in WindowsFolder\Installer under a random name?
[[ The cached MSI file does nor contain files - it's just the basic MSI
file
without the cab files that are in the original MSI file. ]]

Does that mean that whenever you do a modify you will need the original
media to get the new files from there?

Thanks,
Viv
 
V

Viviana Vc

Hi Phil,

Understood! Thanks a lot!

Actually after doing some tests and reading here and there I found out
the important bits of cacheing and I'll write here for further
references:

There are 2 kinds of caching: one done by default by Windows Installer
technology in WindowsFolder\Installer and here the basic MSI is cached
and one done by IS in [WindowsFolder]Downloaded Installations in case of
a compressed installer.

About these 2 types of cacheing:
- the MSI file is always cached into the WindoswFolder\Installer
directory under a random name
- there is cached _only_ the base MSI file, meaning no CAB files and if
the MSI file is compressed meaning containing all the files for the
application, it will be cached only the base MSI meaning not the
application files
- when the repair/modify/etc is run the basic cached MSI is used to
check if the installation is correct or need changes. As soon as this
task needs some files from the package the original package is searched
from where it was used for installing (in case of an uncompressed
installer) and from the search list.
- When creating a release with compression in IS you should do: Install
Designer -> Media -> Releases -> Cache Web Download put on YES. In this
way the MSI that is extracted from the setup.exe (having everything
inside, including the files from the app package) is cached in the
"Cache Path" and automatically Windows Installer puts it on the searched
list so it knows next time to take it from there. This option is not
available for uncompressed releases as for those the Windows Installer
adds the path from where the app was installed in the Search List as
there is already the msi file. In other words: when you install from a
package having a MSI you have in that directory all the info so no
specific cache is done (besides the base MSI which is cached in
WindowsFolder\Installer), and when you run a compressed installer, ie
setup.exe, in [WindowsFolder]Downloaded Installations the MSI containing
inside the application files is cached (besides the base MSI which is
cached in WindowsFolder\Installer).

So for instance:
- for a setup.exe installation you get into the WindowsFolder\Installer
folder a base MSI of let's say 700K and in [WindowsFolder]Downloaded
Installations a MSI file of 1800K as this one contains also the files
packed inside and in the Windows Installer Search List the
[WindowsFolder]Downloaded Installations\AdummyGUID is added
- for an uncompressed installation you get into the
WindowsFolder\Installer folder a base MSI of let's say 700K and in
[WindowsFolder]Downloaded Installations you don't get anything and in
the Windows Installer Search List the path from where the application
was installed is added

Thx,
Viv
 
G

Guest

Hi there

I've being looking at creating patches using msimsp.exe to create patches
that are installed with msiexe.
Regarding this I've been trying to work out who to prevent access to the
original install source. I can do this when applying a patch to the original
(e.g using MsiFileHash Table). But when uninstalling the patch or applying a
later patch which targets the original install (and therefore needs to
uninstall a previous patch), the install process requests the original
install source.
Now according to the windows installer documentation, when applying the
patch a base-line cache is created.
I have done everything according to the documentation (under section
Reducing patch size) for the base-line cache to be used (e.g. using windows
installer 3.0 or later ).

I later found the cache under
windows\installer\$patchcache$\managed\[a guid]\
It seems that only files which have a version number are cached and not
others.

Is there a way around this to cache non-versioned files, or does the cache
system rely on the files version?


Phil Wilson said:
Yes to 1, you'll see msp files in the installer cache.

Yes to 2, if the modification is to add a feature that needs files.

--
Phil Wilson [MVP Windows Installer]
----
Viviana Vc said:
Hi Phil,

Is it correct when I say that _all_ the MSI files used by Windows
installer are cached in WindowsFolder\Installer under a random name?
[[ The cached MSI file does nor contain files - it's just the basic MSI
file
without the cab files that are in the original MSI file. ]]

Does that mean that whenever you do a modify you will need the original
media to get the new files from there?

Thanks,
Viv
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top