Welcome to MSDN Blogs Sign in | Join | Help

Minimalist setup script for MSMQ unattended installation

Just spotted a really neat trick posted on the microsoft.public.msmq.setup newsgroup.

Hans-Jürgen Philippi found a way to to create a single batch file that contains the SYSOCMGR.EXE command line as well as the information that would normally be passed to SYSOCMGR.EXE by an UNATTEND.TXT file.

[[16th September 2009 - Adding change recommended by Casper42]]

All you need to do is create a file as follows: 

;@ECHO OFF
;sysocmgr.exe /i:sysoc.inf /u:%0
;GOTO Finished

[Components]
msmq_Core = ON
msmq_LocalStorage = ON
msmq_ADIntegrated = ON
msmq_TriggersService = ON
msmq_HTTPSupport = OFF
msmq_RoutingSupport = OFF
msmq_MQDSService = OFF

;:Finished 

Apparently a semicolon ; is treated like a blank space by CMD.EXE and does not affect the command lines whilst it suitably marks them as comments for SYSOCMGR.EXE. So effectively the batch file is:

@ECHO OFF
sysocmgr.exe /i:sysoc.inf /u:%0
GOTO Finished
:Finished

and the UNATTEND.TXT file is:

[Components]
msmq_Core = ON
msmq_LocalStorage = ON
msmq_ADIntegrated = ON
msmq_TriggersService = ON
msmq_HTTPSupport = OFF
msmq_RoutingSupport = OFF
msmq_MQDSService = OFF

I’m very impressed J

Note: for MSMQ 4.0 you will need to re-engineer this approach. The SYSOCMGR tool is only for MSMQ 3.0 and earlier; for Vista/2008, you must use either PKGMGR or OCSetup, as those are the tools that replaced SYSOCMGR. The OCSetup unattend files are XML, not INI, so the only way to do a similar trick with OCSetup would be to echo out the XML file from inside the batch file and clean up afterward.

Published Tuesday, June 19, 2007 4:08 PM by JohnBrea
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Friday, January 16, 2009 5:28 AM by tobsen

# re: Minimalist setup script for MSMQ unattended installation

Hi,

do you know if the windows XP needed when installing via your unattended script? I've currently no means to test it myself :-/

Friday, January 16, 2009 5:42 AM by JohnBrea

# re: Minimalist setup script for MSMQ unattended installation

Hi Tobias,

Did you mean to ask "do you know if the windows XP CDROM/DVD is needed"?

The files for MSMQ are pre-loaded on Windows XP Professional machines so no need for the original media.

Windows XP Home does not support MSMQ.

Cheers

John

Wednesday, February 04, 2009 7:40 AM by tobsen

# re: Minimalist setup script for MSMQ unattended installation

"Did you mean to ask" Yes, exactly. Thanks a lot.

Tuesday, March 24, 2009 11:04 PM by CrackerJack

# re: Minimalist setup script for MSMQ unattended installation

This is a great "trick" and one I am using with the additional condition of only doing the install if MSMQ is not already installed. The following DOS batch script works fine on XP Pro desktops:

;@ECHO OFF

;ECHO "Try Stopping MSMQ Service"

;NET STOP MSMQ

;REM May already have been stopped, so just try a Starting it now

;NET START MSMQ

;IF ERRORLEVEL 2 GOTO Install

;ECHO "Installed/Restarted - OK"

;GOTO Finished

;:Install

;ECHO "Not Installed - NOTOK"

;ECHO "Installing MSMQ now..."

;sysocmgr.exe /i:sysoc.inf /u:checkMSMQ.bat

;ECHO "Installed & Started"

;GOTO Finished

[Components]

msmq_Core = ON

msmq_LocalStorage = ON

msmq_ADIntegrated = OFF

msmq_TriggersService = OFF

msmq_HTTPSupport = OFF

msmq_RoutingSupport = OFF

msmq_MQDSService = OFF

;:Finished

Thanks and Cheers,

CrackerJack

Wednesday, March 25, 2009 5:54 AM by JohnBrea

# re: Minimalist setup script for MSMQ unattended installation

Hi CrackerJack,

Thanks for sharing.

Cheers

John Breakwell (MSFT)

Thursday, April 30, 2009 12:33 AM by Aaron Tiensivu's Blog

# RtcQmsAgent fails to start on OCS 2007 R2 server - and causes KB 967831 (April 2009 update for Front End Server components) install to fail

If you are not planning on using the Office Communications Server Monitoring Agent, which is fairly common assumption in lab environments, you likely never planned on installing MSMQ or knew that you had to. Unfortunately, the OCS 2007 R2 setup program

Monday, May 04, 2009 4:27 PM by Casper42

# re: Minimalist setup script for MSMQ unattended installation

You guys keep putting the name of the batch file in the code.  If you rename the batch file and forget to change the SYSOCMGR line, the script is going to fail.

If you change this line:

;sysocmgr.exe /i:sysoc.inf /u:checkMSMQ.bat

to

;sysocmgr.exe /i:sysoc.inf /u:%0

it will still work and the .bat/.cmd filename is now Dynamic.

%0 (%ZERO) always spits out the name of the batch file that is actively being run, which in this case is also your SYSOC INF.

Thanks for a GREAT trick BTW with the ;

I am a batch scripting nerd and I never knew this so it was a great find when I stumbled across this page.

-Caper42

Monday, May 04, 2009 4:37 PM by JohnBrea

# re: Minimalist setup script for MSMQ unattended installation

Nice tip - thanks, Casper42.

Thursday, August 20, 2009 4:58 PM by Casper42

# re: Minimalist setup script for MSMQ unattended installation

Just FYI - this same trick works with Security INF Files.

Example

;secedit /configure /db %computername%.sdb /cfg %0 /overwrite /log %computername%.log /quiet

;GOTO :EOF

[Unicode]

Unicode=yes

[Version]

signature="$CHICAGO$"

Revision=1

[System Access]

;----------------------------------------------------------------

;Account Policies - Password Policy

;----------------------------------------------------------------

MinimumPasswordAge =30

MaximumPasswordAge =90

MinimumPasswordLength =8

PasswordComplexity =1

PasswordHistorySize =24

etc etc etc

Oh and if you didnt notice, I used GOTO :EOF

On XP/2003 and higher, this will always go to the end of the file and thus you don't need to add the jump tag like ;:FINISHED at the end of the INF section.

Wednesday, September 16, 2009 7:27 AM by Whozfoxy

# re: Minimalist setup script for MSMQ unattended installation

worked like a charm. Sorted out my OCS2007 installation, and able to continue with the process. thank you.

Wednesday, September 16, 2009 8:30 AM by JohnBrea

# re: Minimalist setup script for MSMQ unattended installation

More kudos for Hans-Jürgen Philippi :-)

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker