|
install4j API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.install4j.api.windows.WinFileSystem
public class WinFileSystem
Collection of static methods to access Microsoft Windows-specific folder locations and to execute native file system operations.
Method Summary | |
---|---|
static boolean |
createShellLink(java.io.File file,
java.io.File shortcutTo,
java.io.File iconFile)
Creates a shell link. |
static boolean |
createShellLink(java.io.File file,
java.io.File shortcutTo,
java.io.File iconFile,
java.lang.String arguments)
Creates a shell link. |
static boolean |
createShellLink(java.io.File file,
java.io.File shortcutTo,
java.io.File iconFile,
java.lang.String arguments,
java.lang.String description)
Creates a shell link. |
static void |
createStartMenuEntry(java.lang.String programGroupName,
java.lang.String entryName,
java.io.File destination,
boolean allUsers,
java.io.File icon)
Creates a start menu entry. |
static java.io.File |
getCommonFilesDirectory()
Returns a folder for components that are shared across applications. |
static java.io.File |
getProgramFilesDirectory()
Returns the program files directory of the current Windows installation. |
static java.io.File |
getSpecialFolder(SpecialFolder folderType,
boolean allUsers)
Returns Windows-specific directories like the start menu or the desktop. |
static java.io.File |
getSystemDirectory()
Returns the system directory. |
static java.io.File |
getWindowsDirectory()
Returns the Windows directory. |
static boolean |
moveWithDelayUntilReboot(java.io.File source,
java.io.File destination)
Calls the win32 API function MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.io.File getSpecialFolder(SpecialFolder folderType, boolean allUsers)
folderType
- specifies the requested folder type.allUsers
- if this parameter is true and if the current user is in the
Administrators group, the method returns the requested folder for all users.
Otherwise it returns the folder for the current user.
public static java.io.File getProgramFilesDirectory()
public static java.io.File getCommonFilesDirectory()
public static java.io.File getWindowsDirectory()
public static java.io.File getSystemDirectory()
public static boolean createShellLink(java.io.File file, java.io.File shortcutTo, java.io.File iconFile)
file
- the shell link that should be created inluding the lnk suffix.shortcutTo
- the file it should link to.iconFile
- an optional icon file. If null is passed, the default icon of the
shortcutTo target will be used.
createShellLink(java.io.File, java.io.File, java.io.File, String)
public static boolean createShellLink(java.io.File file, java.io.File shortcutTo, java.io.File iconFile, java.lang.String arguments)
file
- the shell link that should be created inluding the lnk suffix.shortcutTo
- the file it should link to.iconFile
- an optional icon file. If null is passed, the default icon of the
shortcutTo target will be used.arguments
- the arguments passed to the target.
public static boolean createShellLink(java.io.File file, java.io.File shortcutTo, java.io.File iconFile, java.lang.String arguments, java.lang.String description)
file
- the shell link that should be created inluding the lnk suffix.shortcutTo
- the file it should link to.iconFile
- an optional icon file. If null is passed, the default icon of the
shortcutTo target will be used.arguments
- the arguments passed to the target.description
- the description used in the tooltip
public static void createStartMenuEntry(java.lang.String programGroupName, java.lang.String entryName, java.io.File destination, boolean allUsers, java.io.File icon) throws java.io.IOException
programGroupName
- the name of the program group where the entry should be createdentryName
- the name of the menu entry. You can create subfolders with backslashes.destination
- the file that should be linked toallUsers
- whether the entry should be created for all users or noticon
- an optional icon file. If null is passed, the default icon of the
destination target will be used.
java.io.IOException
- if the start menu entry could not be createdpublic static boolean moveWithDelayUntilReboot(java.io.File source, java.io.File destination)
source
- the source file. Must be on the same drive as the destination file.destination
- the destination file. If empty, the source file will be deleted.
|
install4j API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |