If you have specified the target framework in your custom action, I do not see why it would use another version, as long as the targeted version is installed on the machine.
In the following Microsoft article:
Framework targeting overview
it is specified that:
In Visual Studio, you can specify the version of .NET that you want your project to target. Framework targeting helps guarantee that the application uses only functionality that is available in the specified framework version. For .NET Framework apps to run on another computer, the framework version that the application targets must be compatible with the framework version that's installed on the computer.