Hi, to do this you'll need to go to "Application Settings" in the Origin client (located in the sub menu on the top left, when you click on "Origin"), then clicking on "Installs & Saves" will bring up a menu that will let you choose where to install games. There you can choose D drive. After that, when you install Sims 2 it will be in D drive :)
You can change it back to C drive whenever you'd like.
Also, last year EA made an update forcing everyone to log in to Origin whenever they want to play Sims 2. You don't need to be online to log in to Origin and can ignore any upcoming client updates, so it isn't too annoying, but because of this you'll have to keep Origin installed :/