How to get the path of Where MSI file is located f

2019-09-21 03:22发布

问题:

I want to Locate path of MSI from WIX Source code when we perform installation. I tried using $(sys.SOURCEFILEPATH) which returns what I need (C:\temp\myProj\sample.msi)). But when I copy MSI file to a different folder (D:\temp\sample.msi) and tried to install I am getting the same path as previous(C:\temp\myproj\sample.msi).

Thanks for your answers in advance

回答1:

The Windows Installer sets the OriginalDatabase property to the path of the installation database used to launch the installation.

https://docs.microsoft.com/en-us/windows/desktop/msi/originaldatabase