Blog
Scribe: Installer script hooks
Date: 14/7/2016
Tags: scribe scripting
So you know those red bars that appear in Scribe when it wants to install something? I've just added the spell check dictionaries to that so you have to confirm there install. This allows you to make sure you have a working internet connection before download a dictionary. But I thought it would be cool to add some scripting hooks for the install bar and the actual install itself. So take an example script like this:
function BeforeInstall(App, Msg, Actions)
{
    Actions.Add("Scare");
    Msg = Msg + " (BeforeInstall was here)";
    return true;
}

function Install(App, Action)
{
    if (Action == "Scare")
    {
        MsgBox(App, "Boo!");
        return false;
    }
    
    return true;
}

function Main(App)
{
    if (!AddCallback("OnBeforeInstallBar", "BeforeInstall"))
        MsgBox(App, "Couldn't add BeforeInstall");
    if (!AddCallback("OnInstallComponent", "Install"))
        MsgBox(App, "Couldn't add Install");

    return 1;
}
What it does is install 2 callbacks, one for the missing capability bar, and one for the install itself. It messes with the message and buttons available to the install bar. Then adds a new "action" that is caught later in the "Install" function to put up a dialog box. Might be useful for managed installs of Scribe.
(1) Comment | Add Comment