{"id":280,"date":"2015-09-16T17:59:14","date_gmt":"2015-09-16T16:59:14","guid":{"rendered":"http:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/?p=280"},"modified":"2024-04-10T10:06:46","modified_gmt":"2024-04-10T09:06:46","slug":"customactiondata-quick-reference","status":"publish","type":"post","link":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/2015\/09\/16\/customactiondata-quick-reference\/","title":{"rendered":"CustomActionData example &#8211; quick reference"},"content":{"rendered":"<p><strong>&#8220;Look I know about msi&#8217;s, just remind me how to do<\/strong> <strong>it with an example!&#8221;<\/strong><\/p>\n<p>Ok I hear you &#8211; most web references either don&#8217;t give an example or force you to read\u00a0<em>all<\/em> the theory first! \u00a0Here you go &#8230;<\/p>\n<p>1. Create a type 51 custom action to store the property you want to reuse in deferred execution. \u00a0It&#8217;s property name (Source column) <strong>must<\/strong> be the same as the custom action name that will use it later in deferred execution:<\/p>\n<table>\n<tbody>\n<tr>\n<th style=\"background-color: #ffffc7\">Action Name<\/th>\n<th style=\"background-color: #ffffc7\">Type<\/th>\n<th style=\"background-color: #ffffc7\">Source<\/th>\n<th style=\"background-color: #ffffc7\">Target<\/th>\n<\/tr>\n<tr>\n<td>StoreUSERNAME<\/td>\n<td>51<\/td>\n<td>vbsDisplayUsername<\/td>\n<td>[USERNAME]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2. Put the new type 51 action with immediate execution in the InstallExecuteSequence somewhere.<\/p>\n<p>3. Custom action in deferred execution references the stored information. \u00a0It&#8217;s Action Name <strong>must<\/strong> be the same as property being set in the type 51 action (Source column):<\/p>\n<table>\n<tbody>\n<tr>\n<th style=\"background-color: #ffffc7\">Action Name<\/th>\n<th style=\"background-color: #ffffc7\">Type<\/th>\n<th style=\"background-color: #ffffc7\">Source<\/th>\n<th style=\"background-color: #ffffc7\">Target<\/th>\n<\/tr>\n<tr>\n<td>vbsDisplayUsername<\/td>\n<td>1062<\/td>\n<td><\/td>\n<td>MsgBox &#8220;-&gt;&#8221; &amp; Session.Property(&#8220;CustomActionData&#8221;) &amp; &#8220;&lt;-&#8220;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>4. Put the second deferred action after the first in the sequence and the embedded VBScript should display the content of the property, in this example the username.<\/p>\n<p>If you want detail about how and why this works &#8211; get Googling!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Look I know about msi&#8217;s, just remind me how to do it with an example!&#8221; Ok I hear you &#8211; most web references either don&#8217;t give an example or force you to read\u00a0all the theory first! \u00a0Here you go &#8230; &hellip; <a href=\"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/2015\/09\/16\/customactiondata-quick-reference\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8374],"tags":[],"class_list":["post-280","post","type-post","status-publish","format-standard","hentry","category-work"],"_links":{"self":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/posts\/280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/comments?post=280"}],"version-history":[{"count":12,"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/posts\/280\/revisions"}],"predecessor-version":[{"id":329,"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/posts\/280\/revisions\/329"}],"wp:attachment":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/media?parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/categories?post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/darrencollins\/wp-json\/wp\/v2\/tags?post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}