This script is based on latest download from the Sample database for SQL Server 2008 R2. The original download from the sample is approx 84 MB and I extract only AdventureWorksLT2008R2 database from it and provide to you here.
If you want full AdventureWorks2008R2 database then please download it from the sample database website or contact me if you need it in SQL Script as well.
I tested it on my system running instance of MS SQL Server 2008 R2 Express with Advanced Services and it worked, I hope It will run on any edition.
Please open the downloaded sql script file using SQL Server Management Studio and change the database data/log file path if you want and enable SQLCMD Mode from Query menu before execute it.
Hope this works!