I had the same problem since I wanted my custom action to read the file from which my MSI was, so I needed a path. I was able to find him using
TARGETDIR
According to MSDN TARGETDIR documentation
the root destination directory for the installation
Also, according to MSDN, SourceDir
the root directory that contains the source cabinet file or the source file tree of the installation package
Thus, the SourceDir property points to the actual directory: the one where your MSI file is located. This can be seen in the installer log during installation using msiexec / lvx * installer.log installer.msi.
However, for some reason, SourceDir is completely ignored when TARGETDIR is resolved. TARGETDIR must either be installed explicitly (for example, on the command line), or it enables ROOTDRIVE. If ROOTDRIVE is not specified explicitly, this is the root of the drive with the most free space.
source share