Customizing an uninstall with Install.log

Article:HOWTO2634  |  Created: 2006-03-06  |  Updated: 2007-10-24  |  Article URL http://www.symantec.com/docs/HOWTO2634
Article Type
How To


Question
How do I customize my uninstall with Install.log?

Answer

You can easily and quickly customize the uninstall process in script-based installations. The Uninstall page in Installation Expert lets you delete files and registry keys or execute a program during the uninstall process. You can also create additional customization not available from the Uninstall page by using the Add Text to Install.log script action in Script Editor.

When your installation script runs, the Install.log file records each script action. During the uninstall process, the script begins processing at the end of the Install.log file and works its way up, undoing each of the actions listed in the file. Keep this in mind when determining the location of the text you add to the Install.log file. This article details how you can use the Add Text to Install.log action to undo several of the actions included in a common script-based installation. If the actions were included in the installation, wouldn't they already be in the log file? You might think so, but the user may want to delete additional files, registry keys, and so on. For more information, on the Add Text to Install.log action, see the topic titled Add Text to Install.log in the online help.


To delete an individual file (including a shortcut or a font), add the following text to the Install.log file:

File Copy:

where is the full path to the file on the destination computer. This path can include variables such as %SYS32%.

To delete multiple files or any number of directories (including subdirectories), add the following text to the Install.log file:

File Tree:

where is the full path to the files or the directory on the destination computer. This path can include variables such as %SYS32%, and can contain wildcards when referring to files.

Examples:

File Copy: %WIN%\file.txt
File Copy: %FONTS%\font.ttf
File Tree: C:\Directory\*.txt
File Tree: C:\Directory
File Tree: C:\Documents and Settings\All Users\Desktop\shortcut.lnk


Install.log

If a directory empties because of files deleted during the uninstall process, the uninstall process deletes the empty directory. While the uninstall process deletes the font file immediately, it might not disappear right away from the list of fonts shown in the Fonts applet of the Control Panel. To refresh the list of fonts, close and re-open the Fonts applet.


To delete a service, add the following text to the Install.log file:

Create Service:

where is the name of the service on the destination computer. Be sure to use the actual service name rather than the display name. For example, to delete the ClipBook service, add the following to the INSTALL.LOG:

Create Service: ClipSrv


To delete an individual item from an INI file, add the following text to the Install.log file:

  • INI File:
  • INI Sect:
  • INI Item:
  • INI Val:

where is the full path to the .ini file on the destination computer, is the section that contains the item you want to delete (excluding the square brackets), is the item you want to delete and is the value of the item you want to delete. You must include the value of the item to delete the item from the INI file successfully. The path, section, item, and value can all include variables such as %SYS32%, but cannot contain wildcards.

  • INI File: %WIN%\Wise.ini
  • INI Sect: Settings
  • INI Item: DefaultTemplate
  • INI Val: Empty Project
  • Undo: Edit Registry

To delete an entire registry key and all of its subkeys, add the following text to the Install.log file:

  • RegDB Tree:
  • RegDB Root:

where is the full path to the registry key on the destination computer (excluding the root) and is the root of the registry containing the registry key. The following are allowable values for:

  • 0 - HKEY_CLASSES_ROOT
  • 1 - HKEY_CURRENT_USER
  • 2 - HKEY_LOCAL_MACHINE
  • 3 - HKEY_USERS

To delete a particular registry value, add the following text to the Install.log file:

  • RegDB Key:
  • RegDB Val:
  • RegDB Name: RegDB Root:

where is the full path to the registry key that contains the value to be deleted (excluding the root), is the data contained in the registry value to be deleted, is the name of the registry value to be deleted, and is the root of the registry containing the registry key to be deleted. You must include the value of the item to delete the item from the registry successfully.


Execute Program

To execute a program during the uninstall process, add the following text to the Install.log file:

Execute Program:

where is the full path to the program to be executed. This path can include variables such as %SYS32%, but cannot contain wildcards.

Note: There is a known issue regarding the addition of "Execute Program: " to the Install.log file. If the executing program accepts command-line parameters, you must include them. If there are no command-line parameters, the uninstall adds the type of uninstall ("Automatic" or "Custom") to the command-line parameters, which can cause errors. Programs that ignore command-line parameters (for example, the Windows calculator) are not affected by this issue. Below are some examples of text that you can/cannot add to the Install.log file.

Error free:

Execute Program: %SYS32%\notepad.exe "C:\Program Files\Test.txt"
Execute Program: C:\Program Files\Internet Explorer.exe http://www.wise.com
Execute Program: %SYS32%\calc.exe

Causes errors:

Execute Program: %SYS32%\notepad.exe
Execute Program: C:\Program Files\Internet Explorer.exe

Note: Any program executed during the uninstall process executes before any other actions, regardless of where the Execute Program action exists in the log. You can only execute one external program during the uninstall process.

Adding lines of text to the Install.log file lets you tailor an uninstall to your specifications. By using the information detailed above, you can quickly provide additional customization for your uninstall.


Legacy ID



20355


Article URL http://www.symantec.com/docs/HOWTO2634


Terms of use for this information are found in Legal Notices