Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there alternative way to access session details in deferred custom action?

I have a custom action and need to get below values for copying some parts from installation folder to VS2010 folder

  1. VS2010 directory path (VS2010DEVENV property)
  2. Installation path (INSTALLLOCATION property)

To give enough privileges, I've set custom action as Execute='deferred' Impersonate='no'. But when running the installer, it logged the message:

Cannot access session details from a non-immediate custom action

It seems we cannot access a property in a "deferred" custom action (i.e session["VS2010DEVENV"])

Is there any other way so that I can retrieve those values as needed?

like image 932
jcha Avatar asked Sep 05 '11 09:09

jcha


1 Answers

This must be helpful. Pay special attention to the bottom of the page, a guideline of 2 steps how to pass values via CustomActionData.

Here is the excerpt:

To write the value of a property into the installation script for use during a deferred execution custom action:

  1. Insert a small custom action into the installation sequence that sets the property of interest to a property having the same name as the deferred execution custom action. For example, if the primary key for the deferred execution custom action is "MyAction" set a property named "MyAction" to the property X which you need to retrieve. You must set the "MyAction" property in the installation sequence before the "MyAction" custom action. Although any type of custom action can set the context data, the simplest method is to use a property assignment custom action (for example Custom Action Type 51).
  2. At the time when the installation sequence is processed, the installer will write the value of property X into the execution script as the value of the property CustomActionData.
like image 117
Yan Sklyarenko Avatar answered Oct 29 '22 18:10

Yan Sklyarenko