Coffeehouse Thread

12 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

The Service Pack string

Back to Forum: Coffeehouse
  • User profile image
    W3bbo

    About 9 months ago I was working on a piece of software that needed to know the Service Pack level of the computer, however the Environment.ServicePack property is a string, not a number.

     

    So I wrote a simple method that extracted the number, assuming the string was always english (since it was English in German and Spanish Windows, I assumed the same for all the others). Then users of Polish Windows complained my software wasn't working for them, and then a few others.

     

    I got them to send me detailed error reports and apparently on Polish Windows you get "Dodatek Service Pack 3", wtflol.

     

    That was 8 months ago.

     

    My software sends anonymous usage statistics back to Mission Control and I've been looking at some of the data, this weirds me out:

     

    Generic Forum Image

     

    So clearly the majority of systems have the english string name, including non-English OSes (in fact, the English SKU users of my software are in the minority, it's really popular in Brazil and Spain apparently). However Polish Windows is the exception with its "Dodatek" string.

     

    ...but what's all this with the "Service Pack 3# v.nnnn" strings? What are these service packs and how come they have this number?

     

    Also, what language is "Szervizcsomag" ?

     

    Given that OSVersion.ServicePack is a public API it isn't documented well nor is any message given telling us to expect unusual strings. I'll state that I'm not aware of any other good way to get the SP level of an OS.

  • User profile image
    Sven Groot

    Maybe the strings with build numbers after them are beta versions of the service pack? Would make sense I think.

  • User profile image
    Royal​Schrubber

    If it's any use - dodatek means addition/add-on and szervizcsomag is hungarian for service pack. Recognised it by postfix -mag, every third word has it, also sz combo is prominent in hungarian language. I've finally put watching that weekly hungarian minority TV programme to good use. Smiley

     

    EDIT: Hmm, pic is kinda strange because dodatek isn't hungarian word (it has slavic origin), perhaps user is hungarian living in poland or vice versa..

  • User profile image
    Bass

    Nice chart you have there. Smiley

  • User profile image
    Minh

    RoyalSchrubber said:

    If it's any use - dodatek means addition/add-on and szervizcsomag is hungarian for service pack. Recognised it by postfix -mag, every third word has it, also sz combo is prominent in hungarian language. I've finally put watching that weekly hungarian minority TV programme to good use. Smiley

     

    EDIT: Hmm, pic is kinda strange because dodatek isn't hungarian word (it has slavic origin), perhaps user is hungarian living in poland or vice versa..

    Isn't "sz" Hungarian notation for null-terminated string? Smiley

  • User profile image
    Maddus Mattus

    Maybe set the current culture to EN-US before reading the service pack version?

  • User profile image
    W3bbo

    Maddus Mattus said:

    Maybe set the current culture to EN-US before reading the service pack version?

    I can't see how that would have an effect on the string returned.

  • User profile image
    cheong

    Of course you could always P/Invoke to call GetVersionEx(). the wServicePackMajor is numeric value you could use.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    Maddus Mattus

    W3bbo said:
    Maddus Mattus said:
    *snip*

    I can't see how that would have an effect on the string returned.

    Maybe, like the calendar, it checks the input locale to see what language to return the name of the service pack in.

  • User profile image
    Sven Groot

    Maddus Mattus said:
    W3bbo said:
    *snip*

    Maybe, like the calendar, it checks the input locale to see what language to return the name of the service pack in.

    The Environment.OSVersion.ServicePack property just returns the string returned in szCSDVersion when calling GetVersionEx. It pays no attention to the .Net culture settings.

  • User profile image
    spivonious

    Maybe the numbered ones are OEM builds?

  • User profile image
    rhm

    Minh said:
    RoyalSchrubber said:
    *snip*

    Isn't "sz" Hungarian notation for null-terminated string? Smiley

    WIN!

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.