How to get bootstrapper location from Managed Custom Action

Apr 24, 2015 at 10:10 AM
In a managed custom action I need the location of the installers bootstrapper path.

session["SOURCEDIR"] gives me: "C:\Temp\Wix#"

but my test setup is located in C:\Source\trial\Install\TestInstall\TestInstall\setup.exe.

I use sample Samples\Bootstrapper\NativeBootstrapper
        var project = new Project("MainProduct",
                new ManagedAction(@"MyAction", Return.check, When.Before, Step.InstallFiles, Condition.NOT_Installed));

public class CustonActions
    public static ActionResult MyAction(Session session)
        MessageBox.Show(session["SOURCEDIR"], "Test");
        return ActionResult.Success;

Apr 24, 2015 at 12:38 PM
Edited Apr 24, 2015 at 12:40 PM
Sorry, cannot help.
SOURCEDIR is controlled completely outside of Wix#. As far as I understand you should not be using it. This is the quote of Rob Mensching (one of the founders of WiX):
"Honestly, the TARGETDIR/SourceDir Directory element is something that we should have hidden from the developer using the WiX toolset but didn't. Sorry."