Creating a Batch File For Deploying Hotfixes.

September 25, 2006 | KB: 1011635
Laserfiche 7

Summary

You can store client hotfix files along with a batch file in a shared network location such that users can run the batch file from their workstations to automatically install the hotfix files.

The basic procedure is as follows:

  1. Download a copy of the necessary hotfix file(s) and place it in a shared network location. If the hotfix is packaged as a zip file, be sure to extract the contents of the zip file.
  2. Create a batch file that, when run from a user's workstation, will copy the hotfix file(s) from the shared network location to their local workstation.

To create a batch file that will copy and register a hotfix file

  1. Click Start, point to All Programs, Accessories, and select Notepad.
  2. Type the following:

    xcopy name_of_hotfix_file "local_installation_path" /Y /R

    The /Y flag disables any prompts that ask you to confirm that you want to overwrite an existing destination file. The /R flag allows you to overwrite read-only files.

  3. If the hotfix file is a library or control that must be registered, type the following on a new line:

    regsvr32 "local_installation_path_of_hotfix" /S

    The /S flag enables silent mode.

  4. Save the file. In the Save As dialog box, in the File Name option, specify a name using the .bat extension and save it to where you extracted the hotfix file.

More Information

The following example outlines what the batch file may look like for a hotfix involving "DocumentProcessor72.dll."

    xcopy DocumentProcessor72.dll "C:\Program Files\Common Files\Laserfiche\LFObjects" /Y /R
    regsvr32 "C:\Program Files\Common Files\Laserfiche\LFObjects\DocumentProcessor72.dll" /S

The above example assumes that the batch file is located in the same directory as the temporary shared network location holding the downloaded hotfixed version of DocumentProcessor72.dll.

You can append additional lines to the batch file if you want to install multiple hotfix files. For example, the following example outlines what the batch file may look like if you want to install two hotfix files using one batch file: LFImage72.ocx and DocumentProcessor72.dll.

    xcopy DocumentProcessor72.dll "C:\Program Files\Common Files\Laserfiche\LFObjects" /Y /R
    xcopy LFImage72.ocx "C:\Program Files\Common Files\Laserfiche\Controls" /Y /R
    regsvr32 "C:\Program Files\Common Files\Laserfiche\LFObjects\DocumentProcessor72.dll" /S
    regsvr32 "C:\Program Files\Common Files\Laserfiche\Controls\LFImage72.ocx" /S

Note: Be aware that users cannot overwrite files that are in use. Any users running the above batch file will still have to make sure that any client programs that use the hotfix files are closed before running the batch file.

Note: Files installed to subdirectories in "C:\Program Files\Common Files\Laserfiche" will be located in that location for all client workstations. However, be aware that any hotfixes involving files that are installed in a program's installation directory may differ between different workstations.

Note: Be sure that the hotfix file(s) located in the shared network location along with the batch file is the correct version. When run, the above examples simply replace the existing local versions of the hotfixed files. They do not check to see if the local workstation already has a more recent version of the affected file.