NetSparkleUpdater / NetSparkle

NetSparkle is a C#, cross-platform, highly-configurable software update framework with pre-built UI for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 signatures. View basic usage here in the README and try the samples for yourself.
https://netsparkleupdater.github.io/NetSparkle/
MIT License
596 stars 81 forks source link

Buttons out of view in build-in UI #123

Open MarcBuss24 opened 3 years ago

MarcBuss24 commented 3 years ago

I am trying to make an updater with the build-in UI WinForms/NetCore but some buttons are not showing properly on the window. I know that this issue has already been asked before but there was no answer so I was wondering if someone found what the problem is. By pulling the sample project, I get the same thing.

Capture
Deadpikle commented 3 years ago

Hi @Marc022!

First, apologies for not only a slow reply but also the lack of a reply in the first place to at least acknowledge the issue. I'm so busy right now, and I'm not a WinForms expert, so this is difficult for me. I'm learning slowly, though, and I am hoping this is fixed in 2.0.0-preview20200823001! Please test it out. If the issue persists, please re-open this bug and give me more info on your test system if you can. Things like operating system version, DPI, monitor scaling, and other things would be really helpful to me, as I could not replicate this issue locally and had to guess as to what could fix it.

WaseemAlkurdi commented 3 years ago

@Deadpikle

Hello!

I've had this issue with the latest version of NetSparkle as of today ... I'm developing a C# program inside a VirtualBox VM, and so far, everything has been working fine, until I maximized the virtual machine's window, which causes the screen resolution to dynamically change to the size of the host's screen. I resized it back to its original size ... and now for some reason the updater dialog buttons are almost gone!

I rebooted the virtual machine, and now a tiny fraction of the buttons does show up. I think that this is an anchor issue.

That virtual machine is running Windows 7, and DPI settings are set to defaults (96 DPI and 100% scaling).

Also note the weird gap between the end of the text (black box ends where text ends) and "is now available" ... why would that be?

Attached is a screenshot: Screenshot

(Also same issue as in: https://github.com/NetSparkleUpdater/NetSparkle/issues/44)

Deadpikle commented 3 years ago

@WaseemAlkurdi

Thanks for the report. Which UI? Is this WinForms .NET Core or .NET Framework? Or WPF?

If someone can make a reproducible sample for this DPI issue, I would love to have it. I can't repro this issue, which makes it very hard to fix. That table row on the form has a height of AutoSize, so.......😵

RE: The whitespace -- does your app cast program name or version # have a bunch of whitespace or something? (You can anonymize and paste the app cast here; that might help.) This is the code that generates that text:

lblInfoText.Text = string.Format("{0} {3} is now available (you have {1}). Would you like to {2} it now?", item.AppName, versionString, downloadInstallText, item.Version);
WaseemAlkurdi commented 3 years ago

@Deadpikle

This is the .NET Framework UI version (2.0.0-preview20210314001), and I'm running Visual Studio 2013 and .NET Framework 4.5.2 on Windows 7. Both the system language and locale are English (US), so it's definitely not a localization issue.

I did nothing special apart from merely importing and using NetSparkle, except maybe that I'm using a custom icon (can't get it to disregard the "icon" parameter, so I had to specify my app's icon). It's almost certainly not that, since the buttons used to work alright even with the custom icon.

I will try to reinstall Windows 7 and VS2013 on a clean VM later today to see if I can do anything specific to "trigger" this.

As for the whitespace, you're right! It's indeed the issue. Looking in the generated appcast, I see that it automatically inserted a bunch of spaces after the version! This is my appcast:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<title>REMOVED</title>
<language>en</language>
<item>
<title>REMOVED 1.1                                               </title>
<pubDate>Sat, 20 Mar 2021 02:07:54 +02:00</pubDate>
<enclosure url="http://xxx.yyy.zz.a/REMOVED.exe" sparkle:version="1.1                                               " sparkle:shortVersionString="1" length="REMOVED" sparkle:os="windows" type="application/octet-stream" sparkle:signature="REMOVED" />
</item>
</channel>
</rss>
Deadpikle commented 3 years ago

Thanks for the additional info. Definitely not the icon. Should be able to avoid the icon param though:

https://github.com/NetSparkleUpdater/NetSparkle/blob/a6bb8e8fb3f480062dd39c629dc6ebc11561fbdc/src/NetSparkle.UI.WinForms.NetFramework/UIFactory.cs#L20-L25

Whitespace: Bah, probably need to be trimming titles and stuff. (itemTitle in the following code is what is getting extra whitespace):

https://github.com/NetSparkleUpdater/NetSparkle/blob/a6bb8e8fb3f480062dd39c629dc6ebc11561fbdc/src/NetSparkle.Tools.AppCastGenerator/Program.cs#L231-L248

Deadpikle commented 3 years ago

@WaseemAlkurdi

The trimming issues with whitespace have been resolved in the most recent version of the AppCastGenerator tool (2.0.3+).

SeanAWalsh commented 3 years ago

Do you still have the invisible button problem?

Deadpikle commented 3 years ago

Do you still have the invisible button problem?

I haven't been able to replicate it. I'm waiting on @WaseemAlkurdi to reply to see if they can still replicate it.

Deadpikle commented 3 years ago

Could it be that the TableLayoutPanel needs to use Dock.Fill rather than anchoring to Top, Bottom, Left, Right?? 🤔

SeanAWalsh commented 3 years ago

I'll try out the new version with my dodgy user and report back