snAppShot Tricks for Internet Explorer 4.0

(Last modified: 06Mar2001)

This document (10025271) is provided subject to the disclaimer at the end of this document.

goal

snAppShot Tricks for Internet Explorer 4.0

fact

Novell Application Launcher

SNAPSHOT.EXE

Formerly TID 2946611

fix

Microsoft Internet Explorer 4.0 & ZENworks snAppShot utility
This TID is taken from http://www.novell.com/coolsolutions/zenworks/tip_internet_explorer.html. It reviews a few macro basics (and how snAppShot works with macros), illustrates the technical problem (if you're interested), and shows you how to solve things by modifying the Application object or the .AXT file.

A Special Macros Primer Before we describe the problem, and the solution, bear with us as we review a few basics about a very powerful aspect of Application Launcher: Special Macros.

"Special Macros" are a number of cool built-in machine- and user-specific values that snAppShot and Application Launcher uses.

Shameless Plug: The online Help that appears when you click the Help button on the Application object Macros property page in NWAdmin gives a detailed list and additional explanations.

By reading Special Macros from the Registry, snAppShot and Application Launcher let you customize Application objects so you can distribute the same application to machines that might have Windows installed or configured with different drives and directories.

Here is a list and description of a few Special Macros:
*WinDir Windows directory, typically c:windows or c:winnt
*WinSysDir Windows system directory, typically c:\windows\system or c:\winnt\system32
*WinDisk Drive letter (plus colon) for Windows directory, typically c:
*WinSysDisk Drive letter (plus colon) for Windows system directory c:
*WinSys16Dir Windows NT 16-bit system directory (c:\winnt\system)
*TempDir Windows temporary directory (c:\windows\temp)
*Favorites File system directory that serves as a common repository for the user's favorite items. Typically
this directory is c:\windows\favorites or c:\winnt\profiles\administratorfavorites.
*Fonts Virtual folder containing fonts. Typically c:\windows\fonts or c:\winnt\fonts.
*NetHood File system directory containing objects that appear in the network neighborhood. Typically
c:\windows\nethood or c:\winnt\profiles\administrator\nethood.
*PrintHood File system directory that serves as a common repository for printer links. Typically
c:\winnt\profiles\administrator\printhood. Only used by Windows NT 4.
*Personal File system directory that serves as a common repository for documents. Typically c:\myfiles or
c:\winnt\profiles\administrator\personal.
                  
How snAppShot Uses Special Macros
Now let's talk more specifically about how snAppShot uses Special Macros and how it adds them to the ..AOT file.

When snAppShot starts (or re-starts after a re-boot), it asks the Application Launcher client library for a list of the "Special Macros." This list is combined with the "User Macros" (in Custom Mode you can edit and add as many as necessary) to make a complete list of macros, which are then ordered longest value to shortest value. This ordering results in the most complete substitution, that is, snAppShot searches and replaces C:\Windows\ProgramFiles\Netscape before it searches and replaces C:\Windows. As snAppShot
zips along, it records the differences between the pre-installation scan and the second (or post-installation) scan. It then creates an entry in the .at file, and, as part of creating this entry, snAppShot calls the routine that searches and replaces data with the macros name. In short, this is how the .at file and later the Application object get the macro values.

Still with us? Now we need to explain how the Application Launcher Client library gets the values and the names for these Special Macros. It looks in the Registry under the key:
 HKEY_CURRENT_USER
                   \Software
                   \Microsoft
                   \Windows
                   \CurrentVersion
                   \Explorer
                   \Shell Folders

and for each of the entries the Application Launcher client creates a Special Macro using the name and value. If the value does not exist then the Special Macro is returned and the data value is set to blank.

Which brings us to, shall we say, an oversight in snAppShot (which will soon be corrected). Internet Explorer 4.0 is adding and creating new values for three of the Special Macros under the following key:

HKEY_CURRENT_USER
                   \Software
                   \Microsoft
                   \Windows
                   \CurrentVersion
                   \Explorer
                   \Shell Folders

                   Favorites=C:\WINNT\Profiles\iparish\Favorites

                   Personal=C:\WINNT\Profiles\iparish\Personal

                   AppData=C:\WINNT\Profiles\iparish\Application Data

These correspond to the Application Launcher Special Macros:
                   %*Favorites%
                   %*Personal%
                   %*AppData%

Thus, when snAppShot adds the [Registry Value Create ] info in the .AOT or AXT file it writes entries that look like:
                   [Registry Value Create]
                   Type=String
                   Flag=Write Always
                   Key=HKEY_CURRENT_USER\Software\Microsoft\Windows
                   \CurrentVersion\Explorer\Shell
                   Folders
                   Name=Favorites
                   Value=%*FAVORITES%

                   [Registry Value Create]
                   Type=String
                   Flag=Write Always
                   Key=HKEY_CURRENT_USER\Software\Microsoft\Windows
                   \CurrentVersion\Explorer\Shell
                   Folders
                   Name=Personal
                   Value=%*PERSONAL%

                   [Registry Value Create]
                   Type=String
                   Flag=Write Always
                   Key=HKEY_CURRENT_USER\Software\Microsoft\Windows
                   \CurrentVersion\Explorer\Shell
                   Folders
                   Name=AppData
                   Value=%*APPDATA%

When the Application Launcher client tries to distribute these two settings, it sees the %*FAVORITES% macro value and, in an attempt to set this Registry key, tries to read the value from this exact Registry key. See the problem? In essence, Application Launcher is trying to use data from the very same Registry key that it is trying to create.

 This Application distribution would work just great if the Registry value was set before the application was distributed.

One way of solving this is to set this Registry value before the user clicks on the icon (perhaps using Z.E.N.works Workstation policies). Then, when the Application Launcher client reads the data for these special macros, it reads the correct value and knows how to replace %*Favorites% for all of the copy file entries. You could also remove the three [Registry Value Create] entries that add the *FAVORITES, *PERSONAL, and *APPDATA macro values from the Application object.

A better solution is to edit the Application object, either by editing an .at version of the Application object (before it's created), or search and replace the necessary data on an existing Application object (see the NWAdmin Tool menu). In any event, you need to
do the following:

1. Search for %*FAVORITES% and replace it with a different macro like %MYFAVORITES%
2. Search for %*PERSONAL% and replace it with a different macro like %MYPERSONAL%
3. Search for %*APPDATA% and replace it with a different macro like %MYAPPDATA%

The next step is to add the definition for these three new macros to the Application object's Macros property page, or to the top of the .at file. Notice that because Windows NT and Windows 95 differ a little bit with regard to users, you will need to create different entries for each platform. Here are three example: Three for
Windows 95 and three for Windows NT:

For Windows NT, add macro entries that looks like these:
                   [Macro]
                   Name=MYFAVORITES
                   Value=%*WinDir%\Profiles\%CN%\Favorites

                   [Macro]
                   Name=MYPERSONAL
                   Value=%*WinDir%\Profiles\%CN%\Personal

                   [Macro]
                   Name=MYAPPDATA
                   Value=%*WinDir%\Profiles\%CN%\Application Data

                   For Windows 95, add macro entries that look like these:

                   [Macro]
                   Name=MYFAVORITES
                   Value=%*WinDir%\Favorites

                   [Macro]
                   Name=MYPERSONAL
                   Value=%*WinDir%\Personal

                   [Macro]
                   Name=MYAPPDATA
                   Value=%*WinDir%\Application Data

If you're partial to a GUI interface, you can also add these two values to the Application object on the Macros property page. The result is the same.

There you have it! With these few simple changes you should be able to snAppShot IE 4.0, tweak the .AXT file, and then distribute it just like all the other applications in your Z.E.N.works environment.

Search words : MSIE , ZEN , ZENworks , Z.E.N.works, NAL , 2.5 , 2.6 , 1.0 , 1.01 , 1.1 .

document

Document Title: snAppShot Tricks for Internet Explorer 4.0
Document ID: 10025271
Solution ID: 1.0.50385506.2500704
Creation Date: 20Jan2000
Modified Date: 06Mar2001
Novell Product Class:NetWare

disclaimer

The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.