Cool Solutions

Howto perform a really silent ZAA deployment

lhaeger

By:

September 29, 2010 4:31 pm

Reads: 5711

Comments:0

Score:0

We’re about to migrate ZFD7 and ZAM 7.5 to ZCM 10.3. In a first step we’ll just replace the ZAM agent with the ZAA running only the “Asset Management” components. This allows us to manage applications with ZFD during the ZAA rollout phase and at a later stage switch all devices to ZCM for bundle/patch/remote/policy mgmt as well (see http://www.novell.com/documentation/zcm10/zcm10_zam_migration/data/bl9wgvi.html for details on this migration scenario).

The ZAM 7.5 agent is a really user friendly piece of software as it does not show anywhere on the machine. No GUI, no icon, no pop-ups, nothing (except excessive disk usage during a software inventory scan…)

We want to keep it that way during the ZAA rollout so end users will not see anything (like a blue/white “Z” in the taskbar) that could make them pick up the phone and spam helpdesk. But unfortunately, Novell forgot to provide a silent install option for the ZAA (at least according to http://www.novell.com/documentation/zcm10/zcm10_discovery_deployment/data/bataylp.html#bb0ztv6)…

Instead, during deployment a nasty trayicon will appear and inform the world about the installation progress in annoying detail: “Now installing novell-zenworks-someweirdname.msi (26 of 39)”. More than that, once installed, the tray icon will remain, even if a policy is assigned to hide it, because policy mgmt cannot be enabled in “Asset Management only” mode. Begs for an enhancement request, I know…

Luckily there’s AutoIT to solve problems like these. After following a manual setup in detail with Sysinternal’s Process Explorer (http://technet.microsoft.com/sysinternals/bb896653.aspx) I came up with the following script to roll out the ZAA in complete silence:

#NoTrayIcon

$InstalledVersion  = RegRead("HKLM\SOFTWARE\NOVELL\ZCM", "Version")
$WINDIR = EnvGet("WINDIR")

If $InstalledVersion = "" Then
    ;remove any remaining pre agent files left over from possible earlier installations
    DirRemove($WINDIR & "\novell\zenworks", 1)

    ;uninstall ZAM 7.5 agent
    Run("msiexec.exe /x {69FDC130-6CB4-4754-8557-BA045B3C2A7E} /qn")

    ;stop ZAM 7.5 usage monitoring
    ProcessClose("TSUsage32.exe")

    ;install ZCM agent
    Run($CmdLine[1] & " -q -x")

    ;wait for install tray icon to load and kill it
    ProcessWait("ZPA_Iface.exe",600)
    ProcessClose("ZPA_Iface.exe")

    ;wait for regular tray icon to load and kill it
    ProcessWait("ZenNotifyIcon.exe",600)
    ProcessClose("ZenNotifyIcon.exe")
    
    ;prevent ZCM tray icon from loading in the future
    RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "ZenNotifyIcon")
EndIf

Testing showed that neither the PreAgent Interface executable nor the ZEN Notification Icon are required for successful installation or operation of the agent and you can simply start them later again if you want the tray icon to show.

So grab the lastest AutoIT 3.x version from http://www.autoitscript.com/autoit3 and compile the script to “agentinst.exe”. It takes the name of the deployment package you want to install silently as a command line parameter, so you’d have to run e.g.

agentinst.exe PreAgentPkg_AgentComplete.exe

to run the 32bit full agent installer silently. Here’s an application export to start with if you’re updating an existing ZFD environment:

AXT_FILE 3.1

[Application Name]
Value=ZENworks Adaptive Agent

[Application Caption]
Value=ZENworks Adaptive Agent

[Macro]
Name=SOURCE_PATH
Value=\\Path\to\source\folder

[Macro]
Name=TARGET_PATH
Value=%TEMP%\~ZCM

[Application Path]
Value=%TARGET_PATH%\agentinst.exe

[Application Flags]
Flag=Run Once
Flag=Never Prompt Reboot
Flag=Always Distribute Application
Flag=No Distribution Window
Flag=Force Run WS Associated Apps In User Space

[Application Parameters]
Value=PreAgentPkg_AgentComplete.exe

[Application Platform]
Flag=Windows NT

[Application Working Directory]
Value=%TARGET_PATH%

[File Copy]
Flag=Write Always
Source=%SOURCE_PATH%\PreAgentPkg_AgentComplete.exe
Target=%TARGET_PATH%\PreAgentPkg_AgentComplete.exe

[File Copy]
Flag=Write Always
Source=%SOURCE_PATH%\agentinst.exe
Target=%TARGET_PATH%\agentinst.exe

[Application Association Flags]
Flag=Force Run
Flag=Force Cache

[Application Version Number]
Value=1

[Package Options]
Version=1
UI Level=0

(save as ZAA.axt and import through ConsoleOne)

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS