com.ptc.windchill.instassm
Class UpdateInstallationRegistry

java.lang.Object
  extended bycom.ptc.windchill.instassm.UpdateInstallationRegistry
Direct Known Subclasses:
UpdateInstalledAssemblyRegistry

public class UpdateInstallationRegistry
extends Object

An install time tool that aggregates all installed assembly files (IA files) found in $(wt.home)/codebase/instreg into a single "registry" file in the same directory. Further, the tool will update appropriate DDL for populating a database with version information about each installed assembly.

Install Tool Usage

Installation tools (PTCSetup and copyBuild) should expand the release image for each solution into a common windchill home directory. Once doing so, there should be a directory named $INSTALL_DIR/codebase/instreg containing an IA file for each assembly that was installed.

Once all IA files are present, an additional installation step must be performed which will combine the contents of the IA files into a single file that provides convenient access to the version information for each assembly that was installed. The details of this step are not important for the installation tools. There is a Java program that may be invoked to perform this action.

From a command line, the follow command will perform the action.

    java com.ptc.windchill.instassm.UpdateInstallationRegistry
The main(...) method will perform all necessary tasks. It will return 0 if successful, and -1 if a failure occurs. Failure will also include an exception stack trace to STDERR.

From within a running Java VM, the following static API may be called:

    public static void updateInstallationRegistry()
       throws com.ptc.windchill.instassm.IAException;
This method will return if successful. If a manageable failure occurs, an IAException will be thrown. Uncaught/unexpected exceptions may be thrown from this method.

Both appropaches require that the $INSTALL_DIR/codebase be present in the classpath, that the resource $INSTALL_DIR/codebase/wt.properties is accessible via this classpath, and that the contents of wt.properties are already properly configured.

Command line usage

The main(String[]) method will process the args list by treating each arg as a path to a .ia file. The file will be parsed and validated as a .ia then installed into the Windchill registry directory, afterwhich the registry will be rebuild.

Supported API: false

Extendable: false


Field Summary
private static String INCOMPLETE_OPT
           
private static String INSTALL_DIR
           
private static String IS_WINDCHILL_ROOT
           
private static String LINE_SEPARATOR
           
private static String NO_OP
           
private static String OK_IF_NO_ASSMS
           
 
Constructor Summary
UpdateInstallationRegistry()
           
 
Method Summary
static String[] getCommandLineArguments(boolean is_windchill_root, boolean ok_if_no_assm, boolean set_incomplete)
           
private static void install(File file, boolean incomplete)
           
static void main(String[] args)
          Entry point for command line usage.
static void updateInstallationRegistry()
          Entry point for invocation from an already-running Java VM.
static void updateInstallationRegistry(boolean okay_if_no_assemblies)
          Entry point for invocation from an already-running Java VM.
private static void updateInstallationRegistryInProcess(boolean okay_if_no_assemblies)
          Run the install registry update in process.
private static void updateInstallationRegistryOutOfProcess(boolean okay_if_no_assemblies)
          Run the install registry update out of process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

private static final String LINE_SEPARATOR

INCOMPLETE_OPT

private static final String INCOMPLETE_OPT
See Also:
Constant Field Values

OK_IF_NO_ASSMS

private static final String OK_IF_NO_ASSMS
See Also:
Constant Field Values

INSTALL_DIR

private static final String INSTALL_DIR
See Also:
Constant Field Values

IS_WINDCHILL_ROOT

private static final String IS_WINDCHILL_ROOT
See Also:
Constant Field Values

NO_OP

private static final String NO_OP
See Also:
Constant Field Values
Constructor Detail

UpdateInstallationRegistry

public UpdateInstallationRegistry()
Method Detail

getCommandLineArguments

public static String[] getCommandLineArguments(boolean is_windchill_root,
                                               boolean ok_if_no_assm,
                                               boolean set_incomplete)
                                        throws IAException
Throws:
IAException

main

public static void main(String[] args)
Entry point for command line usage. No arguments are necessary. The system will exit with return code of 0 if successful, -1 if a failure occurs.


updateInstallationRegistry

public static void updateInstallationRegistry()
                                       throws IAException
Entry point for invocation from an already-running Java VM.

Throws:
IAException - if any expected problem occurs updating the registry; note that other unchecked errors may be thrown

updateInstallationRegistry

public static void updateInstallationRegistry(boolean okay_if_no_assemblies)
                                       throws IAException
Entry point for invocation from an already-running Java VM.

Parameters:
okay_if_no_assemblies - if false, an exception will be tossed if the registry dir contains no .ia files to register
Throws:
IAException - if any expected problem occurs updating the registry; note that other unchecked errors may be thrown

updateInstallationRegistryInProcess

private static void updateInstallationRegistryInProcess(boolean okay_if_no_assemblies)
                                                 throws IAException
Run the install registry update in process.

Parameters:
okay_if_no_assemblies - if false, an exception will be tossed if the registry dir contains no .ia files to register
Throws:
IAException - if any expected problem occurs updating the registry; note that other unchecked errors may be thrown

updateInstallationRegistryOutOfProcess

private static void updateInstallationRegistryOutOfProcess(boolean okay_if_no_assemblies)
                                                    throws IAException
Run the install registry update out of process.

Parameters:
okay_if_no_assemblies - if false, an exception will be tossed if the registry dir contains no .ia files to register
Throws:
IAException - if any expected problem occurs updating the registry; note that other unchecked errors may be thrown

install

private static void install(File file,
                            boolean incomplete)
                     throws IAException
Throws:
IAException