Partilhar via


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.

Comments

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

  • Anonymous
    January 15, 2009
    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

  • Anonymous
    February 03, 2009
    "Did you mean to ask" Yes, exactly. Thanks a lot.

  • Anonymous
    March 24, 2009
    The comment has been removed

  • Anonymous
    March 24, 2009
    Hi CrackerJack, Thanks for sharing. Cheers John Breakwell (MSFT)

  • Anonymous
    April 29, 2009
    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

  • Anonymous
    May 04, 2009
    The comment has been removed

  • Anonymous
    May 04, 2009
    Nice tip - thanks, Casper42.

  • Anonymous
    August 20, 2009
    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.

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

  • Anonymous
    September 16, 2009
    More kudos for Hans-Jürgen Philippi :-)

  • Anonymous
    December 04, 2009
    I am being asked for the CD-ROM on XP Pro SP3 machines when I run the batch file.  If I give it a path to the i386 folder when asked, it works fine.  I can manually do the install and it never asks. Please help!

  • Anonymous
    December 05, 2009
    Hi Toast, You should not need the CD-ROM for this. Are these clean-install machines or ones that have been used for a while? Are any clean-up tools run on them that remove "unwanted" files? Do you use the default Windows installation directory or something different? Cheers John Breakwell (MSFT)

  • Anonymous
    December 06, 2009
    We don't run any disk cleanup on these pcs.  Default Windows install folder.  I am only asked for the CD when installed using the batch file.   I want to run via the batch file so I can advertise it to the pcs and run it with the user logged in to prevent a tech (with admin rights) from logging in. It would be nice to do it this way to prevent the wrong items being mistakenly selected by a tech.  It would also save time per pc. I need to deploy this tomorrow, btw. :)

  • Anonymous
    December 06, 2009
    The comment has been removed

  • Anonymous
    December 06, 2009
    Well I created my package and sent it to a test pc and it works just fine!   I don't know what was missing earlier... Thanks for all your help. ;)

  • Anonymous
    December 07, 2009
    Hi Toast, That's good news. Cheers John Breakwell (MSFT)

  • Anonymous
    February 15, 2010
    Hey, I'm all new to OCS2007R2, and I've just made my first .bat file using Hans-Jürgen Philippi's code and now all my services starts just fine! Thank you!!

  • Anonymous
    February 15, 2010
    Hopefully Hans-Jürgen still keeps an eye on this thread :-) Cheers John Breakwell (MSFT)