ClickOnce Update & Registration

Add-in Express™ Support Service
That's what is more important than anything else

ClickOnce Update & Registration
Registration Out Of Sync With Install 
Michael Thrift




Posts: 41
Joined: 2015-06-09
Good Morning,

Some users of our EXCEL Add-In are experiencing an issue with the registration process. We check for an update when the user selects the custom ribbon tab in EXCEL. If an update is required, the update occurs, but of course the user must close all instances of EXCEL in order for the update to register with EXCEL.

At what point does the registration process stop trying to detect if all EXCEL processes are closed? If a user shuts down their computer for example, will the registration take place the next time they start up?

What I think is happening is the registration for the update never takes place. When the user opens EXCEL again, ClickOnce thinks it needs to update because the manifest is still a different version than the newest version. But when it starts to update, it sees that it does have the newest version. As a result, the CustomUI window appears (as though the update was successfully) but no registration takes place. Not even after all processes are closed. This causes a user to get stuck on an old version. Every time they open EXCEL now the CustomUI appears after the ClickOnce check ....

Because we are using a Custom UI, I do not have the "Register" / "UnRegister" buttons. How would I implement that functionality in VB.NET? Is that the solution?

Thoughts?
Posted 04 Feb, 2016 10:33:39 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Michael,

You can execute the Register/Unregister commands via callbacks obtained from the Properties collection of the
ADXClickOnceUIEventArgs parameter.

E.g.


C#:
        private void ClickOnceModule1_OnShowClickOnceCustomUI(object sender, ADXClickOnceUIEventArgs e)
        {
            System.EventHandler registerFn = (System.EventHandler)e.Properties["Register"];
            //registerFn.Invoke(this, EventArgs.Empty);

            System.EventHandler unregisterFn = (System.EventHandler)e.Properties["Unregister"];
            //registerFn.Invoke(this, EventArgs.Empty);
        }

VB.NET:
    Private Sub ClickOnceModule1_OnShowClickOnceCustomUI(sender As System.Object, e As AddinExpress.MSO.ADXClickOnceUIEventArgs) Handles MyBase.OnShowClickOnceCustomUI
        Dim registerFn As System.EventHandler = e.Properties("Register")
        'registerFn.Invoke(Me, EventArgs.Empty)

        Dim unregisterFn As System.EventHandler = e.Properties("Unregister")
        'unregisterFn.Invoke(Me, EventArgs.Empty)
    End Sub

Posted 08 Feb, 2016 12:00:39 Top
Michael Thrift




Posts: 41
Joined: 2015-06-09
Would any failure of the registration / un-registration process generate an error that can be handled? Would successfully registering / un-registering auotmatically display the "Success" message box?
Posted 08 Feb, 2016 12:06:44 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Michael,

Yes, both callbacks produce the 'Error' and 'Success' message boxes.
Posted 09 Feb, 2016 04:20:59 Top