OptiKey icon indicating copy to clipboard operation
OptiKey copied to clipboard

Consider presage upgrade path for v4

Open kmcnaught opened this issue 3 years ago • 4 comments

Optikey v4 will be a 64 bit application, so users who have set up presage will need to upgrade to a 64 bit version

We will need to

  • ensure documentation updated to reflect this, and to point at the correct 64-bit version to install
  • test the presage upgrade path, can users keep their existing database/model?
  • test the optikey upgrade path - if someone is set up to use 32 bit presage, make sure Optikey doesn't crash, gives a helpful error and falls back to another prediction method (or none)

kmcnaught avatar Oct 05 '22 10:10 kmcnaught

See PresageInstallationProblemsDetected - update to also check application bitness and give appropriate warning/log.

kmcnaught avatar Jan 06 '23 15:01 kmcnaught

@JuliusSweetland I was just looking at the previous checks for Presage install, and I found this suspicious looking if statement. I just wanted to sanity check it before ripping it out, in case I'm confused.

https://github.com/OptiKey/OptiKey/blob/c599992402e688e6f1f35e4a0d0acf42692b7d56/src/JuliusSweetland.OptiKey.Core/OptiKeyApp.cs#L200-L202

I believe the logic was intended to be "if the Presage install doesn't match the OS bitness then report a problem" but the checks in the if statement are the wrong way round, correct?

I think the logic should be "if the Presage install doesn't match the process bitness then report a problem".

I believe that if someone tried to run Optikey (classic) on a 32 bit machine, it would refuse to load Presage. The fact that most users have a 64 OS (running a 32 bit Optikey) means we've not hit this bug.

If you agree with my reading of the situation, I will fix this in master as well as upgrading the logic in v4

kmcnaught avatar Jan 16 '23 12:01 kmcnaught

I think those lines are correct and are testing the install location as a proxy for whether the user has presage 32 bit installed. On a 32 bit os the location will be "program files", while on a 64 bit os it will be "program files x86". Either test would fail if passage x64 was installed (although I'm not convinced it would be possible to install that on a 32 bit operating system).

On Mon, 16 Jan 2023, 12:46 kmcnaught, @.***> wrote:

@JuliusSweetland https://github.com/JuliusSweetland I was just looking at the previous checks for Presage install, and I found this suspicious looking if statement. I just wanted to sanity check it before ripping it out, in case I'm confused.

https://github.com/OptiKey/OptiKey/blob/c599992402e688e6f1f35e4a0d0acf42692b7d56/src/JuliusSweetland.OptiKey.Core/OptiKeyApp.cs#L200-L202

I believe the logic was intended to be "if the Presage install doesn't match the OS bitness then report a problem" but the checks in the if statement are the wrong way round, correct?

I think the logic should be "if the Presage install doesn't match the process bitness then report a problem".

I believe that if someone tried to run Optikey (classic) on a 32 bit machine, it would refuse to load Presage. The fact that most users have a 64 OS (running a 32 bit Optikey) means we've not hit this bug.

If you agree with my reading of the situation, I will fix this in master as well as upgrading the logic in v4

— Reply to this email directly, view it on GitHub https://github.com/OptiKey/OptiKey/issues/867#issuecomment-1384005970, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEA7AL7KIUB4WP4SAXBFPLWSU7KDANCNFSM6AAAAAAQ5OXZ6Q . You are receiving this because you were mentioned.Message ID: @.***>

JuliusSweetland avatar Jan 16 '23 19:01 JuliusSweetland

Oh I see, these checks implicitly assume that it's a 32 bit version of presage installed. Since I have a 64 bit OS I get 32 bit programs installed in Program Files (x86) and 64 bit ones in Program Files so I thought it was a proxy for which (32/64) Presage version was installed. I hadn't realised 32 bit Windows only had Program Files although it makes sense in retrospect! What a confusing naming system!

We will need to check OS bitness and process bitness against install location to check for compatibility now that Optikey can be a 32 or 64 bit process

kmcnaught avatar Jan 17 '23 08:01 kmcnaught