Windows version autodetection

Reece Dunn msclrhd at googlemail.com
Sun Dec 21 04:29:58 CST 2008


2008/12/21 Damjan Jovanovic <damjan.jov at gmail.com>:
> On Sun, Dec 21, 2008 at 11:49 AM, Reece Dunn <msclrhd at googlemail.com> wrote:
>> 2008/12/21 Damjan Jovanovic <damjan.jov at gmail.com>:
>> You can change the version of Windows reported for different
>> applications, and the default version using winecfg -> Applications.
>
> I know, but bugs coming up from the wrong default version aren't
> always obvious (in my case they were registry keys that don't get
> created during installation).

This is where having people contributing to AppDB would be useful.
They would know what version of Windows being reported by Wine would
work best - even when that changes in the future. This will take some
experimentation, but after some investigation it can be figured out.

>> I'm not sure that adding heuristics would be the correct approach, as
>> those can lead to incorrect results. The winecfg option supports the
>> user being able to change the version of Windows reported for the
>> specified application. The workflow could be better, though (e.g.
>> supporting an option on an exe's right-click menu).
>
> Heuristics aren't necessarily wrong:
>
> File Header
>  Machine:                      014C (i386)
>  Number of Sections:           6
>  TimeDateStamp:                31104C75 (Thu Feb  1 07:15:33 1996) offset 136
>
> Feb 1 1996 can't be later than Windows 95.

Sure. But what if an application was shipped after Vista or Windows
Server 2008, but only worked on XP and earlier. Your detection would
not work here.

Also, what if an application supported XP, but crashed on Wine as it
was using some unimplemented call in GDI+. Setting it to Windows 2000,
the application works fine.

These two cases are where your simple heuristic will break
(TimeDateStamp ==> Windows version).

>> What would be better is to have AppDB keep track of what version of
>> Windows works best with a particular application. This could then be
>> queried on install of the application, or downloaded in bulk. It would
>> be easy to take the data and create a registry file like what winecfg
>> will be saving to. That way, AppDB becomes the place where this is
>> maintained (so it is up to the individual maintainers to set the
>> Windows version if it doesn't work with the default version) and there
>> are no ugly heuristics involved.
>
> The bulk download would only work if you install applications to their
> default location, but it seems like a good idea.

IIUC, Wine goes by the executable name (e.g. notepad.exe) and not
where the application is installed to. The only problems I can see
with this is in different versions of applications requiring different
reported versions of Windows and any name clashes (if any).

- Reece



More information about the wine-devel mailing list