Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest: Version is not just determined from assembly version information! #260

Closed
goodyu372 opened this issue Apr 22, 2019 · 18 comments
Closed

Comments

@goodyu372
Copy link

For example, you can determine the version number from a field ,or read the version number from the configuration file.

Why do I have this need? Because some software exe may not be updated for a long time, but the plug-in DLL will be updated.

Therefore, the current condition for judging whether to update is too simple.

@goodyu372
Copy link
Author

-<
The author never replied.

@goodyu372
Copy link
Author

@ravibpatel
Copy link
Owner

Current condition to determine version is sufficient for most devs. So there are no plans to change it.

@CADbloke
Copy link

CADbloke commented Sep 5, 2019

Here is one good reason to have some flexibility - changing the AssemblyVersion breaks bindings for any app calling the assembly so it should be mostly left the hell alone until your update actually breaks the public API. Reference: https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin/802038#802038

I use AssemblyFileVersion to determine that actual release version and if I use this library I'll fork it and make that change in hte code referred to in #114

@tNRevan
Copy link

tNRevan commented Jan 17, 2020

+1 for this. My app consists of base app, database (local file) and plugins. The base app and also the plugins can be updated this way. But the database cannot be updated, because it is not an assembly. So in order to do that, I need to either create a fake assembly tied to the database or somehow fake the Assembly.

@Weqqen
Copy link

Weqqen commented Mar 18, 2020

+1
My project uses Assemblyinfo (in fact SharedAssemblyinfo.cs - each project has link to this file).
The dlls itself after build has correct version, but autoupdater don't catch that value

I know that in the manual only the project values are supposed to be taken into consideration, so this issue is not bug in fact but rather feature request.

@AlexBrunnerACAG
Copy link

+1 Our projects are all having the same approach as mentioned by Weqqen.
We use the AssemblyFileVersion to specify the version in case of a hotfix version where only single assemblies are exchanged. The fact that the AssemblyVersion remains the same lets us do this without getting binding failures.

@ravibpatel
Copy link
Owner

I am thinking of providing the extra property to assign the installed version. The field value will be used if it is assigned a value and if it isn't then standard logic will be used.

Would it be sufficient for all the scenarios?

@AlexBrunnerACAG
Copy link

AlexBrunnerACAG commented Apr 9, 2020 via email

@tNRevan
Copy link

tNRevan commented Apr 9, 2020

I am thinking of providing the extra property to assign the installed version. The field value will be used if it is assigned a value and if it isn't then standard logic will be used.

Would it be sufficient for all the scenarios?

I think that would be a good way.

@Weqqen
Copy link

Weqqen commented Apr 13, 2020

Hi,
I am not sure property of what we are talking about exactly - but if this would be a way to tell updater directly what version it is running on - that would be sufficient.
Thanks!

@AlexBrunnerACAG
Copy link

Hi,
for my understanding Ravi is talking about an additional property available in the xml file.
The current property version is compared with the value of assemblyVersionAttribute and not with the value of assemblyFileVersionAttribute.

When just having a hotfix we just increment the assemblyFileVersion and the assemblyVersion remains the same. In the following sample the assemblyFileVersion is set to 3.0.1.10009.
When checking for updates this will be correctly recognized as update.
But after the update the check again says that there's an update available becuase 3.0.1.10009 is compared to the assemblyVersion which is set to 3.0.1. This can be seen in the screenshot of the updater dialog.

2020-04-17 11_10_17-__sgfile01 ac local_Software_HelpDesk_AutoUpdater_AutoUpdater xml - Notepad++

2020-04-17 11_20_11-HelpDesk (Running) - Microsoft Visual Studio (Administrator)

2020-04-17 11_08_34-HelpDesk NET 3 0 1 10009 ist verfügbar!

Having an additional property in the xml like fileVersion would then give the chance to compare the fileVersion attribute with the assemblyFileVersion attribute.
This should then be working properly.

Best regards,
Alex

@ravibpatel
Copy link
Owner

I was thinking about adding CurrentVersion property to the AutoUpdater class. So you can set it to whatever you want. When there is an update check it will compare the latest version retrieved from the XML file with this CurrentVersion property if it is present. This way anyone can implement their own logic to determine the current version.

@AlexBrunnerACAG
Copy link

That's perfect. This way we can implement our behavior easily.

@ravibpatel
Copy link
Owner

I added the feature in the latest commit. You can try it from here. You should be able to assign the installed version manually as shown below.

AutoUpdater.InstalledVersion = new Version("1.2");
AutoUpdater.Start("Your XML file URL");

Please test it and provide your feedback so I can publish the NuGet package.

@Weqqen
Copy link

Weqqen commented Jul 31, 2020 via email

@AlexBrunnerACAG
Copy link

Hi,

I integrated the 1.6.1 and did the following test.

I've used the following code to set the AssemblyFileVersion as AutoUpdater.InstalledVersion:

      FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
      AutoUpdater.InstalledVersion = new Version(fvi.FileVersion);

The behavior is as expected.

Thanks for the change.

Best regards,
Alex

@ravibpatel
Copy link
Owner

Updated the NuGet package to v1.6.1 with this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants