Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Will it overwrite existing dll's? 1

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
I have created an installation package (msi) to install my program, this package contains many dlls.

Is there an option to say whether to check whether an existing dll on a pc exists and if so ask the user whether they want to replace it, or upgrade it?
Or does it just overwrite dlls not without prompting?

Thanks.
 
When installing via the Windows Installer, you are not provided with that kind of choice. The Installer has control and will decide what to do based on the results of a rather complex process described below. The version numbers referred to here are internal to the executable file (exe, ocx, dll).

From the Windows Installer docs:

At the core of any installer is the actual installation of files. But determining whether to install a file is a complex process. At the highest level, making the determination depends on whether the component to which a file belongs is marked for installation. Once the determination is made that a file should be copied, the process is complicated if another file with the same name exists in the target folder. In such situations, making the determination requires a set of rules involving the following properties:

Version
Date
Language

The installer only uses these rules when trying to install a file to a location that already contains a file with the same name. In this case, the Microsoft Windows Installer uses the following rules to determine whether to install.

Highest Version Wins - All other things being equal, the file with the highest version wins, even if the file on the machine has the highest version.

Versioned Files Win - All other things being equal, a versioned file gets installed over a non-versioned file.

Favor Product Language - All other things being equal, if the file being installed has a different language than the file on the machine, favor the file with the language that matches the product being installed. Language neutral files are treated as just another language so the product being installed is favored again.

Mismatched Multiple Languages - All other things being equal, after factoring out any common languages between the file being installed and the file on the machine, any remaining languages are favored according to what is needed by the product being installed.

Preserve Superset Languages - All other things being equal, preserve the file that supports multiple languages regardless of whether it is already on the machine or is being installed.

Non-versioned Files Are User Data - All other things being equal, if the Modified date is later than the Create date for the file on the machine, do not install the file because user customizations would be wiped out. If the Modified and Create dates are the same, install the file. If the Create date is later than the Modified date, the file is considered unmodified, install the file.

Non-versioned Files Using Companion - All other things being equal, a non-versioned file that is associated with a versioned file using the companion mechanism abides by the rules for the versioned file. The only exception is if the versioned file on the machine and the versioned file being installed have the same version and language but the companion file is missing on the machine. In this case the companion file being installed is used even though the versioned file on the machine is used.

Rules Are Global- The rules for determining when to install a file reside in one place within the installer and are global, meaning they apply to all files equally.

Hope that helps!
 
Cheers for that very useful info!

do u know whether the Package and Deployment wizard prompts the user to overwrite dll's, ocx's etc.

cheers again.
 
Hi,

I'm not sure about your install package... but normally you have to unregister a dll first. Remove it (sometimes can't as it is still active in memory due to "pooling", therefore I have found we had to restart the Server then remove old version), copy in new version, and re-register the dll.

Computergeek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top