mrichards42 / xword

Cross-platform crossword solving
https://mrichards42.github.io/xword/
GNU General Public License v3.0
42 stars 13 forks source link

Fails to open .puz file as default app on Windows 11 #212

Closed wanders78746 closed 4 months ago

wanders78746 commented 9 months ago

Version: xword 0.8.0 Platform: Windows 11

When xword is the default app for .puz filetypes, and when a file.puz file is double-clicked to open and play, xword fails to open correctly and disclaims the .puz file. However, when XWord is already open and the .puz file is dragged and dropped onto the open xword app, all works correctly.

jpd236 commented 9 months ago

I don't see any issues myself on Windows 11. I'm not sure exactly what "fails to open correctly and disclaims the .puz file" means.

I probably had to do one-time setup by right clicking a .puz file, going to Open With -> Choose Another App, picking "Choose an app from your PC" from the bottom of that list, and then selecting "C:\Program Files (x86)\XWord\XWord.exe" as the app. Have you done this already?

It would probably be nice to provide the option to associate XWord with supported formats by default - that'd likely be a change to the Windows installer scripts.

wanders78746 commented 9 months ago

Jeff,

Thanks for your prompt reply. Let me explain the failure mode better – I did a poor job of explanation in the original bug report.

0) I assigned the default app for .puz files in exactly the way you described.

1) When I select a .puz file, and either explicitly tell it to open with xword or just double-click (since xword is already the default app), I get the following window:

Untitled

(I neglected to say this in my bug report – mea culpa)

2) Xword is now open. If I drag&drop the .puz file into the open xword window, I repeatedly get the same “Unknown puz version” window error message.

3) HOWEVER, if I now close the xword window and start xword from the Windows Start menu, and I proceed to drag&drop the exact same .puz file onto that window, the file opens normally and all is well.

Note: the .puz file is from the NYTXW, created by the Crossword Scraper extension (V. 1.3.13) for FireFox.

jpd236 commented 9 months ago

Thanks! A few follow-up questions:

I can't think of a major difference in handling between the two methods you used, so my best theory is that:

a) The NYT XWord you scraped depends on something that only newer versions of XWord can handle b) You have two versions of XWord - one that supports the .puz and is linked from your start menu, and one that doesn't and is registered to open .puz files

wanders78746 commented 9 months ago

I have only one version of XWord installed.

I've determined that other, evidently older .puz versions do not display this behavior. I've attached two ,puz files, one that succeeds and one that fails

This still doesn't explain the behavior that XWord can open the (newer?) .puz version when open, while it cannot when invoked as a default program.

puzfiles.zip

jpd236 commented 9 months ago

The newer one is dependent on support for "Across Lite 2.0" files due to use of some special characters (at a glance, the ellipsis in 24A, and the n with a tilde in 26D). Support for this is something recently added to XWord, so it only works in 0.8.0+ and not older versions.

I can really only explain what you're seeing if the version of XWord that launches when you run it from the start menu is 0.8.0+, but the version that opens when you double click is older. When you double click the failing .puz, close the error dialog, and click Help -> About, do you really see 0.8.0 in the version?

If so, about all I can suggest is uninstalling everything related to XWord and reinstalling. Or, as a workaround, when using Crossword Scraper, download the JPZ instead of the PUZ, as XWord should have no problems with that, or disable "Unicode support" in Crossword Scraper's settings page to force it to create older-style PUZ files, using character substitutions where necessary.

wanders78746 commented 9 months ago

Jeff, just to close this out, it turns out I had an old (portable) version of 0.7.0 installed. I removed both versions, reinstalled 0.8.0 (portable), and all works fine. Sorry for the confusion.

jpd236 commented 9 months ago

Great, glad you figured it out!

p.s. if you're using Crossword Scraper to download puzzles just for use in XWord, I'd recommend using the JPZ format instead of PUZ. It has better support for things like background images, shaded squares etc. that the NYT likes to use.