com.izforge.izpack.util.os
Class WinSetupAPIBase

java.lang.Object
  extended by com.izforge.izpack.util.os.WinSetupAPIBase
All Implemented Interfaces:
NativeLibraryClient
Direct Known Subclasses:
WinSetupFileQueue

public class WinSetupAPIBase
extends Object
implements NativeLibraryClient


Field Summary
protected static int INVALID_HANDLE_VALUE
           
static int SP_COPY_DELETESOURCE
          Delete source file on successful copy
static int SP_COPY_FORCE_IN_USE
          Force target-in-use behavior
static int SP_COPY_FORCE_NEWER
          Like NEWER but no callback nofitication
static int SP_COPY_FORCE_NOOVERWRITE
          Like NOOVERWRITE but no callback nofitication
static int SP_COPY_IN_USE_NEEDS_REBOOT
          System needs reboot if file in use
static int SP_COPY_LANGUAGEAWARE
          Don't overwrite file of different language
static int SP_COPY_NEWER
          Copy only if source newer than or same as target
static int SP_COPY_NEWER_ONLY
          Copy only if source file newer than target
static int SP_COPY_NEWER_OR_SAME
          Copy only if source newer than or same as target
static int SP_COPY_NOBROWSE
          Browsing is disallowed for this file or section
static int SP_COPY_NODECOMP
          Don't decompress source file while copying
static int SP_COPY_NOOVERWRITE
          Copy only if target doesn't exist
static int SP_COPY_NOPRUNE
          Never prune this file
static int SP_COPY_NOSKIP
          Skip is disallowed for this file or section
static int SP_COPY_OEMINF_CATALOG_ONLY
          (SetupCopyOEMInf only) don't copy INF--just catalog
static int SP_COPY_REPLACE_BOOT_FILE
          File must be present upon reboot (i.e., it's needed by the loader); this flag implies a reboot
static int SP_COPY_REPLACEONLY
          Copy only if target file already present
static int SP_COPY_SOURCE_ABSOLUTE
          Parameter SourceFile is a full source path
static int SP_COPY_SOURCE_SIS_MASTER
          Source is single-instance store master
static int SP_COPY_SOURCEPATH_ABSOLUTE
          Parameter SourcePathRoot is the full path
static int SP_COPY_WARNIFSKIP
          System critical file: warn if user tries to skip
static int SP_FLAG_CABINETCONTINUATION
          Used with need media notification
static int SPFILEQ_FILE_IN_USE
           
static int SPFILEQ_REBOOT_IN_PROGRESS
           
static int SPFILEQ_REBOOT_RECOMMENDED
           
 
Constructor Summary
WinSetupAPIBase(Librarian librarian)
          Constructs a WinSetupAPIBase.
 
Method Summary
 void freeLibrary(String name)
           
protected  void SetupCloseFileQueue(int queuehandle)
          Closes a file queue.
protected  boolean SetupCommitFileQueue(int queuehandle)
          Commits the actions stored in the file queue.
protected  int SetupOpenFileQueue(Object handler)
          Create a file queue
protected  int SetupPromptReboot(int queuehandle, boolean scanonly)
           
protected  void SetupQueueCopy(int queuehandle, String SourceRootPath, String SourcePath, String SourceFileName, String SourceDescription, String SourceTagFile, String TargetDirectory, String TargetFileName, int CopyStyle)
          Places an individual file copy operation on a setup file queue.
protected  void SetupQueueDelete(int queuehandle, String PathPart1, String PathPart2)
          Places an individual file delete operation on a setup file queue.
protected  void SetupQueueRename(int queuehandle, String SourcePath, String SourceFileName, String TargetPath, String TargetFileName)
          Places an individual file rename operation on a setup file queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_HANDLE_VALUE

protected static final int INVALID_HANDLE_VALUE
See Also:
Constant Field Values

SP_COPY_DELETESOURCE

public static final int SP_COPY_DELETESOURCE
Delete source file on successful copy

See Also:
Constant Field Values

SP_COPY_REPLACEONLY

public static final int SP_COPY_REPLACEONLY
Copy only if target file already present

See Also:
Constant Field Values

SP_COPY_NEWER

public static final int SP_COPY_NEWER
Copy only if source newer than or same as target

See Also:
SP_COPY_NEWER_OR_SAME, Constant Field Values

SP_COPY_NEWER_OR_SAME

public static final int SP_COPY_NEWER_OR_SAME
Copy only if source newer than or same as target

See Also:
SP_COPY_NEWER, Constant Field Values

SP_COPY_NOOVERWRITE

public static final int SP_COPY_NOOVERWRITE
Copy only if target doesn't exist

See Also:
SP_COPY_FORCE_NOOVERWRITE, Constant Field Values

SP_COPY_NODECOMP

public static final int SP_COPY_NODECOMP
Don't decompress source file while copying

See Also:
Constant Field Values

SP_COPY_LANGUAGEAWARE

public static final int SP_COPY_LANGUAGEAWARE
Don't overwrite file of different language

See Also:
Constant Field Values

SP_COPY_SOURCE_ABSOLUTE

public static final int SP_COPY_SOURCE_ABSOLUTE
Parameter SourceFile is a full source path

See Also:
Constant Field Values

SP_COPY_SOURCEPATH_ABSOLUTE

public static final int SP_COPY_SOURCEPATH_ABSOLUTE
Parameter SourcePathRoot is the full path

See Also:
Constant Field Values

SP_COPY_IN_USE_NEEDS_REBOOT

public static final int SP_COPY_IN_USE_NEEDS_REBOOT
System needs reboot if file in use

See Also:
Constant Field Values

SP_COPY_FORCE_IN_USE

public static final int SP_COPY_FORCE_IN_USE
Force target-in-use behavior

See Also:
Constant Field Values

SP_COPY_NOSKIP

public static final int SP_COPY_NOSKIP
Skip is disallowed for this file or section

See Also:
Constant Field Values

SP_FLAG_CABINETCONTINUATION

public static final int SP_FLAG_CABINETCONTINUATION
Used with need media notification

See Also:
Constant Field Values

SP_COPY_FORCE_NOOVERWRITE

public static final int SP_COPY_FORCE_NOOVERWRITE
Like NOOVERWRITE but no callback nofitication

See Also:
SP_COPY_NOOVERWRITE, Constant Field Values

SP_COPY_FORCE_NEWER

public static final int SP_COPY_FORCE_NEWER
Like NEWER but no callback nofitication

See Also:
Constant Field Values

SP_COPY_WARNIFSKIP

public static final int SP_COPY_WARNIFSKIP
System critical file: warn if user tries to skip

See Also:
Constant Field Values

SP_COPY_NOBROWSE

public static final int SP_COPY_NOBROWSE
Browsing is disallowed for this file or section

See Also:
Constant Field Values

SP_COPY_NEWER_ONLY

public static final int SP_COPY_NEWER_ONLY
Copy only if source file newer than target

See Also:
Constant Field Values

SP_COPY_SOURCE_SIS_MASTER

public static final int SP_COPY_SOURCE_SIS_MASTER
Source is single-instance store master

See Also:
Constant Field Values

SP_COPY_OEMINF_CATALOG_ONLY

public static final int SP_COPY_OEMINF_CATALOG_ONLY
(SetupCopyOEMInf only) don't copy INF--just catalog

See Also:
Constant Field Values

SP_COPY_REPLACE_BOOT_FILE

public static final int SP_COPY_REPLACE_BOOT_FILE
File must be present upon reboot (i.e., it's needed by the loader); this flag implies a reboot

See Also:
Constant Field Values

SP_COPY_NOPRUNE

public static final int SP_COPY_NOPRUNE
Never prune this file

See Also:
Constant Field Values

SPFILEQ_FILE_IN_USE

public static final int SPFILEQ_FILE_IN_USE
See Also:
Constant Field Values

SPFILEQ_REBOOT_RECOMMENDED

public static final int SPFILEQ_REBOOT_RECOMMENDED
See Also:
Constant Field Values

SPFILEQ_REBOOT_IN_PROGRESS

public static final int SPFILEQ_REBOOT_IN_PROGRESS
See Also:
Constant Field Values
Constructor Detail

WinSetupAPIBase

public WinSetupAPIBase(Librarian librarian)
Constructs a WinSetupAPIBase.

Parameters:
librarian - the librarian
Throws:
IzPackException - if the WinSetupAPI library cannot be loaded
Method Detail

freeLibrary

public void freeLibrary(String name)
Specified by:
freeLibrary in interface NativeLibraryClient

SetupOpenFileQueue

protected int SetupOpenFileQueue(Object handler)
                          throws IOException
Create a file queue

Parameters:
handler - Optional instance of WinSetupQueueCallbackInterface handler. If set to null, use the Setup API's SetupDefaultCallbackHandler.
Returns:
Handle to the new file queue
Throws:
IOException

SetupCloseFileQueue

protected void SetupCloseFileQueue(int queuehandle)
Closes a file queue.

Parameters:
queuehandle - Handle to the file queue to close.

SetupQueueCopy

protected void SetupQueueCopy(int queuehandle,
                              String SourceRootPath,
                              String SourcePath,
                              String SourceFileName,
                              String SourceDescription,
                              String SourceTagFile,
                              String TargetDirectory,
                              String TargetFileName,
                              int CopyStyle)
                       throws IOException
Places an individual file copy operation on a setup file queue.

Parameters:
queuehandle -
SourceRootPath - (optional)
SourcePath - (optional)
SourceFileName -
SourceDescription - (optional)
SourceTagFile - (optional)
TargetDirectory -
TargetFileName - (optional)
CopyStyle -
Throws:
IOException

SetupQueueDelete

protected void SetupQueueDelete(int queuehandle,
                                String PathPart1,
                                String PathPart2)
                         throws IOException
Places an individual file delete operation on a setup file queue.

Parameters:
queuehandle - Handle to a setup file queue, as returned by SetupOpenFileQueue.
PathPart1 - String that specifies the first part of the path of the file to be deleted. If PathPart2 is NULL, PathPart1 is the full path of the file to be deleted.
PathPart2 - String that specifies the second part of the path of the file to be deleted. This parameter may be NULL. This is appended to PathPart1 to form the full path of the file to be deleted. The function checks for and collapses duplicated path separators when it combines PathPart1 and PathPart2.
Throws:
IOException

SetupQueueRename

protected void SetupQueueRename(int queuehandle,
                                String SourcePath,
                                String SourceFileName,
                                String TargetPath,
                                String TargetFileName)
                         throws IOException
Places an individual file rename operation on a setup file queue.

Parameters:
queuehandle - Handle to a setup file queue, as returned by SetupOpenFileQueue.
SourcePath - String that specifies the source path of the file to be renamed. If SourceFileName is not specified, SourcePath is assumed to be the full path.
SourceFileName - String that specifies the file name part of the file to be renamed. If not specified, SourcePath is the full path.
TargetPath - String that specifies the target directory. When this parameter is specified, the rename operation is actually a move operation. If TargetPath is not specified, the file is renamed but remains in its current location.
TargetFileName - String that specifies the new name for the source file.
Throws:
IOException

SetupCommitFileQueue

protected boolean SetupCommitFileQueue(int queuehandle)
                                throws IOException
Commits the actions stored in the file queue.

Parameters:
queuehandle - File queue handle
Returns:
If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero.
Throws:
IOException

SetupPromptReboot

protected int SetupPromptReboot(int queuehandle,
                                boolean scanonly)
                         throws IOException
Parameters:
queuehandle - Optional handle to a setup file queue upon which to base the decision about whether shutdown is necessary. If FileQueue is null, SetupPromptReboot assumes shutdown is necessary and asks the user what to do.
scanonly - Indicates whether or not to prompt the user when SetupPromptReboot is called. If TRUE, the user is never asked about rebooting, and system shutdown is not initiated. In this case, FileQueue must be specified. If FALSE, the user is asked about rebooting, as previously described. Use ScanOnly to determine if shutdown is necessary separately from actually initiating a shutdown.
Throws:
IOException


Copyright © 2018. All rights reserved.