cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
the_boz
Level 4

Overwrite files/registry on update

In IS6 there was an option whether files in a file group (now known as component) should be overwritten. The right choice for me then would be "Same or Newer Version then Newer Date" which means for an existing file with version 2.0 and date 11/02/01:
New file version 3.0: always overwrite
New file version 1.0: never overwrite
New file version 2.0:
* New file date 11/03/01: overwrite
* New file date 11/02/01: do not overwrite
* New file date 11/01/01: do not overwrite

How can I get the same behaviour for Windows Installer? If a file has a version tag, Installer does not consider the date, which means 11/03/01 would not overwrite an older file with the same version number.

Another issue is overwriting a registry value: According to the documentation
if a registry key path is used for the component and both of the following conditions are true, Windows Installer installs the component:

  • No is selected for the Never Overwrite setting of the component.
  • The key path does not exist on the target system.

If one or both of those conditions are false for a component that has a registry key path, Windows Installer does not install the component at run time.

which means that an existing registry value would never be overwritten (as the second condition then would be false).

How can I make a component that only contains a registry value always update the registry?
Labels (1)
0 Kudos
(3) Replies
cydz1985
Level 3

Hi, are you using patch or quickpatch to create updates? If you are using QuickPach try this in order for the registries get updated everytime you apply a patch.

http://community.installshield.com/archive/index.php?t-193104.html
0 Kudos
the_boz
Level 4

I have Basic MSI projects. After some research I found this behaviour:

I have 2 components, each of them has 1 registry value which is the component's key path. Component1 has "Never Overwrite=No", Component2 has "Never Overwrite=Yes".
I install my package and both values are created. This should be obvious.

I then create a new release package (Major Upgrade) which has different values for the 2 registry settings (of course, the registry keys are the same, only the 2 DWORDs (in my case) now have different values than before).
When I run the setup, installation is done as an upgrade and now my registry looks like:
setting of Component1 has the value of the update package
setting of Component2 has the value of the original package

I would have expected this behaviour, as it seems logical and useful, but the documentation I quoted in my OP tells me something different. Maybe it should read
[if] any of the following conditions are true, Windows Installer installs the component [...] If both of those conditions are false for a component that has a registry key path, Windows Installer does not install the component at run time.


The file overwrite issue is still open.
0 Kudos
cydz1985
Level 3

This explaination is much more simplier to understand with regards to Never Overwrite property:

The Never Overwrite setting for a component enables you to indicate whether you want your installation to overwrite a file if it already exists on the target system:

If you select Yes, the file—if it exists on the target system—is never overwritten, regardless of the file version. Selecting Yes for this setting overrides file versioning rules.
If you select No and the file version on the target system is newer than the version being installed, the file on the target system is not overwritten. However, if the version being installed is newer, the file on the target system is overwritten.
Windows Installer checks for the existence of the component’s key file when determining if it should install the component. For more information, see Overwriting Files and Components on the Target System.
0 Kudos