The Russians were actually invited in by the Afghan government of the day, following a pretty bloody coup. This proved a slight mistake from the point of that government, since they subsequently decided to overthrow that government and install one they preferred. (Rather analogous to some of the stuff the Americans pulled in Vietnam.)
As for "invited in by the Afghan Government in exile" - there is always liable to be a government in exile handy anytime it's seen as necessary to invade a country.
There are lots of differences between the Soviet-Afghan War and the current one. But an awful lot of similarities as well. And I expect the final outcome (insofar as any outcome is ever "final") is likely to be towards the similar end of the spectrum.
In 1989, the Russians pulled out, leaving a "friendly" government in in Kabul, supposedly able to see off the mujahideen. Before too long that government fell, and the mujahideen called it victory. The fighting continued, and eventually someone came out on top, and imposed a strong-arm regime - the Taliban as it happened. I don't imagine things will go all that differently this time round.