Oh software is definitely an important factor of the equation bit o think it's also a bit of a chicken and the egg style conundrum. I feel as though software support is a natural product of strong HW sales. When you look at the software support for the Wii and when it started falter it's clear that software declined as the sales fell. A similar arguement can be made for other systems as well. I'm of the mind that the increase in sales that would've accompanied regular price cuts would have led to continued software support for the 360 and PS3. Obviously I can't prove causation here with sales leading to software support butI do think the data suggests a strong correlation between the two it's just a matter of which you think is the driving factor. I believe it's HW sales and you believe it's Software sales. I believe it's the egg and you believe it's the chicken so to speak. We have no way of saying conclusively either way.
While the causal agent is not immediately clear—does strong software support drive hardware sales or do strong hardware sales drive strong software support?—I think there are several lines of evidence to suggest that games are the driver of hardware sales and not vice versa. The most obvious example is the existence of system-sellers. While most games have no visible effect on sales, some games end up giving boosts to hardware sales, sometimes significant. This is most obvious in Japan, where sales are tracked weekly instead of monthly (with monthly tracking, the effects of more modest system-sellers in one week may not be obvious when "washed out" by adding 3-4 more weeks of sales into the sales period). Some games end up moving many thousands of additional hardware units. In the U.S., Destiny is so far the biggest system-seller this generation, with hardware sales of the PS4 and, to a lesser extent, the XBO experiencing a massive increase in September 2014. Some of the biggest system-sellers last generation were Halo 3, MGS4, MK Wii, and Smash, all of which caused pronounced effects on sales the month they were released (in fact, Mario Kart and Smash may have had sustained effects for a while, as sales remained steady and high for several months after their release; this is not certain, however). Two generations previous, Final Fantasy VII established itself as perhaps the biggest system-seller in U.S. history. PS1 sales early in its life were very sluggish, and even two rounds of price cuts didn't make it a best-seller (the N64 was the overall market leader for the Sept. '96 - Aug. '97 period), but when FFVII was released, there was an immediate spike in sales, and from then on the PS1 dominated the hardware sales charts in the U.S. That one game drew in a ton of people on its own, plus it threw open the gates on the PS1, showing millions of others that it had more to offer than the N64 in terms of sheer volume of games.
Furthermore, third-party developers tend to put their biggest and best games on platforms most conducive to developing the kind of games they wanted, regardless of sales. As mentioned earlier, the PS1 was doing terribly in terms of sales early in its life, yet the simple fact that it used CDs, which were cheaper and had more data capacity than the cartridges of the era, was enough on its own to garner the lion's share of third-party support. PlayStatio wan an untested brand, and publishers had no idea the PS1 was going to be successful later on. When the N64 was released in the U.S. to sales figures that were overall better than the PS1's, that did not guarantee the N64 better support from third parties, not even Western ones. Big Western games like Crash (ND was third-party at the time), Tomb Raider, and Driver, as well as a ton of Japanese games, never made it to the system, and Nintendo and Rare were the ones responsible for the majority of the major titles on the system. While the N64 was not devoid of third-party games by any stretch, the PS1 still had most of the biggest and best third-party games, and in the beginning that had nothing to do with sales and everything to do with CDs being a better format than cartridges in every way except load times and durability. While its effects weren't immediate, at least not in the U.S., the PS1's vastly larger library drove it to be the better-selling system.
The Wii was in some ways the reverse situation from the PS1. It was a beast in the sales department for the first several years of its life, being the #1 system in the U.S. from 2007 to 2010, yet most third parties saw it as little more than a dumping ground for shovelware. While a few third-party series did well on the system, most notably Just Dance, it was still up to Nintendo to do most of the heavy lifting in regards to major software releases. While the Wii had a weaker library than the 360 and PS3, the games it had were good enough to support it (I think the Wii succeeded more through being very affordable compared to the competition, having a good gimmick to make up for the lack of AAA support, and having the right marketing to sell Nintendo's vision of new ways to play games; games alone are not the sole factor determining a system's success). By 2011 Nintendo had largely ceased to provide any meaningful support for the system, having already put most of their efforts into developing games for the Wii U. That combined with not a whole lot worth getting from third parties caused Wii sales to drop massively. While it already passed its peak in 2010, that was still its third-best year overall with 7 million units sold, but sales in 2011 were down even more, declining by a whopping 36% YoY, losing to the 360 and effectively tying the PS3 that year. Overall, sales in 2011 were less than half of what they were in 2009, this despite having not been replaced yet. That's an insanely fast decline by historical standards. Its declining sales accelerated once the Wii U came out, with sales in 2012 being down 56% YoY. By that point, it was obvious that the Wii was not going to be supported anymore, so people stopped buying them in large numbers.
Speaking of Nintendo in general, it's likely no coincidence that their consoles having poor legs wasn't an issue until they started having problem with third-party support. The NES and SNES had strong legs and strong long-term third-party support (and even modest first-party support), but the N64, GC, and Wii had neither (and neither will the Wii U). The N64 having a more rapid drop-off than the SNES despite overall better sales for its first few years only makes sense when you implicate its vastly inferior late-life software support.
TL;DR version: There is a clear correlation between lack of long-term software support and more rapid declines in hardware sales. It's obvious from historical evidence that A) there's a lot of individual games that boost hardware sales, B) that strong hardware sales do not necessarily guarantee strong software support from third parties (and, on at least one occasion, weak hardware sales did not discourage strong software support), and C) we have the historical example of Nintendo systems having strong legs when they had the full backing of third parties, but having weak legs when third parties put most of their efforts on PlayStation systems (and also Xbox later on). Therefore, it seems that software is the driver of hardware sales, and not strong hardware sales being the driver of strong software support.