Page 1 of 1

How to Require XP Sp3 or higher?

Posted: Wed Jul 14, 2010 9:35 am
by JohnGalt
Now that MS isn't supporting anything less we want to make sure that the person as SP3 installed and give a message to download and install it first. How do I get it to test for requiring XP SP3 or later? (i.e. XP SP3, Vista SP1, Windows 7, Windows 2003 SP2, Windows 2008 Server SP1 and Windows 2008 R2 are the most recent and I'd like to require them)

Thanks!

Re: How to Require XP Sp3 or higher?

Posted: Wed Jul 14, 2010 7:03 pm
by mills
Using the Product Details in the Design editor, you can only specify the OS version, but not service pack level.

To check for XP SP3 or greater, the following MSIcode sample would do the trick:

Code: Select all

Set Variable MIN_OS to FALSE
Comment: Test if OS is XP or newer
Get System Setting Windows XP into MIN_OS
if Variable MIN_OS Equals TRUE
 Comment: If OS is XP or newer, test if SP 3 or better
 Get System Setting Service Pack 3 into MIN_OS
end
if Variable MIN_OS Equals TRUE
 MessageBox: Minimum Requirements, The OS is at least Windows XP SP 3!
 <replace with: perform install>
 else
 MessageBox: Minimum Requirements, Your system must be using Windows XP SP3 or newer!
 <replace with: terminate>
end

Re: How to Require XP Sp3 or higher?

Posted: Thu Jul 15, 2010 8:56 am
by JohnGalt
Thanks!

Re: How to Require XP Sp3 or higher?

Posted: Fri Jul 16, 2010 2:49 pm
by mills
My last post was found to contain a logic error. Since it would check for a minimum service pack of 3 for any OS running XP or newer, newer OS checks would fail, since most are not up to SP 3.

Here's a revised version. I'm just including IA clipboard data so you can just copy it into IA and make your lives a little easier.

Code: Select all

~InstallAware Clipboard Data~
~End~
~{F4E2825E-7783-4F8C-8BB6-E7106DF3274D}~
~MessageBox~
~{0876C3EE-C911-42A3-B04D-F24AD1B42761}~
~Minimum Requirements~
~Your system must be using Windows XP SP3 or newer!~
~0~
~1~
~~
~Else~
~{9D8A57DB-E8B9-415C-B46E-0AF4FF365057}~
~MessageBox~
~{2E599380-C5F4-41CC-B8C2-B9315C958041}~
~Minimum Requirements~
~The OS is at least Windows XP SP 3!~
~0~
~1~
~~
~If~
~{7FB2DAD1-30D6-4713-803A-7BF3BE7E9F5A}~
~MIN_OS~
~0~
~TRUE~
~FALSE~
~Comment~
~{D946E8EB-88BF-4304-8E8B-01443B1998E6}~
~~
~End~
~{81CB4A79-1141-439E-966D-DBAF0F8936AA}~
~Comment~
~{1B56A2E2-0EFB-4C18-A942-B402F6300B97}~
~Otherwise, we don't need to check for Service Packs (at this time)~
~End~
~{454E8651-8B96-4383-A9FD-6ECFD3DE81A7}~
~Get System Settings~
~{6F09B5DE-4C14-4E75-AD93-4F9646720B17}~
~MIN_OS~
~29~
~If~
~{09CBD2A4-41F1-4223-8A81-69C1AC8FF402}~
~OS~
~0~
~XP~
~FALSE~
~Comment~
~{3AD05C97-57B1-4AF8-9253-7E071B8D1ED6}~
~If OS is XP or newer, test if SP 3 or better~
~If~
~{4DCC40FD-A7B3-4E28-B08E-72FF60FA209D}~
~MIN_OS~
~0~
~TRUE~
~FALSE~
~Get System Settings~
~{12D80269-4978-4BF4-97D5-119689885B49}~
~MIN_OS~
~25~
~Comment~
~{8AB961DF-3408-422E-B6A9-74C1585B4AA9}~
~Test if OS is XP or newer~
~Set Variable~
~{1E717801-2B46-44C2-A610-826E4BF5DAEA}~
~MIN_OS$MYAH$MYAH$FALSE~
~FALSE~
~Comment~
~{4EA20084-7152-4144-8828-12A0505C018E}~
~~
~MessageBox~
~{4B46643F-0021-4698-95A1-A245DCCCAB5D}~
~OS/SP levels~
~The current OS running is $OS$ with Service Pack $SP$~
~0~
~1~
~~
~Get OS or SP Level~
~{CCA94485-54B6-4E73-B466-1C82697DAF0C}~
~SP~
~FALSE~
~TRUE~
~Get OS or SP Level~
~{25C9512B-A2EB-41D9-9BF6-F8788F5EE6C5}~
~OS~
~TRUE~
~FALSE~
~Set Variable~
~{3A1B68F4-22C1-48FA-913C-99D6B6729D96}~
~SP$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{AC79C28D-D5B9-4639-9B89-5DAFE6B717B3}~
~OS$MYAH$MYAH$FALSE~
~~

Re: How to Require XP Sp3 or higher?

Posted: Thu Sep 09, 2010 3:29 pm
by jamesish
Hi Andy,

I'd love to look at the MSICode you'd posted above, but what you posted is a copy/paste, not a "copy as text" and paste. Could you repost it as a "copy as text" and then paste, so I can more easily read it? :D

Thanks!

James

Re: How to Require XP Sp3 or higher?

Posted: Thu Sep 09, 2010 7:48 pm
by mills
I figured it would be easier to have you copy that and paste it into a blank project (since the forum doesn't support indentation and colorization).