PDA

View Full Version : Regarding Prerequisites



straightwaytech
03-16-2008, 03:29 AM
Hello again,
I have a question and a potential bug I spotted within SetupBuilder in the area of redistrubtable components and pre-requisites.

Firstly, I am wondering if it possible for the SQL Server Express Edition prerequisite check to install a new instance of SQL Server Express if the instance does not exist? The reason I ask this is that I have found that if a instance of SQL Server is already installed on the client computer, my installation will not install a new instance for my application. I need to have the setup I create with SetupBuilder to see if an instance name of SQL Server Express exists and if it doesn't proceed with an install of the instance by that name.

Secondly, I noticed recently that an installation on Windows XP Service Pack 2 without any updates in a virtual machine environment will fail to install the SQL Server Express instance and hence part of the installation will fail. After a couple of hours of tracing the root of the problem down, I have discovered what is causing the problem (bug if you will) and would like to describe it in further detail. Essentially, as you probably already know SQL Server Express requires several pre-requisites before it can be installed including .NET Framework 2.0 and Windows Installer 3.1. Those components I have included in the installer for pre-requisites so in theory all of those components will get installed before the SQL Server Express installation fires up. However, the Windows Installer 3.1 installer fails to install on my base Windows XP with Service Pack 2 machine, which then prevents SQL Server Express from being installed. The problem stems from the version checking that Setupbuilder does when determining whether or not to install Windows Installer 3.1 ; Take a look at this piece of the ScriptLogic code for the Windows Installer 3.1 :
If %MSIVERSION% Version Less Than "3.0" Then
As you can see there is a flaw in this code because if Windows Installer 3.0 is installed, then it won't be upgraded to Windows Installer 3.1, however since SQL Server Express requires at least Windows Installer 3.1, we have a bit of a contradicition that prevents SQL Server Express from being installed on a Windows XP SP2 base system. To correct this problem, please change the above line to :
If %MSIVERSION% Version Less Than "3.1" Then
That way we ensure that the version number is less than 3.1 NOT 3.0.

Anyway, if you could get back to me on the question I posted and the status of the fix to the Windows Installer pre-requisite issue, it would be greatly appreciated.

Regards,

James Simpson
Straightway Technologies Inc.

linder
03-16-2008, 08:55 AM
Hello James,

It should be possible to enumerate (e.g. using the Get Registry SubKey... function) the local registry key "Software\Microsoft\Microsoft SQL Server" to detect installed SQL Server instances.

Does this help?

With regard to the following line:
If %MSIVERSION% Version Less Than "3.0" Then

I think you are absolutely right. It should be:
If %MSIVERSION% Version Less Than "3.1" Then

We'll change this. Thank you for bringing this to our attention.

Friedrich

straightwaytech
03-16-2008, 04:01 PM
Hello again,
I believe that enumerating through the registery is something that I can pull off. I take it that I can use SetupBuilder's built in registry support to access the registry and make these determinations?

Another issue, regarding pre-requisites is that the SetupBuilder scripts for the pre-requisites is located in the Program Files\Lindersoft\SetupBuilder\Include directory. I see two problems with this. First and foremost if I need to tweak the setup script for a particular setup project and for a particular pre-requisite, the change I will make is to the script stored in this global include directory. The problem here is that if each of my setup projects might need different pre-requisite check scripts but since changes made to the pre-requisite checks are global, to my knowledge, then it is possible that a tweak I make in one of the setupbuilder projects will carry through in another supposing I am using. The second issue is that by storing the prerequisite checks in the Program Files directory, any change that I attempt to make will not be carried through unless SetupBuilder is being run as Administrator on Vista.

Sincerely,

James Simpson
Straightway Technologies Inc.

linder
03-17-2008, 01:16 AM
James,

Yes, the "Get Registry SubKey..." is a built-in SetupBuilder function. You can use this to enumerate the registry key.

The Core PreRequisite scripts are located in the Program Files\Lindersoft\SetupBuilder\Include directory so only "administrators" can change it. Core PreRequisites are nothing more or less than include scripts. So you can copy the include script to a "writable" location and change it.

For example, this is the standard include script:

#include script "rt_sql2005expr.sbi" [Custom Configuration]

You can copy the standard include script to your own include script and use it:

#include script "rt_sql2005exp_CHANGED.sbi"

Or even in another folder:

#include script "rt_sql2005exp.sbi" from "c:\test"

If you do not use the "standard" include scripts from the standard Core PreRequisites location, then the checkbox in the Core PreRequisites Visualizer is not checked. That's the only difference beween using a standard Core PreRequisites and your own (modified) Core PreRequisites include script solution.

Does this help?

Friedrich

straightwaytech
03-20-2008, 02:42 AM
My apologies for not getting back so soon. Yes that appears to fix this issue that I am having.

Sincerely,

James Simpson
Straightway Technologies Inc.

linder
03-20-2008, 02:50 AM
Great, thank you James!

Friedrich