If software says it works on windows xp, then you can get a refund if it doesn't. If you buy it because you want to run it on windows 7, or upgrade from XP to 7 later then you don't have a legal standing. It was fit for the purpose that the seller sold it, whether it was fit for the purpose that the buyer bought it.
However most shops will allow you to return things, just because they don't want bad publicity. Especially if they are selling stuff that doesn't work & you go in when they are really busy and talk very loudly.
Eventually everything will be delivered digitally, you can't even make sure you get to keep that.
You have a choice of what you buy, but everything has a cost & someone has to pay.
@Piru
I've seen you use the term Strawman quite often, could you please explain what it means, it's not something we use this side of the pond... ta

@psxphill
Still can't see the points your trying to make, someone would have to be very dumb indeed if they bought software that clearly states it's for XP only and then tried to return it because the went up to windows 7 or whatever.
Also what this 'shrink wrapped license' you keep mentioning, I can honestly say I've never came across such a thing, care to enlighten me...

How on earth are they going to deliver my cornflakes digitally, or are Star Trek replicators available now, and if so where do I buy one or do I need a licence.
