First of all, there's a mistake in the way you pass the data from immediate custom action to the deferred one. The name of the Property
you use in the immediate custom action must be exactly the same as the Id
of the deferred custom action. In your case:
<!-- immediate CA -->
<CustomAction Id='Datenuebergabe' Property='DoSomething' Value='InstalllocVar=[INSTALLLOCATION]'/>
<!-- deferred CA -->
<CustomAction Id='DoSomething' BinaryKey ='myAction' DllEntry='DoSomething' Impersonate='no' Execute='deferred' Return='check' HideTarget='yes'/>
This will resolve the problem with KeyNotFound
exception.
Now, back to your question how to pass more than 1 value.
First, in the immediate CA use ;
separator to pass the name-value collection, like this:
<CustomAction Id="SetForDoSomething" Return="check" Property="DoSomething" Value="source=[ArchiveFolder][ARCHIVENAME];target=[WebsiteFolder]"/>
As you can see, there are 2 name-value pairs we pass to the deferred CA here, source
and target
. In the deferred CA, use the following code to take those values out:
var source = session.CustomActionData["source"];
var target = session.CustomActionData["target"];
And that's it.