KoenT
Posts: 13
Joined: Mon May 18, 2009 8:30 pm

Version for files that don't have version info

Hi,

could someone please tell me if the following would work:

Some files in my installer project don't have version info.
One thing we could do is to say: "always overwrite".
However, this means that if later, someone installs an earlier version of the product (product allows side-by-side installation), these old components will overwrite the ones that were already installed by the later version.
The desired behavior in our case would be to only overwrite if the version is newer, but since no version info is available for these components, that doesn't work.
Another option is the use a companion file, but then if that companion parent file didn't change, but the component itself did, that won't work either.

So: what if we set the version info for these components to the following parameter:
[|ProductVersion]
and for each new release that ProductVersion parameter is incremented.
I believe we would then get the desired behavior, right?
--> For these version-less files, they would get their version from this parameter. So, if a newer version of the product installer is run, the existing files would be overwritten. And, if an older version of the installer is run, the files would also have that older version number and would not overwrite the newer ones already on the computer. Is this correct?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Version for files that don't have version info

Hi,

I'm afraid this this will not work because the version specified in the project is used only during the install process. The files installed on the machine will have the versions coded in them (in your case no version), so the files in the package will always have a higher version.

A solution is to use searches to detect the files and their versions. The properties of these searches can be used to condition the components of the files.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KoenT
Posts: 13
Joined: Mon May 18, 2009 8:30 pm

Re: Version for files that don't have version info

So, what you are saying is that once the file is installed, there is no way anymore to know what version number the versionless file had upon installation (even if that was specified using that ProuctVersion parameter)?
Hmmm... That makes things complicated, as there are many such files (bitmaps, skin files) in the project and doing this search trick for each component + keeping this up to date manually (I suppose I will need to update the date/time check each time) is not easy to maintain... Or am I mising something here?
Maybe we should just say: latest installed version overrules previously installed versions...
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Version for files that don't have version info

Hi,
So, what you are saying is that once the file is installed, there is no way anymore to know what version number the versionless file had upon installation (even if that was specified using that ProuctVersion parameter)?
Yes, from the files point of view the version used during install cannot be determined.

However, the Product Version can be written in the registry so the package could find out what versions are already installed. This could be used for the files in your package. Instead of using searches for files, you can use a search for the product version written in the registry. The property of this search can condition the component of the registry entry with the version. For example, if the search is named INSTALLED_VERSION, the condition can be:

Code: Select all

ProductVersion > INSTALLED_VERSION
With this approach the registry entry with the product version is installed only if the version it contains is higher than any installed version of the package. The same condition can be used for the files you don't want to overwrite.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KoenT
Posts: 13
Joined: Mon May 18, 2009 8:30 pm

Re: Version for files that don't have version info

Strange...
Then what is the point of being able to specify a specific version number for a file that has no version? If it is not being used anyway, why would someone then use it?

The problem with that registry key solution is that that is for the package as a whole...
The best solution for us would probably be way to gloablly switch on a setting for a bunch of files/folders that says "overwrite only if newer based on file date/time"...
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Version for files that don't have version info

Hi,
Then what is the point of being able to specify a specific version number for a file that has no version?
The version will be used during the install process to determine if the file in the package should overwrite the existing file on the machine. Windows Installer cannot modify the actual version of a file.
The best solution for us would probably be way to gloablly switch on a setting for a bunch of files/folders that says "overwrite only if newer based on file date/time"...
When a file in the package already exists on the target machine and Windows Installer needs to overwrite it, the file versioning rules are used. Perhaps you can use them to your advantage.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”