Is it possible to fix missing source msi issue for repair install?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Is it possible to fix missing source msi issue for repair install?

This post has NOT been accepted by the mailing list yet.
I just have faced notoriously known issue with failed repair/update install of a product when source .msi is missing. Problem description:

 - Download foo.msi.
 - Run foo.msi.
 - Remove foo.msi.
 - Run msiexec.exe /f .
Step #4 fails, however foo.msi is in local Windows Installer cache. Details: http://www.itninja.com/question/the-msi-doesn-t-repair-when-the-install-source-is-removed-from-its-original-location-how-can-it-be-fixed

I think I have solution for this issue. It is based on altering source location list values using Windows Installer Source Location Manager API at run-time.

I'm planning to create custom action (CA) that will to the following:

Create temporary directory.
Call MsiSourceListAddSource() function passing path to just created temporary directory.
Create symlink to running MSI (value of DATABASE msi property) in the temporary directory. If symlink creation fails, just copy running MSI in the temporary directory.
Schedule this CA before ResolveSource action in InstallExecute sequence with condition this is not fresh install and not product uninstall.

That is basically it. Also I need another CA that will do clean up after CA #1.

I have working prototype already and it works nice. Questions:

 - Is this the wheel reinventing? Is there already some WiX extension addressing this scenario?
 - Are there any corner cases when MsiSourceListAddSource() doesn't work?
Alexey Semenyuk