I think the first (Russia hacked to install Trump) is more likely than the second (Russia successfully hacked US voting machines). I draw this conclusion only because of things I had noticed long before the hacks came to light, mostly Trump's ambiguity regarding his relationship with Putin and Russia from a business point of view. It didn't help his position when he started appointing Russia-friendly cabinet members.
Still, I don't think you can draw a direct line from Trump to Putin regarding the hacks themselves; in other words, Trump didn't order the attacks, he just reaped the benefits.