Andrew,
I had a simmilar requirement for a project last year. There are plenty
of versions of mmc.exe, but after checking what ships with the builds in
KB907265 and whats included in 2K3 R2 - I found that you have MMC3 if
mmc.exe has a version > 5.2.3790.2611
We also had a requirement to installed MMC3 if it was not already
installed, I've tried to include the relevant fragments below:
Essentally we used FileSearches to set some properties if MMC3 is
installed, and also if mmcperf.exe exists (and then run it)
<Property Id="MMC30INSTALLED">
<DirectorySearch Id="SystemFolderPath" Path="[SystemFolder]">
<FileSearch Name="mmc.exe" MinVersion="5.2.3790.2611" />
</DirectorySearch>
</Property>
<Property Id="MMCPERF">
<DirectorySearch Id="SystemFolderPath2" Path="[SystemFolder]">
<FileSearch Name="mmcperf.exe" />
</DirectorySearch>
</Property>
We also included the Microsoft KB packages to install MMC3 on XP and 2K3
(if not already present) in our installer (this was a customer request).
So we had some custom actions to invoke the correct installer if MMC3
was'nt already installed.
<!-- Custom Actions to install MMC 3.0 for Windows XP SP2 -->
<CustomAction Id="wxp.kb907265.setproperty"
Property="wxp.kb907265.install"
Value='"[TempFolder]\WindowsXP-KB907265-x86-ENU.exe" /quiet /norestart
/log:"[TempFolder]\WindowsXP-KB907265-x86-ENU.log"' />
<CustomAction Id="wxp.kb907265.install" BinaryKey="WixCA"
DllEntry="CAQuietExec" Execute="deferred" Return="check" />
<!-- Custom Actions to install MMC 3.0 for Windows 2003 -->
<CustomAction Id="wk3.kb907265.setproperty"
Property="wk3.kb907265.install"
Value='"[TempFolder]\WindowsServer2003-KB907265-x86-ENU.exe" /quiet
/norestart /log:"[TempFolder]\WindowsServer2003-KB907265-x86-ENU.log"'
/>
<CustomAction Id="wk3.kb907265.install" BinaryKey="WixCA"
DllEntry="CAQuietExec" Execute="deferred" Return="check" />
We also found that we needed to run MMCPERF after installing MMC3, or if
it had not yet been run on 2K3 R2
<!-- Run MMCPERF to ensure the MMC 3.0 .Net assemblies are in the GAC
and nGen'd . -->
<CustomAction Id="mmcperf.install.SetProperty"
Property="mmcperf.install" Value='"[SystemFolder]\mmcperf.exe"' />
<CustomAction Id="mmcperf.install" BinaryKey="WixCA"
DllEntry="CAQuietExec" Execute="commit" Return="check" />
Then we scheduled the actions accordingly...
<InstallExecuteSequence>
<!-- Install MMC3 on Windows XP if required -->
<Custom Action="wxp.kb907265.setproperty"
After="InstallFiles"><![CDATA[(MMC30INSTALLED="") AND (VersionNT=501)
AND (NOT Installed)]]></Custom>
<Custom Action="wxp.kb907265.install"
After="wxp.kb907265.setproperty"><![CDATA[(MMC30INSTALLED="") AND
(VersionNT=501) AND (NOT Installed)]]></Custom>
<!-- Install MMC3 on Windows 2003 if required -->
<Custom Action="wk3.kb907265.setproperty"
After="InstallFiles"><![CDATA[(MMC30INSTALLED="") AND (VersionNT=502)
AND (NOT Installed)]]></Custom>
<Custom Action="wk3.kb907265.install"
After="wk3.kb907265.setproperty"><![CDATA[(MMC30INSTALLED="") AND
(VersionNT=502) AND (NOT Installed)]]></Custom>
<!-- Only run 'mmcperf' if it is found in [SystemFolder] -->
<Custom Action="mmcperf.install.SetProperty"
After="WriteRegistryValues"><![CDATA[((MMCPERF<>"") OR
(MMC30INSTALLED="")) AND (NOT Installed)]]></Custom>
<Custom Action="mmcperf.install"
After="mmcperf.install.SetProperty"><![CDATA[((MMCPERF<>"") OR
(MMC30INSTALLED="")) AND (NOT Installed)]]></Custom>
We also had to ensure our installer placed the KB packages into the TEMP
folder if we found we need to install them
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="TempFolder">
<!--
=====================================================================
-->
<!-- MMC 3.0 Update for XP and 2003 (Not required for
R2/Vista/2008. -->
<!-- These files are copied and installed from Temp if needed
-->
<!--
=====================================================================
-->
<Component Id="wxp.mmc.Component"
Guid="c5546e33-4a89-4398-bec8-ebfd679ab790" Transitive="yes">
<Condition><![CDATA[(MMC30INSTALLED="") AND (VersionNT=501)
AND (NOT Installed)]]></Condition>
<File Id="wxp.mmc.File" Name="WindowsXP-KB907265-x86-ENU.exe"
Source="res\WindowsXP-KB907265-x86-ENU.exe" />
</Component>
<Component Id="w3k.mmc.Component"
Guid="c5546e33-4a89-4398-bec8-ebfd679ac792" Transitive="yes">
<Condition><![CDATA[(MMC30INSTALLED="") AND (VersionNT=502)
AND (NOT Installed)]]></Condition>
<File Id="w3k.mmc.File"
Name="WindowsServer2003-KB907265-x86-ENU.exe"
Source="res\WindowsServer2003-KB907265-x86-ENU.exe" />
</Component>
</Directory>
</Directory>
<Feature Id="...." Title="..." Level="...">
...
<ComponentRef Id="wxp.mmc.Component" />
<ComponentRef Id="w3k.mmc.Component" />
</Feature>
Hope this helps!
Ian
-----Original Message-----
From: Andrew Lee [mailto:[email protected]]
Sent: 08 January 2009 17:34
To: [email protected]
Subject: [WiX-users] MMC 3 as an installation prerequisite
I'm using WiX to write an installer for an application which includes a
MMC 3.0 snapin. Does anyone know how to detect from within an installer
if MMC 3 is installed on the system? I haven't found any obvious MMC
3.0 specific registry entires and the MMC executable itself has a myriad
of different version numbers depending on OS and service pack.
I recognise that this isn't strictly a WiX question but any insight will
be gratefully received.
Best regards,
Andrew
--
Andrew Lee Solarflare Communications
mailto:[email protected] Block 2, Second floor, Westbrook Centre
tel:+44-1223-518040 x5507 Milton Road, Cambridge, CB4 1YG, UK
fax:+44-1223-464225 http://www.solarflare.com/
------------------------------------------------------------------------
------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for just about anything
Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users