Michael Kaden
Guest
|
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 |
|
Michael Kaden
Guest
|
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 |
|
Andrei Smolin
Add-in Express team
Posts: 18823
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.
Andrei Smolin
Add-in Express Team Leader |
|
Michael Kaden
Guest
|
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 |
|
Andrei Smolin
Add-in Express team
Posts: 18823
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
Andrei Smolin
Add-in Express Team Leader |
|