Thursday, December 30, 2010

Inno Setup script for dl&install .NET 4.0, VC++2010, SQL Express 2008 R2

Today I scribbled in a few Inno Setup scripts, after helping a friend getting his .NET 4.0 and VC++ 2010 runtimes installed with his new app.
I started at the ISXKB, a huge resource on Inno Setup knowledge and sample scripts, but the holy grail wasn't there. Nearest is this page though, and there are also a couple of links to external script sources. This post will be added there, I guess...
As there's no suitable, ready-made, working sample available, I started with the (nicely modular) scripts of stfx @ CodeProject. There are quite a few updates and improvements hidden in the comments at the end of the page, that I missed at first ofcourse, so I had to update my changes again. That's one of the reasons we will never get out of work in IT, changes, changes...

The zipped-up results can be grabbed here. Update: A newer release is available here (plz e-mail me if the link dies)

Notable differences:
+ (module) .NET 4.0 download & install for either/both Client and Full profile (using the web-installer, so no Language-pack hassle, it automagically gets the right localizations)
+ (module) VC++ 2010 runtime, downloading and installing both the x86 and x64 redistributables on x64 OS's
+ (module) SQL Server 2008 R2 Express for either x86 or x64 OS's. If SQL Server 2005 Express is already installed, nothing happens, that needs a manual upgrade or parallel install
* (update) SQL Server 2005 SP3, as the original extra module (suggested in the comments) couldn't install the RTM package on Vista or later
* (update) Restructure of the example setup.iss, so a single #define enables a feature
! (bugfix) Blocking the install if a non-privileged user runs the setup without using 'Run as Administrator', and one of the prerequisites needs to be installed. This enables PrivilegesRequired=none capable application-installations if all prerequisites are met.
* (feature) Rebooting at the end of the install if installation of a prerequisite requests a delayed reboot (MSI returncode 3010)

Any comments are welcome.


/Ton

4 comments:

Kimadi said...

I just want to say I really appreciate all the work you've put into that installer for me. Kudos!

Markus Schebsdat said...

Whow, I understand only a little of this setup. Very nice and thanks.

I had a problem to install SQL Express 2008. So I spend some hours :) and find that I have to change
/FEATURES=ALL into
/FEATURES=SQLEngine

Thanks again
Markus

bshea said...

Thanks for putting this all together. Very nice work.

gpgemini said...

Thank you so much for this post !!
Saved me probably tons of hours.

At first it didn't work for me, after comparing to your setup.iss I found this only works if DisableReadyPage=false.

Guy.