The 28-year-old arrives at the Keepmoat Stadium after scoring 22 goals last year to help his former club reach the play-off final where they lost out to Preston North End.
Rovers manager Paul Dickov said Williams’ signing was a signal of intent for the Sky Bet League One season ahead.
He told Sky Sports News HQ: “He’s a player who has been on our radar for a long time and there was a lot of interest in him so we are delighted to get him over the line.
“He is a proven goalscorer, got fantastic movement, very composed in front of goal and I think it is a signal of our intent for what we want to do next year.”
Dickov was delighted to land Williams given that there was a great deal of interest in the striker.
He became Rovers second signing in a week after Thorsten Stuckmann joined Dickov’s side and the manager said they would be important players in their challenge next season.
“There was interest, as you would expect – he was on a free transfer. A very good player, scored a lot of goals and there was a lot of clubs in for him so we are delighted to have him.
“He will complement the players we’ve got here and the strikers which was also important. In our recruitment process we want to sign players who know how to get into the top six but also know how to stay in there as well.
“They have both done that throughout their careers and they are both experienced enough and it always helps when they are good players.”
The former Bristol Rovers striker said he was in no doubt over signing at Doncaster, adding that Dickov was a major factor in his decision.
He added: “I’m very happy. It has been a long summer so far so I’m looking forward to getting it all done and dusted today and then getting out on the training pitch in a few weeks’ time.
“There was a bit of interest in me but this was my choice and I was blown away when I came up here.
“Everything I wanted from the football club they had here and the gaffer seemed to really appreciate me and really like me and that was a major factor in me coming here.”
Williams is keen to make amends for the way his season ended last year when Swindon went down 4-0 to Preston at Wembley in the play-off final. Now he is hoping to go one further with his new club.
He said: “Unfortunately for me that was a day to forget and this season could be a lot better if we could just go one step further and get promoted to the Championship.”