0

Suppose I have a custom action for my Wix Installer that needs the path from a file:

public static ActionResult AddUsbLanCertificate(Session session, string path)
{

    //do something e.g. File.Copy(path, dest);
    return ActionResult.Success;
}

How can I tell this CustomAction where this file is located, How I can handover the path?

Antonio
  • 23
  • 5
  • You need to send the folder to deferred mode via [the CustomActionData mechanism](https://learn.microsoft.com/en-us/windows/win32/msi/obtaining-context-information-for-deferred-execution-custom-actions). This mechanism essentially sends a property value into the custom action that needs it - property values are not available automatically in deferred mode (the installation mode that writes to the system). See [this answer](https://stackoverflow.com/a/64018630/129130) and [this one](https://stackoverflow.com/a/54298965/129130). There is a GIT sample in there. Try it out? – Stein Åsmul Nov 30 '20 at 16:59
  • Another issue is what you are trying to do. What is the task you need to perform? There could be better ways. [Custom actions have many challenges](https://stackoverflow.com/a/46179779/129130). – Stein Åsmul Nov 30 '20 at 17:06

0 Answers0