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?