user2437605
user2437605

Reputation: 1

How to ask user whether to overwrite an existing file when installing an higher version?

Recently I was creating a Windows Installer package using a WiX Setup project, and I have following requirements:

  1. When copying a versioned file to the Windows System32 folder, if the same file with a higher version is present then I should not overwrite.

  2. If a lower version is present, I need to overwrite the file.

Before doing this, the user should get a warning message like "File exists, do you wish to overwrite?".

Any suggestions is appreciated.

Upvotes: 0

Views: 219

Answers (1)

Tom Blodget
Tom Blodget

Reputation: 20772

Windows Installer handles the overwrite decision as you described but does not ask the user.

A couple suggestions in the "don't do this" category:

  1. Although it was common a couple of decades ago for installers to have such a feature, the vast majority of users are not knowledgeable enough to make the decision; those that are probably would not like to make the decision anyway. You should not ask them to do so.

  2. Application frameworks have evolved to the point where putting files in System32 is usually not necessary. In particular, if your application depends on a third-party library, use its installer to handle its installation. You can use WiX Bootstrapper project to chain the installers together (WiX 3.6 or later).

Upvotes: 2

Related Questions