I am looking for a way to make "Microsoft Message Queuing" a prerequisite. I know that I can't package a file to install this because this is done using Add/Remove Windows Components. I thought I might be able to create a Prerequisite with an Install Condition searching for a registry value of HKLM\SOFTWARE\Microsoft\MSMQ\Parameters\CurrentBuild. This seems to be working but I'm not sure what to specify for the Setup File. I would be satisfied if I could just get the Add/Remove Programs window open using appwiz.cpl, but I could not figure out how to do this.
This cannot be done using "Prerequisites" because with prerequisites you can install only software packages.
However this can be achieved with a custom action and a registry search like this:
Switch to "Search" page and add a "New Search->Add Location->Registry" and browse for the registry key from your post (the value of this search is used to execute or not the custom action).
Switch to "Custom Actions" page and add a new "Exe With Working Dir" custom action under "InstallUISequence->CostFinalize" standard action. In the "Full Path" field type:
This will open the Windows Components Wizard which gets me very close to where I need to be. SysocMgr.exe has an additional command line parameter which allow you to specify an answer file. The answer file would look something like this...
[Components]
Msmq_Core = On
Then I would need to change the command to the following...
WSO.run "%comspec% /c %windir%\system32\sysocmgr.exe /i:%windir\system32\sysoc.inf /u:answer_file.txt", WindowStyleStealth, true
I can get this to work by double clicking on my .vbs file manually which installs exactly what I want without requiring any user interaction, but when I try to include the answer file with my prerequisite as a secondary file, I don't think it is pathing out properly because the install fails.
I think I am very close on this, but I am just missing some small detail.
I will also take a look at your recommended solution.
You are very close on this. I suspect what you forgot was to include the 2nd File as a part of the prerequisite. The foutrh tab you need to include the answer file with your vbs as Key File.
However, your script will fail under Vista/Win7 as it no longer uses sysocmgr.
Here is mine (it also doesn'rt work under windows 7 because of some goofy win 7 thing I have yet to figure out;
dim wshShell, strCmd, WMIService, ObjSet, bXP, strDir
set wshShell=CreateObject("WScript.Shell")
Set WMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set ObjSet=WMIService.ExecQuery("Select * from Win32_operatingSystem")
for each item in ObjSet
bXP = InStr(1, item.caption, "XP")>0
next
strDir=wshShell.CurrentDirectory
if right(strDir, 1)="\" then
strDir=Left(strDir, len(strDir)-1)
end if
if bXP then
strCmd="sysocmgr /i:sysoc.inf /u:""" & strDir & "\Prerequisites\msmq\UNATTEND.txt"" /c"
else
strCmd="pkgmgr /iu:MSMQ-Container;MSMQ-Server;MSMQ-HTTP"
end if
wshShell.CurrentDirectory="C:\"
wshShell.Run strCmd, 1, true
set WMIService=Nothing
set ObjSet=Nothing
set wshShell=Nothing
The Win7 portion doesn't need the answer file, which is nice. If it is run directly, it works fine, however, it will not run from the install, it creates a message about incorrect format and bombs.
function Install7Q()
dim wshShell, strCmd
set wshShell=CreateObject("WScript.Shell")
strcmd="ocsetup MSMQ-Container;MSMQ-Server"
wshShell.CurrentDirectory="C:\"
wshShell.Run strCmd, 0, true
set wshShell=Nothing
end function
function InstallXPQ()
dim wshShell, strCmd
set wshShell=CreateObject("WScript.Shell")
strCmd="sysocmgr /i:sysoc.inf /u:""" & Session.Property("APPDIR") & "UNATTEND.txt"" /c"
msgbox strCmd
wshShell.CurrentDirectory="C:\"
wshShell.Run strCmd, 1, true
set wshShell=Nothing
end function
This file MUST be installed on Windows 7 to run. If a user tries to run it from a network location it will fail.
Create a custom action on InstallFinalize to call the Install7Q function when (Not Installed) AND (Not Remove="All") AND (VersionNT>590)
Create another for InstallXPQ with (Not Installed) AND (Not Remove="All") AND (VersionNT<600)
Still haven't seen if Server 2008 presents any new problems.
FOLLOW US
Get the latest news in Application Packaging