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

Add startup check for newer versions #179

Merged
merged 7 commits into from Apr 18, 2018
Merged

Add startup check for newer versions #179

merged 7 commits into from Apr 18, 2018

Conversation

nrocy777
Copy link
Contributor

@nrocy777 nrocy777 commented Mar 7, 2018

Adds a generic filedownloader for pulling other data later
Checks current version against latest tagged release on github
If current version is older, prompt to download the new version
If Download clicked pop the github releases page in default browser

You can test this by hardcoding m_currentVersion in the releasechecker.cpp constructor with a value like 10

Closes #164

@enervey
Copy link
Contributor

enervey commented Mar 8, 2018

I received the following debug output when testing on Windows - Could another Windows user test and see if they get the same thing?

qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
Failed to parse release data from GitHub

@nrocy777
Copy link
Contributor Author

nrocy777 commented Mar 8, 2018

I looked into this and I think it's 'cos windows doesn't have openssl:
http://doc.qt.io/qt-5/windows-requirements.html

Support for Secure Sockets Layer (SSL) communication is provided by the OpenSSL Toolkit, which must be obtained separately. See Secure Sockets Layer (SSL) Classes for instructions on building Qt with SSL support.

@nrocy777
Copy link
Contributor Author

nrocy777 commented Mar 10, 2018

Soo... while this works fine on the mac it's utterly awful on Windows. To get it running at least you can copy the following files from QTDIR/Tools/mingw530_32/opt/bin into your build/debug directory (so they're sitting alongside the built xcite.exe:

libeay32.dll
ssleay32.dll

The problem now is that windows hangs the UI thread while trying to do the network request (which takes an inordinate amount of time in my VM). I'll look into passing it off to a separate thread when I get a second..

@enervey
Copy link
Contributor

enervey commented Mar 10, 2018

@nrocy777 thanks for that workaround - that worked; however I experienced the same very long delay while the UI was blocked during fetching the version. As you mentioned, this probably should not be merged to master until we can get it to make that call on a non-UI thread.

Also what are your thoughts for handling the file dependency issue on Windows? Would we deploy those DLLs (assuming no licensing issues) within the installer once it's available?

@enervey enervey added the work in progress 🚧 This is still being worked on label Mar 10, 2018
@nrocy777
Copy link
Contributor Author

nrocy777 commented Mar 11, 2018

@enervey Yeah agreed, this definitely shouldn't be merged to master yet - thanks for confirming the same your end.

Re: distribution, I think for now we just ship xcite.exe bundled in a zip with the additional DLL dependencies (we won't be able to do anything interesting without https support). Longer term these deps (and QT!) will be shipped with the installer, I believe licensing is more of a concern when you're shipping static builds rather than dynamic.

Could you mark this as 'needs changes' in the review box in the meantime please?

@nrocy777
Copy link
Contributor Author

The fun here continues, seems for MINGW32 builds we need to recompile QT to enable the SSL stuff, while it's linking against the DLLs the support actually doesn't exist in QT. Will update as soon as I have something working (this also affects #145 and the pricing chart so needs resolved for bigger reasons)

Adds a generic filedownloader for pulling other data later
Checks current version against latest tagged release on github
If current version is older, prompt to download the new version
If Download clicked pop the github releases page in default browser

You can test this by hardcoding m_currentVersion in the releasechecker.cpp constructor with a value like 10
@nrocy777
Copy link
Contributor Author

Another update on this one, this seems to work now with the aforementioned SSL libraries in the same directory as xcite.exe. It doesn't seem to hang on startup for me (but I'm currently building QT in the background so it is slow).

@enervey could you give it another try to see how it performs for you locally?

@nrocy777
Copy link
Contributor Author

Now have custom build of Qt with OpenSSL compiled in and have the release check working, despite the download running in another thread it's still lagging out the UI. I'm going to try two things next:

  • Grabbing it via JS
  • Not calling the check from within Component.onComplete

@nrocy777
Copy link
Contributor Author

@enervey could you give this another stab when you get a chance? thx

Copy link
Contributor

@enervey enervey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thank you!

@enervey enervey merged commit ae21110 into master Apr 18, 2018
@enervey enervey deleted the releasecheck branch April 18, 2018 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work in progress 🚧 This is still being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants