MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Components[Next]: Conditions
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Windows Installer FAQ (the basics)->Components->Component Keypath

Windows Installer Basics: Component Keypath

One of the most important attributes of a Component is its keypath which is what Windows Installer looks at to see if a repair is required (if an item is not a component keypath its absence will not be detected and repaired). A component keypath can be a directory, a file or a registry value.

If you have 26 files "a.dll" to "z.dll" and the keypath is "b.dll" then during a repair Windows Installer will look to see if "b.dll" exists, if it does then it considers that the component is OK and does not need a repair even if all other 25 dlls are missing. Note that having 26 DLLs in a single component breaks Microsoft guidelines.

For this reason it is wise to consider how many files should be in a single component (and not only what its keypath should be). Due to the overhead on Windows it is generally not recommended that you create a component per file/registry etc.

Microsoft recommend that executable file types such as dlls go into their own component (and MAKEMSI does this by default when adding files if you are asking it to create the components) however due to the many different rules that can sometimes apply you will find yourself forced to break one or more of these.

Some Windows Installer tables/actions look at the keypath of the component as another parameter, for example the "ServiceInstall" command installs a service, the executable is not directly specified, it is whatever is the components keypath! Advertised shortcuts also take the target information from the keypath.

FILE_EXTENSIONS_WHICH_NEED_OWN_COMPONENT

The "FILE_EXTENSIONS_WHICH_NEED_OWN_COMPONENT" macro is used to tell MAKEMSI what files need to go into their own components (and hence become the keypath of that component).

As mentioned above ideally all files would go into a their own component by that would make Windows Installer (and potentially the whole workstation) very slow.

The default MAKEMSI value is defined as:

#( ';'
   ;--- Semi colon (";") delimitered list of file extensions ----------------
   #define? FILE_EXTENSIONS_WHICH_NEED_OWN_COMPONENT    ;;"*" means all
   .exe
   .dll
   .ocx
   .hlp
   .chm
#)

My recommendation is to determine what files are in use when your application is running (even if you close it during install) and ensure each of these also goes into their own component as Windows Installer tries to hide a lot of deficiencies through advertising, for one of these see the missing files caused by pending reboot operations issue.

The easiest way to determine what files are in use is probably to use a "del /s" command from a command prompt and see what can't be deleted.


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Components[Next]: Conditions


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Friday October 13 2017 at 2:08pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.