I don't think there's a standard way to check whether the application runs on a laptop, but I think there's also no standard rationale for needing to know this.
The point is also that a laptop is no so much different from a desktop: there are laptops that get never moved, and I guess it would be possible to build a desktop with an embedded UPS (seen as a battery?)
I think you should find out if it's a laptop using the features you need to check in a laptop:
Do you want to know if it's a laptop because your application needs to behave differently if the computer may be moved around? Then check if it has got a battery plugged in.
Do you want to know if it's a laptop in order to see whether hardware can be modified? In this case check the motherboard model or ask with a dialog box.
Do you need to check it in order to know if it will burn to death if used too intensively for too long? Just monitor the temperature...