Lifecycle Actions

From wiki.gpii
Revision as of 19:01, 6 March 2014 by Anastasiac (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Lifecycle Actions are a special type of Lifecycle Handler. The GPII development platform includes two Lifecycle Actions:

  • gpii.launch.exec
  • gpii.launch.spawn

Referring to environment variables

In the lifecycle actions in the solution registry, you can refer to ENVIRONMENT variables using the following syntax:

${{environment}variable}

So for example, if you have a lifecycle action in which you want to get the value of the TEMP environment variable, it would look like:

{
    "type": "gpii.launch.exec",
    "command": "echo 'kill' > ${{environment}.TEMP}\\RW8Updates.dat"
}

Here "${{environment}.TEMP}" would evaluate to the value of the TEMP environment variable. If this was "c:\temp", the above lifecycle action would echo the string "kill" and write that to the file "c:\temp\RW8Updates.dat".


Refering to registry values

You can also refer to Windows REGISTRY values using the following syntax:

${{registry}BASEKEY\\path\\to\\registry\\key\\keyname}

So for example, if you have a lifecycle action in which you want to get the value of a registry entry which is on the basepath: "HKEY_CURRENT_USER", the path "Software\\Texthelp\\Read&Write10" and has the key "InstallPath" you would do:

{
    "type": "gpii.launch.exec",
    "command": "\"${{registry}.HKEY_CURRENT_USER\\Software\\Texthelp\\Read&Write10\\InstallPath}\\ReadAndWrite.exe\""
}

So, if the value of the registry entry was "c:\Windows\Applications\RWG", the entire command would evaluate to "c:\Windows\Applications\RWG\ReadAndWrite.exe"