Omega World Travel, Inc. v. Mummagraphics, Inc., 469 F.3d 348 (4th Cir. 2006)
When you download programs - particularly freeware, or peer-to-peer sharing programs.
More covertly, spyware can install itself just by you visiting certain sites, by prompting you to download an application to see the site properly.
ActiveX controls. These pesky spyware makers will prompt you to install themselves while using your Internet browser