Novell Home

ZEN 3: Install on Demand Software

Novell Cool Solutions: Trench
By Craig Wilson

Digg This - Slashdot This

Posted: 22 Nov 2000
 

Install-On-Demand software has always been a nice feature of ZENworks. The idea of Install-On-Demand is that the user gets the software when he needs it as simply as possible. This is normally done via ZENworks by displaying an icon to install the software or an icon to both install and run the software. This can be taken one step further to allow the software to be automatically installed anytime a user tries to open any document that needs the software.

This is accomplished by associating the desired file extensions to an automated install program for those extensions that are not already defined on a machine. When a file is opened in Explorer and the appropriate software is not loaded on the machine, it will launch the automated install program which installs the software, launches the software, and opens the file in the software that was opened in Explorer.

As an example of how to perform this function, I have created two application objects, CADONDEMAND and CADAPP. The first application object consists of a few simple registry entries that associates the CADAPP application object with the CADAPP application as well as shortcut on the start menu that also installs the CADAPP application. The CADAPP application is a snAppShot of a CAD application.

CADONDEMAND

The purpose of the CADONDEMAND application is to install the CAD application anytime a user clicks on a file with the CAD extension. This way the user will not need to know which application to install or what steps to take to perform the install.

The registry entries for this application are the following.

REGEDIT4
[HKEY_CLASSES_ROOT\.CAD]
@="CAD_auto_file"
[HKEY_CLASSES_ROOT\CAD_auto_file]
@="CAD File"
[HKEY_CLASSES_ROOT\CAD_auto_file\shell\open]
@=""
[HKEY_CLASSES_ROOT\CAD_auto_file\shell\open\command]
@="F:\zenutils\Nalrun32.exe ithowto .CADAPP.HBG /P="%1""
[HKEY_LOCAL_MACHINE\Software\CLASSES\.CAD]
@="CAD_auto_file"
[HKEY_LOCAL_MACHINE\Software\CLASSES\CAD_auto_file]
@="CAD File"
[HKEY_LOCAL_MACHINE\Software\CLASSES\CAD_auto_file\ shell\open]
@=""
[HKEY_LOCAL_MACHINE\Software\CLASSES\CAD_auto_file\ shell\open\command]
@="F:\zenutils\Nalrun32.exe ithowto .CADAPP.HBG /P="%1""

These registry entries cause the ZENworks application "CADAPP" to be called when a file with the extension CAD is clicked. The utility nalrun32.exe is executed with the parameters of the tree name, the fully qualified name of the application object, and finally the option to pass the %1 variable to the application, which will evaluate to the name of the file double-clicked. The utility nalrun32.exe from the ZENworks 2 toolkit is used in this example. The file zenapp32.dll must be placed in the same directory as the nalrun32.exe utility because the zenapp32.dll that comes with ZEN3 is incompatible with nalrun32.exe util. Nal.exe from ZEN2 functions correctly and does not need to use the nalrun32.exe utility.

All of the entries for this application are set to "Create if Does Not Exist". The application is also set to always distribute. This will cause the CAD software settings to not be overwritten if they exist, but it will reset the application to auto-install if necessary after the CAD application has been removed from a workstation.

CADAPP

The "CADAPP" will perform three main functions.

It will perform a snAppShot install of the CAD application which includes over-writing the necessary file type associations to cause the CAD application to be called on any future occasion that a file with the CAD extension is selected.

It will launch the CAD application and open the file on which the user clicked.

The registry entries for this application are the following.

REGEDIT4
[HKEY_CLASSES_ROOT\.CAD]
@="CAD_auto_file"
[HKEY_CLASSES_ROOT\CAD_auto_file]
@="CAD File"
[HKEY_CLASSES_ROOT\CAD_auto_file\shell\open]
@=""
[HKEY_CLASSES_ROOT\CAD_auto_file\shell\open\command]
@="NOTEPAD.EXE "%1""
[HKEY_LOCAL_MACHINE\Software\CLASSES\.CAD]
@="CAD_auto_file"
[HKEY_LOCAL_MACHINE\Software\CLASSES\CAD_auto_file]
@="CAD File"
[HKEY_LOCAL_MACHINE\Software\CLASSES\CAD_auto_file\ shell\open]
@=""
[HKEY_LOCAL_MACHINE\Software\CLASSES\CAD_auto_file\ shell\open\command]
@="NOTEPAD.EXE "%1""

The settings over-ride the previous settings which called the nalrunw32.exe program. Every time the application is called after the initial launching, notepad.exe will be called directly without calling the ZENworks application. The registry entries above which are used to control the auto-launching of notepad, should be set to "distribute-always" in case the first app is ever runs accidentally again on this PC, which would cause the nalrunw32.exe to always run since these settings would not be pushed again without the distribute always option enabled. This option would not need to be enabled for the other registry entries for the application, since the "CADONDEMAND" application only sets these few entries.

Note: The settings above just call notepad for demonstration purposes, but could call a real auto-cad program if available. The real application would also include all the necessary registry settings for the application.

Here is a ZIP file containing an AXT for both applications as well as the nalrun32.exe and zenapps32.dll. CAD.ZIP

About the Author

Craig Wilson is the senior consultant at ITHOWTO.COM and a Novell Support Connection Systop @ Forums.Novell.Com.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell