Updater

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

Updater
Click Twice Updater Setting 
Michael Kaden




Posts: 286
Joined: 2017-11-15
Hello

I have an Excel AddIn (COM & XLL), Click Twice Installation, and use the Updater, but the notice for the Update seems to "pop up" at undefined times.

I checked the ADX manual (93 update) and also the forum and Goggled but could not find a good specification fro the settings in the updater forms. What I would like is that the Update notice comes up immediately when the Excel Application is started and if ignored, is repeated whenever a new Excel Instance is started again, except if the user clicks to ignore this Version.

My selections in the project are as follows:

http://www.alerasoftlib.de/ADX/Updater01.jpg

http://www.alerasoftlib.de/ADX/Updater02.jpg

I also would like to add a Ribbon button where the user can check for updates and install it, even if he has opted to skip this Version before. Do you have a VB code example fro that, please.

Thank you & kind regards

Michael
Posted 14 Feb, 2021 10:29:16 Top
Michael Kaden




Posts: 286
Joined: 2017-11-15
Hello Andrei,

Strangely when I posted the above, I got a warning, "You have not enough credits to create a new topic" hwever, I believe the post went through??

Kindest Regards

Michael
Posted 14 Feb, 2021 10:32:27 Top
Andrei Smolin


Add-in Express team


Posts: 17613
Joined: 2006-05-11
Hello Michael,

Yes, your message has been posted correctly.

What you describe is the default behavior. Maybe Windows notifications are turned off on your PC?

To install an update using code, you do the following in the code of the add-in module:

private void adxRibbonButton1_OnClick(object sender, 
   AddinExpress.MSO.IRibbonControl control, bool pressed)
{
   if (this.IsMSINetworkDeployed() && this.IsMSIUpdatable())
   {
      string updateUrl = this.CheckForMSIUpdates(); 
      if (!String.IsNullOrEmpty(updateUrl)) 
      {
         if (MessageBox.Show("A new version of the add-in was detected. " + 
            "Would you like to install the update?",   
            this.AddinName, MessageBoxButtons.YesNo,   
            MessageBoxIcon.Question) == DialogResult.Yes)   
         {
            this.LaunchMSIUpdates(updateUrl);
         }
      }
   } 
}  


The code above is based on four methods.
IsMSINetworkDeployed returns True if the application was installed via ClickTwice.
IsMSIUpdatable returns True if the user is permitted to update the application. In Vista or Windows 7, it is always True. If the application was installed for all users and the current user is not an administrator, the UAC pop-up will ask for administrator credentials.
CheckForMSIUpdates returns an empty string if there are no updates in the location specified in the Installation URL field of the Publish dialog. If a new version of the add-in is available, CheckForMSIUpdates returns one of the following strings: a URL or UNC path (the URL can be a link to the application downloader), or the value specified on the Updates page of the Preferences dialog (see Preferences). To install the update, we call the LaunchUpdates() method.
LaunchUpdates - downloads and installs the updates.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Feb, 2021 09:26:22 Top
Michael Kaden




Posts: 286
Joined: 2017-11-15
Hello Andrei,

thank you very much for your prompt reply.

Where do I find the MSI and the LaunchUpdates methods mentioned in your code?

Any possibility to post a VB code sample of your above code?

Thank you very much & kind regards

Michael
Posted 15 Feb, 2021 14:16:46 Top
Andrei Smolin


Add-in Express team


Posts: 17613
Joined: 2006-05-11
Hello Michael,

These methods are provided by the ADXAddinModule class.

https://converter.telerik.com/ converts that code fragment as follows; you may need to polish it:

Private Sub adxRibbonButton1_OnClick(ByVal sender As Object, ByVal control As AddinExpress.MSO.IRibbonControl, ByVal pressed As Boolean)
    If Me.IsMSINetworkDeployed() AndAlso Me.IsMSIUpdatable() Then
        Dim updateUrl As String = Me.CheckForMSIUpdates()

        If Not String.IsNullOrEmpty(updateUrl) Then

            If MessageBox.Show("A new version of the add-in was detected. " & "Would you like to install the update?", Me.AddinName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
                Me.LaunchMSIUpdates(updateUrl)
            End If
        End If
    End If
End Sub


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Feb, 2021 04:53:35 Top