The Sidewinder must first have a lock on, to the target that is controlled by the pilot. Once he has lock on the following takes place;
Pre arming; Themissile receives warmup voltage through its umbilical cable while attached tothe aircraft launcher. When the firing mechanism in the aircraft is actuatedby the pilot (target lock on), an electric pulse through the umbilical cable initiates thegas generator in the GCS, or thermal battery, providing power to control themissile. As missile power assumes control, a relay is closed. This allows aircraftpower to be supplied through the relay to the firing contact buttons on theforward launching lug. Electrical power through the forward button initiates thethermal battery in the TDD and, through the aft button, initiates the rocket motorigniter. As the missile leaves the launcher, the umbilical cable and block breakoff. This removes a short from the GCS, allowing voltage to go to the contactfuze/S&A device.
Now each model of the Sidewinder is slightly different so the above is not true with say the most modern models. But they all must have lock on, that is controlled by the pilot to then activates the missile fuze, and then the pilot must send another command to fire the missile, which completes the arming and guidance sequence. A look in a couple USAF TO's on the missile also says the missile can not be fired without lock on. Though there have been incidents where the missile fired by accident due to EMR or static, but that was years ago.
The same USAF TO talks about heat signatures, gets complicated but basically the missile does not see lower heat signature like a car motor or a tank engine. The heat from an aircraft engine is a much high heat, and when IR decoys are deployed they are a greater heat source then the aircraft - so the missile can be diverted to them.
The Sidewinder range is classified, but in two of the accidental firings they were reported to have gone close to 1 mile and half, and in pretty much a straight line. This straight line was because of the ballistic of the missile and since no firing command was given to the fuze or the missile motor, non of the hot gas generators could function to control the vanes/fins. Basically they flew just like a 2.75" rocket, but because the missile motor was so much stronger then a 2.75 that accounted for the straight flight.
I have searched very hard to find the story about a sidewinder hitting a tank, but have not located it. So if anyone has a link to that story please post it. I'll forward it to the USAF munitions guys I know for comment.