0
votes

I have been working for 3 days now to understand how windows installer work? It was a big question that I should answer before starting a new AutoIT scripting Job.Maybe many of you think that I will not need these informations since I will just use msiexec tool with the right options but it is important for me to know how does it work from the inside to have a solid theoretical basis when I face msi errors. I have learned so much during these 3 days. I already know that MSI is file format which contains inside sources files(icons,ini files, language files, configuration files, exe files, registry key, ...) and the most important that it contains Relational DataBase. I know that each product has a GUID and each product is composed of many components that have also a GUID. All installation sequences are stored inside the MSI database also (with table for each sequence and execution conditions). Now come the point where I am stucking. I think that windows installer should keep some informations in a kind of repository on the target machine (on which the software will be installed) I don't know where to find this repository and how to get informations from it. For example I would like to know: - what are the MSI products already installed on a computer (list of all GUID of the product). - what are components already installed on a computer (list of all GUID)? - what are the steps or the actions that have been done during installations?(I think that maybe there a log file that describes installations steps hided somewhere on the local computer)? Maybe there a copy of MSI database that will be stored on the local computer as log file for describe installation sequence!! - where sources files are copied on the target computer?

I have done some tests installation to check some registry entry but after the installation is done I didn't find that there are new registry entry !!! this where I have checked HKEY_CLASSES_ROOT\Installer HKEY_CURRENT_USER\SOFTWARE\Microsoft\Installer HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer

Last solution I have used the process monitor and then RegShot tools and I saved logs files about new registry added and monitoring of the process msiexec (please see links below) the MSI file that I have used to launch an installation belongs to 7-ZIP tool.

Result of comparison between the registry database before the installation and after the installation

msiexec process monitor during installation(accessible only with Processor Monitor tool)

For peoples how can help me I will appreciate.

Thanks in advance.

1

1 Answers

1
votes

Try to avoid guessing the implementation details when there are APIs that can give you what you need. Though that said, I'm not clear what your objective is here, so I'm going to give terse starting point answers, and you can follow up as appropriate with better targeted questions. (Note: many of the C++ APIs linked below are available with other names on the Windows Installer Automation Interface. I'm not an expert on that, so I've omitted such links.)

what are the MSI products already installed on a computer (list of all GUID of the product).

Find this out with MsiEnumProducts or MsiEnumProductsEx (the latter supports querying per-user installs of other users).

what are components already installed on a computer (list of all GUID)?

Find this out with MsiEnumComponents or MsiEnumComponentsEx (the latter supports querying per-user installs of other users).

what are the steps or the actions that have been done during installations?

This is not stored. The component state (MsiQueryComponentState) "should" tell you enough to identify what should be there, and thus repair it if it's missing.

Maybe there a copy of MSI database that will be stored on the local computer as log file for describe installation sequence!!

Not as a log file, but the database is copied to a cache directory (MsiQueryProductInfo(..., INSTALLPROPERTY_LOCALPACKAGE, ...)). It should be considered read-only in that location.

where sources files are copied on the target computer?

They may or may not be present. Query with MsiSourceListEnumSources or MsiQueryProductInfo(..., INSTALLPROPERTY_INSTALLSOURCE, ...) (the latter should tell you the original location, though it may theoretically have been removed from the source list).