I've been trying to figure out how to copy some files located in the
directory the msi file is being run from to the Install directory, the
big problem being that I couldn't find an easy way to fetch the value
of the source directory.

SourceDir leads to the root of the drive and CURRENTDIRECTORY isn't
accessible through Wix. Searching through the archives let to a lot of
suggestions involving the msi property OriginalDatabase, however that
includes the file name so there is the added complication of writing a
custom action to strip that off.

While looking through the log files after some experiments however I
noticed that SourceDir starts at the actual Source directory before
being truncated to just the root. I managed to use the following
custom action to grab the value before the truncation happens:

<CustomAction Id="ResetSetupDir" Property="SETUPDIR" Value="[SourceDir]" />

and in AdminUISequence:

<Custom Action="ResetSetupDir" Before="ExecuteAction">NOT Installed</Custom>

Since I didn't see that suggestion in response to any of the previous
similar questions I thought it might be useful to share.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to