Announcement

Collapse
No announcement yet.

How to script a Hyena installation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to script a Hyena installation

    Our IT Security group uses Hyena to create mailboxes for users (user objects are created with both IDM software and OnePoint). They all got new PCs recently and I didn’t want to have to manually install and configure Hyena and all the prereqs again, after having done this for them earlier this year. The forums don’t say much about automating a Hyena installation, with the exception of an old post about simply copying the files to another workstation. So I spent a little time working through the files and registry entries necessary to silently install Hyena and configure the workstation to get the shared settings automatically, as well as supress any dialog boxes about newsletters, first-time running, Wise update, etc. I ran it by Chuck, and so to benefit others, here is what my batch file does:

    First, I install the adminpak since the ADUC and NNTP snap-ins are needed for Exchange management.

    <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>@echo off
    rem Install AdminPak
    echo Installing Windows Administration Tools…
    \\[server]\[share]\adminpak.msi /q</pre></div></div></div></div>

    Then I install IIS manager, since the SMTP and W3SVC snap-ins are needed for Exchange ESM installation. Our OS images are locked down so IIS is not normally visible as an option to install. So I modify sysoc.inf to allow for that. Then I use sysocmgr.exe with an unattend file to install the Common Files and IIS Manager. Note: With Windows XP SP2, you no longer need to install the SMTP and W3SVC services to have the snap-ins installed; they are now included in the IIS Manager installation.

    <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>rem Install IIS
    echo Installing IIS management snap-in...
    regedit /S /E c:\WinSourcePath.reg &quot;HKEY_LOCAL_MACHINE\Software\Microsoft\Window s\CurrentVersion\Setup&quot;
    regedit /S \\[server]\[share]\WinSourcePath-custom.reg
    copy %windir%\inf\sysoc.inf c:\ &gt;nul
    copy \\[server]\[share]\sysoc.inf %windir%\inf\ /y &gt;nul
    sysocmgr.exe /i:sysoc.inf /u:\\[server]\[share]\IISUnattend.txt</pre></div></div></div></div>

    Next, I install ESM and Exchange SP2 using an unattend file. This allows for a completely automated installation of Exchange, but it is just ESM for this installation. The "ping wait" command is a poor-man's sleep function since sleep.exe isn't included out-of-the-box and I didn't want to require a resource kit tool to run this. The Exchange setup executable spawns sub-processes so the focus returns to the command window before setup has actually finished. The loop checks for the log file entry showing the process is completed before starting the next line in the script. Same for the SP2 executable.

    <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>rem Install ESM
    echo Installing Exchange management tools...
    if exist &quot;c:\Exchange Server Setup Progress.log&quot; del &quot;c:\Exchange Server Setup Progress.log&quot;
    \\[server]\[share]\i386\setup.exe /unattendfile \\[server]\[share]\esmonly.ini

    :ESMInstallWait
    ping 1.1.1.1 -n 1 -w 10000 &gt;nul
    type &quot;c:\Exchange Server Setup Progress.log&quot; | findstr /C:&quot;Setup completed successfully&quot; &gt;nul
    if %errorlevel% == 1 ping 1.1.1.1 -n 1 -w 5000 &gt;nul &amp; goto ESMInstallWait

    echo Installing Exchange service pack...
    ren &quot;c:\Exchange Server Setup Progress.log&quot; &quot;Exchange Server Setup Progress-RTM.log&quot;
    \\[server]\[share]\sp2\update.exe /unattendfile \\[server]\[share]\esmSP2.ini

    :SP2InstallWait
    ping 1.1.1.1 -n 1 -w 10000 &gt;nul
    type &quot;c:\Exchange Server Setup Progress.log&quot; | findstr /C:&quot;Setup completed successfully&quot; &gt;nul
    if %errorlevel% == 1 ping 1.1.1.1 -n 1 -w 5000 &gt;nul &amp; goto SP2InstallWait</pre></div></div></div></div>

    Now for the part most people here would be interested in, Hyena. This is just a scripted copy of the necessary files and registry entries needed for Hyena to run and work out-of-the-box for our group with no configuration needed by them:

    <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>rem Install Hyena
    echo Installing Hyena...
    if not exist &quot;c:\Program Files\Hyena&quot; mkdir &quot;c:\Program Files\Hyena&quot;
    copy \\[server]\[share]\ScriptedInstall\Binaries\*.* &quot;c:\Program Files\Hyena\&quot; &gt;nul
    regedit /S \\[server]\[share]\ScriptedInstall\Registry\hyenainstall.reg
    if not exist &quot;c:\Documents and Settings\All Users\Start Menu\Programs\Hyena&quot; mkdir &quot;c:\Documents and Settings\All Users\Start Menu\Programs\Hyena&quot;
    copy \\[server]\[share]\ScriptedInstall\Shortcuts\*.* &quot;c:\Documents and Settings\All Users\Start Menu\Programs\Hyena&quot; &gt;nul

    rem Cleanup
    regedit /S c:\WinSourcePath.reg
    del c:\WinSourcePath.reg
    copy c:\sysoc.inf %windir%\inf\ /y &gt;nul
    del c:\sysoc.inf
    echo Installation complete.
    pause
    &quot;c:\documents and settings\all users\start menu\programs\hyena\hyena.lnk&quot;</pre></div></div></div></div>

    The last line just launches Hyena for them as a convenience. What you will find below are the files I copy to the program directory on the target machine. You will also see the registry keys and values I create to allow Hyena to run the first time with no normal first-time-run dialogs:

    Files:
    <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>DirectoryQueries.CFG
    directoryschema.cfg
    export.ini
    Exporter.exe
    filetemplates.cfg
    hyena.chm
    HYENA.exe
    hyena_hotfix_list.dat
    hyenarpt.mdb.v40
    INSTALL.LOG
    Perf_counters.dat
    Perf_queries.dat
    RegTemplates.CFG
    STexport.chm
    stexport.exe
    UNWISE.EXE
    WiseUpdt.exe
    Wmi_queries.dat
    WMIQueries.CFG </pre></div></div></div></div>


    Registry:
    <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Adkins Resource]

    [HKEY_CURRENT_USER\Software\Adkins Resource\Hyena]

    [HKEY_CURRENT_USER\Software\Adkins Resource\Hyena\HomeDirTemplates]
    &quot;CheckHomeDirSettings&quot;=dword:00000001

    [HKEY_CURRENT_USER\Software\Adkins Resource\Hyena\Win32]
    &quot;CheckDatabaseUpgrade&quot;=dword:00000001
    &quot;AccessKey&quot;=&quot;[key]&quot;
    &quot;Licensee&quot;=&quot;[Licensee Name]&quot;
    &quot;AskForNewsletterSignup&quot;=dword:000000 01
    &quot;CheckMaintenanceExpiration&quot;=dword:00000 000
    &quot;CheckMaintenanceExpiration2&quot;=dword:0000 0000
    &quot;UpgradedDomainList&quot;=dword:00000001
    &quot;UpgradedWindowsDomains&quot;=dword:000000 01
    &quot;ForcedWmiNode&quot;=dword:00000001

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wise Solutions]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wise Solutions\WiseUpdate]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wise Solutions\WiseUpdate\AppPaths]
    &quot;c:\\progra~1\\hyena\\wiseupdt.exe&quot;=&quo t;Hyena&quot;

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wise Solutions\WiseUpdate\Apps]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wise Solutions\WiseUpdate\Apps\Hyena]
    &quot;Version&quot;=&quot;6.5.0&quot;
    &quot;SettingsURL&quot;=&quot;http://www.systemtools.com/hyena_eng30.ini&quot;
    &quot;UserName&quot;=&quot;&quot;
    &quot;Password&quot;=&quot;&quot;
    &quot;WebPage&quot;=&quot;http://www.systemtools.com/hyena/dow...rame.htm&quot;
    &quot;LastCheck&quot;=dword:4398a9e5
    &quot;CheckDays&quot;=dword:000f423f

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Uninstall\Hyena]
    &quot;DisplayName&quot;=&quot;Hyena&quot;
    &quot;UninstallString&quot;=&quot;C:\\PROGRA~1\\Hy ena\\UNWISE.EXE C:\\PROGRA~1\\Hyena\\INSTALL.LOG&quot;
    &quot;DisplayVersion&quot;=&quot;6.5.0&quot;
    &quot;HelpLink&quot;=&quot;http://www.systemtools.com/HyenaHelp&quot;
    &quot;HelpTelephone&quot;=&quot;830-779-2349&quot;
    &quot;Publisher&quot;=&quot;SystemTools Software Inc.&quot;
    &quot;URLInfoAbout&quot;=&quot;support@systemtools .com&quot;
    &quot;Contact&quot;=&quot;[email protected]&qu ot;
    &quot;Comments&quot;=&quot;Windows NT/2000/XP System Management Software&quot;
    &quot;DisplayIcon&quot;=&quot;C:\\PROGRA~1\\Hyena\ \HYENA.exe,-0&quot;</pre></div></div></div></div>

    Shortcuts:

    <div class="ubbcode-block"><div class="ubbcode-header">Quote:</div><div class="ubbcode-body"><div class="ubbcode-block"><div class="ubbcode-header">Code:</div><div class="ubbcode-body ubbcode-pre" ><pre>Hyena.lnk *Target includes path to settings.ini:
    &quot;C:\Program Files\Hyena\HYENA.exe&quot; &quot;[path to settings.ini]&quot;</pre></div></div></div></div>

    The registry entries still add Hyena to Add/Remove Programs so it can be uninstalled, if necessary. I didn’t know know the consequences of not including Wise Update, so I still add that, but I set the update frequency to 999,999 days. If anyone has any questions or comments about the script, please let me know.

    Scott.

    [12/05/05 edit: Added some error correction to account for one or more portions of the tools already being installed. Also added code to accommodate the way Exchange setup runs and returns focus to the window before setup is complete. Things like start /wait and using .bat instead of .cmd didn't work.]


    [This message has been edited by skippy389 (edited 12-15-2005).]
Working...
X
😀
🥰
🤢
😎
😡
👍
👎