CSharp / VB.NET Code

This action provides a code editor to define updating activity in .Net source code.  The custom action class that is defined using this action must implement the Execute method and the Rollback method.  The update work performed in the Execute method should be undone in the Rollback method.

Additional methods that can be implemented are:



Action Description - Descriptive text that can be used to identify this particular action in the Actions list.

Language: Select C# or Visual Basic.Net (The default language can be set in the application options dialog)

Build – Test builds the source code provided.

Enable Debugging – Builds the resulting dynamic custom actions assembly in debug mode and includes debug symbols in the update.  This setting is global for all Dynamic code actions in the project.

References – Provides a dialog to reference additional .Net assemblies for use in the dynamic action source code.


The C# / VB.Net action provides the ability to create custom update activity by writing .Net source code.  The defined source code is compiled and packaged as AppLife Builder builds the update.


The Shared Properties collection can be manipulated using this action by accessing the UpdateContext method parameter context.



Shared Properties can be used in other actions as well as within Action Conditional expressions.


Progress and textual information can be sent to the Update Engine user interface for user presentation by using the OnProgressChanged method from within an update action method body.

OnProgressChanged(new UpdateProgressChangedEventArgs(10, "C# / VB.Net action progress comments"));


See the AppLife Update API Documentation content for Kjs.AppLife.Update.Engine.Core UpdateAction class for more detailed technical information. The API documentation can be accessed from the Help menu within AppLife Builder.


Update Context

Each of the methods that can be overridden contain an UpdateContext parameter.  This context object allows your custom actions to interact with the update process.  Using the context object, your action methods have access to:

Application Directory
This is the path on the target client that contains the assembly hosting the Update Controller.

Update Package Directory
This is the path on the target client to the temporary folder.  Actions can place files here or read from files that other actions have placed.  It is a temporary working directory for the update process.

The reference to the Log object allows you to write output to the text log file.  This is primarily for diagnostic information.

Shared Properties
The shared properties reference exposes a dictionary that allows you to place object references that can be consumed in other actions, or conversely, access objects that you have placed from other actions.

The state reference allows you to get the current state of the update that is in progress.  Possible values include Prepare, Execute, Cleanup, RollbackExecute, RollbackPrepare.