Question to Windows users

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

User avatar
hgm
Posts: 27701
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question to Windows users

Post by hgm »

Strange thing is that the browse and 'Always open with' approach works without problems on my Win2k system. It even improvises a recognizable icon for the file type:

Image

After browsing to winboard.exe, WinBoard also appears as one of the choices in the list with applications. On my WinXP, however, any results of the browsing are completely ignored. Perhaps it is some sort of security problem.

Using the assoc and ftyp commands from the command line as you suggested does work on XP, and after that, 'Open width' on the file does show WinBoard as possible choice. But on file types not yet associated with WinBoard, it still won't appear amongst the choices, and adding it by browsing is still not possible. Not even for a winboard.exe I moved to the Program Files subtree.
bnemias
Posts: 373
Joined: Thu Aug 14, 2008 3:21 am
Location: Albuquerque, NM

Re: Question to Windows users

Post by bnemias »

hgm wrote:Strange thing is that the browse and 'Always open with' approach works without problems on my Win2k system. It even improvises a recognizable icon for the file type:

Image

After browsing to winboard.exe, WinBoard also appears as one of the choices in the list with applications. On my WinXP, however, any results of the browsing are completely ignored. Perhaps it is some sort of security problem.

Using the assoc and ftyp commands from the command line as you suggested does work on XP, and after that, 'Open width' on the file does show WinBoard as possible choice. But on file types not yet associated with WinBoard, it still won't appear amongst the choices, and adding it by browsing is still not possible. Not even for a winboard.exe I moved to the Program Files subtree.
MS has changed association interfaces multiple times. Unless you keep up with the latest changes they make, how this works can seem mysterious.

Fortunately, the registry settings that cause associations still work well. So, once you generate associations from your installer program, all should be fine. I assume that's ultimately what you would do, so the only irritating part is testing new associations yourself. Not worth the legwork, IMO.
User avatar
hgm
Posts: 27701
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question to Windows users

Post by hgm »

Well, the whole matter came up because some people as a matter of principle do not want to run installers, and whether it would be possible to provide a 'portable version', that would not lose too much functionality. Clicking a PGN, FEN, or TRN file once to select 'Open with', and ticking 'Always open this type of file with this application' seemed an acceptable effort even for non-experts, which they might even figure out without reading any docs.

Of course it could be argued that people who experience problems with this, have brought those onto themselves...

But I have made WinBoard now such that a lone filename argument is distinguished by extension, and is interpreted as -lgf, -lpf, -tf or @ argument, depending on this. The latter effectively making settings files into portable shortcuts for running WinBoard in a certain mode. The use of an implied game or position file furthermore processes the persistent string option -viewerOptions as if it was part of the command line (with default value containing -ncp, to suppress the startup dialog), while the use of an implied tourney file would similarly insert -tourneyOptions (containing -mm to auto-start the tourney) into the command line.

This brings game-viewer and tourney mode on par with loading an engine, where there can also be a number of WB options be included with the engine line in the -firstChessProgramNames list. So in a sense the -viewerOptions and -tourneyOptions are the equivalents of the engine line for selecting no engine, or tourney mode.

People could use these options to configure, for instance, viewer mode such that their favorite analysis engine is loaded with WinBoard when they click a PGN or FEN file, or let tourney-helpers start in -noGUI mode.
User avatar
hgm
Posts: 27701
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question to Windows users

Post by hgm »

BTW, is it possible in Windows to generate an "application.exe document" command by dragging the icon of the document on top of the icon of the applicaton? Or is that a Mac-only thing?
rreagan
Posts: 102
Joined: Sun Sep 09, 2007 6:32 am

Re: Question to Windows users

Post by rreagan »

hgm wrote:BTW, is it possible in Windows to generate an "application.exe document" command by dragging the icon of the document on top of the icon of the applicaton? Or is that a Mac-only thing?
If you drag a file and drop it on an executable, it will run the executable with the file as the first argument. Like: application.exe file.txt
User avatar
hgm
Posts: 27701
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question to Windows users

Post by hgm »

That is what I thought. But on my Win XP absolutely nothing happens when I do this. Do you have to change certain settings to enable this behavior? Or is my Win XP just broken?

It would be extremely convenient if all the .xsf settings files could simply be dragged on the winboard.exe icon. E.g. dragging FICS.xsf onto it would connect you with FICS, etc. No file associations would be needed at all, you could just drag PGN, FEN, TRN and XSF/INI files on top of the exe.

Perhaps it should even be possible to drag engine executables onto winboard.exe, to start WinBoard with the engine. (But: engine executables are usually in their own folder, which makes this more clumsy. And how could it know if it was UCI or WB?)
rreagan
Posts: 102
Joined: Sun Sep 09, 2007 6:32 am

Re: Question to Windows users

Post by rreagan »

I'm on Windows 7, but I tested it and I do not have to do anything for it to work. I wrote a program to just print the contents of argv, and drag and drop the source file, and I get this:

Code: Select all

argv[0] = C:\Temp\a.exe
argv[1] = C:\Temp\test.cpp
However there are some registry entries that control this. See the link below for an example. It's possible your HKEY_CLASSES_ROOT\.exe or HKEY_CLASSES_ROOT\exefile were changed at some point. Especially if you ever had a virus, it may have changed those registry keys. Unfortunately, if you're on XP, there's a decent chance you have had or still have a malware infection.

http://answers.microsoft.com/en-us/wind ... b59d82b188

There are lots of Google results describing how to repair that registry key, such as this one:

http://jaredheinrichs.com/how-to-fix-wi ... files.html