{"id":1041,"date":"2017-12-02T08:56:40","date_gmt":"2017-12-02T08:56:40","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1041"},"modified":"2020-01-09T09:26:51","modified_gmt":"2020-01-09T09:26:51","slug":"guidelines-for-custom-action-location","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/guidelines-for-custom-action-location\/","title":{"rendered":"Guidelines for Custom Action Location"},"content":{"rendered":"<p><strong>created the topic: Guidelines for Custom Action Location<\/strong><br \/>\nGeneral<br \/>\nPlace the custom action as high in the sequence as possible where it executes properly. If it doesn&#8217;t execute properly when you test it, keep moving it lower in the sequence until it works.<br \/>\nIf the custom action uses information that&#8217;s gathered during the User Interface sequence, place it after the actions that gather the information you need.<br \/>\nIf the installation is run silently, items in the User Interface sequence do not execute.<\/p>\n<p>Correct Sequence<br \/>\nIf the action does this:  Place it in this sequence:<br \/>\nGathers input from an end user<br \/>\nUser Interface<br \/>\nNeeds to change properties<br \/>\nUser Interface or Execute Immediate<br \/>\nIs an Install MSI custom action<br \/>\nExecute Immediate<br \/>\nIs to be executed sometime during the installation of files<br \/>\nExecute Immediate or Execute Deferred<\/p>\n<p>Place it between the InstallInitialize and InstallFinalize actions, near the InstallFiles action. The InstallFiles action installs files during deferred mode.<br \/>\nMakes a change to the system<br \/>\nExecute Deferred<br \/>\nDepends on a previous action in order to run<br \/>\nExecute Deferred<\/p>\n<p>Windows Installer does not perform the action when it runs in Immediate mode. If a custom action depends on a change to the system, and the change has not yet been made, the custom action fails.<br \/>\nRequires elevated privileges to run<br \/>\nExecute Deferred<\/p>\n<p>Actions run in Deferred mode can be run under the system context. See the description of the In-Script Options field in Using the Custom Action Properties Tab.<\/p>\n<p>Restricted Areas<\/p>\n<p>    * If an action has restrictions on its placement in the sequence, the restricted areas are shaded in the Installation Sequence list when you select the action in the Actions list. Place the action in a non-restricted area. Restrictions are defined by Windows Installer functionality. Example: You can&#8217;t run an action that depends on an installed file if the file is not yet installed.<br \/>\n    * If you use the Move Up and Move Down commands on a custom action that has restricted placement, keep in mind that the restricted areas will not be shaded. Before moving an action, select the action in the Actions list to view its restricted areas.<br \/>\n    * Formatted Text<br \/>\n    * If you use formatted text in a custom action, such as a bracketed property name, the custom action must be placed after the CostFinalize action in the User Interface sequence. This is a Windows Installer requirement.<br \/>\n    * If you use formatted text in a custom action, do not put the custom action in the Execute Deferred sequence. Formatted text strings do not convert in the Execute Deferred sequence. The exceptions to this rule are the CustomActionData and ProductCode properties. See Formatted and Obtaining Context Information for Deferred Execution Custom Actions in the Windows Installer SDK Help.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>created the topic: Guidelines for Custom Action Location General Place the custom action as high in the sequence as possible where it executes properly. If it doesn&#8217;t execute properly when&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[49],"tags":[264],"class_list":["post-1041","post","type-post","status-publish","format-standard","hentry","category-general","tag-custom"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1041"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1041\/revisions"}],"predecessor-version":[{"id":1042,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1041\/revisions\/1042"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}