Tracking Application install and version state

Applications may wish to take different actions on startup depending on if it is the application’s first run, and if it is an application upgrade or a clean install. This can be easily determined by saving state in the registry. Here is an example function:


    Function RunStatus()
        currentversion = "1.3"
        s = CreateObject("roRegistrySection", "Version")
        if not s.Exists("Number") then
            return "first-run-clean-install"
        elseif s.Read("Number") = currentversion then
            return "re-run"
        else
            return "first-run-upgrade"
        end if
    end Function