# install

Installation script for the eric6 IDE and all eric6 related tools.

### Global Attributes

BlackLists
PlatformsBlackLists
apisDir
cfg
configLength
configName
currDir
defaultMacAppBundleName
defaultMacAppBundlePath
defaultMacPythonExe
distDir
doCleanDesktopLinks
doCleanup
doCompile
eric6SourceDir
forceCleanDesktopLinks
installApis
macAppBundleName
macAppBundlePath
macPythonExe
modDir
platBinDir
platBinDirOld
progLanguages
progName
pyModDir
sourceDir

### Classes

None

### Functions

__pyName | Local function to create the Python source file name for the compiled .ui file.
cleanUp | Uninstall the old eric files.
cleanUpLinuxSpecifics | Clean up Linux specific files.
cleanUpMacAppBundle | Uninstall the macOS application bundle.
cleanUpWindowsLinks | Clean up the Desktop and Start Menu entries for Windows.
cleanupSource | Cleanup the sources directory to get rid of leftover files and directories.
compileUiFiles | Compile the .ui files to Python sources.
copyAppStreamFile | Modify an appstream file and write it to its destination.
copyDesktopFile | Modify a desktop file and write it to its destination.
copyToFile | Copy a string to a file.
copyTree | Copy Python, translation, documentation, wizards configuration, designer template files and DTDs of a directory tree.
createConfig | Create a config file with the respective config entries.
createGlobalPluginsDir | Create the global plugins directory, if it doesn't exist.
createInstallConfig | Create the installation config dictionary.
createLinuxSpecifics | Install Linux specific files.
createMacAppBundle | Create a Mac application bundle.
createPyWrapper | Create an executable wrapper for a Python script.
createWindowsLinks | Create Desktop and Start Menu links.
createWindowsShortcut | Create Windows shortcut.
doDependancyChecks | Perform some dependency checks.
exit | Exit the install script.
getWinregEntry | Function to get an entry from the Windows Registry.
initGlobals | Module function to set the values of globals that need more than a simple assignment.
installEric | Actually perform the installation steps.
main | The main function of the script.
pipInstall | Install the given package via pip.
prepareInfoFile | Function to prepare an Info.py file when installing from source.
shutilCopy | Wrapper function around shutil.copy() to ensure the permissions.
usage | Display a usage message and exit.
windowsDesktopEntries | Function to generate data for the Windows Desktop links.
windowsDesktopNames | Function to generate the link names for the Windows Desktop.
windowsProgramsEntry | Function to generate the name of the Start Menu top entry.
wrapperNames | Create the platform specific names for the wrapper script.

## __pyName

__pyName(py_dir, py_file)

Local function to create the Python source file name for the compiled .ui file.

py_dir
  suggested name of the directory (string)
py_file
  suggested name for the compile source file (string)

Returns:
  tuple of directory name (string) and source file name (string)

Up

## cleanUp

cleanUp()

Uninstall the old eric files.

Up

## cleanUpLinuxSpecifics

cleanUpLinuxSpecifics()

Clean up Linux specific files.

Up

## cleanUpMacAppBundle

cleanUpMacAppBundle()

Uninstall the macOS application bundle.

Up

## cleanUpWindowsLinks

cleanUpWindowsLinks()

Clean up the Desktop and Start Menu entries for Windows.

Up

## cleanupSource

cleanupSource(dirName)

Cleanup the sources directory to get rid of leftover files and directories.

dirName
  name of the directory to prune (string)

Up

## compileUiFiles

compileUiFiles()

Compile the .ui files to Python sources.

Up

## copyAppStreamFile

copyAppStreamFile(src, dst)

Modify an appstream file and write it to its destination.

src
  source file name (string)
dst
  destination file name (string)

Up

## copyDesktopFile

copyDesktopFile(src, dst)

Modify a desktop file and write it to its destination.

src
  source file name (string)
dst
  destination file name (string)

Up

## copyToFile

copyToFile(name, text)

Copy a string to a file.

name
  the name of the file.
text
  the contents to copy to the file.

Up

## copyTree

copyTree(src, dst, filters, excludeDirs=None, excludePatterns=None)

Copy Python, translation, documentation, wizards configuration, designer template files and DTDs of a directory tree.

src
  name of the source directory
dst
  name of the destination directory
filters
  list of filter pattern determining the files to be copied
excludeDirs
  list of (sub)directories to exclude from copying
excludePatterns=
  list of filter pattern determining the files to be skipped

Up

## createConfig

createConfig()

Create a config file with the respective config entries.

Up

## createGlobalPluginsDir

createGlobalPluginsDir()

Create the global plugins directory, if it doesn't exist.

Up

## createInstallConfig

createInstallConfig()

Create the installation config dictionary.

Up

## createLinuxSpecifics

createLinuxSpecifics()

Install Linux specific files.

Up

## createMacAppBundle

createMacAppBundle(pydir)

Create a Mac application bundle.

pydir (str)
  the name of the directory where the Python script will eventually be installed

Up

## createPyWrapper

createPyWrapper(pydir, wfile, saveDir, isGuiScript=True)

Create an executable wrapper for a Python script.

pydir
  the name of the directory where the Python script will eventually be installed (string)
wfile
  the basename of the wrapper (string)
saveDir
  directory to save the file into (string)
isGuiScript
  flag indicating a wrapper script for a GUI application (boolean)

Returns:
  the platform specific name of the wrapper (string)

Up

## createWindowsLinks

createWindowsLinks()

Create Desktop and Start Menu links.

Up

## createWindowsShortcut

createWindowsShortcut(linkPath, targetPath, iconPath)

Create Windows shortcut.

linkPath (str)
  path of the shortcut file
targetPath (str)
  path the shortcut shall point to
iconPath (str)
  path of the icon file

Up

## doDependancyChecks

doDependancyChecks()

Perform some dependency checks.

Up

## exit

exit(rcode=0)

Exit the install script.

rcode
  result code to report back (integer)

Up

## getWinregEntry

getWinregEntry(name, path)

Function to get an entry from the Windows Registry.

name (str)
  variable name
path (str)
  registry path of the variable

Returns:
  value of requested registry variable

Return Type:
  any

Up

## initGlobals

initGlobals()

Module function to set the values of globals that need more than a simple assignment.

Up

## installEric

installEric()

Actually perform the installation steps.

Returns:
  result code (integer)

Up

## main

main(argv)

The main function of the script.

argv (list of str)
  list of command line arguments

Up

## pipInstall

pipInstall(packageName, message)

Install the given package via pip.

packageName (str)
  name of the package to be installed
message (str)
  message to be shown to the user

Returns:
  flag indicating a successful installation

Return Type:
  bool

Up

## prepareInfoFile

prepareInfoFile(fileName)

Function to prepare an Info.py file when installing from source.

fileName
  name of the Python file containing the info (string)

Up

## shutilCopy

shutilCopy(src, dst, perm=0o644)

Wrapper function around shutil.copy() to ensure the permissions.

src
  source file name (string)
dst
  destination file name or directory name (string)
perm=
  permissions to be set (integer)

Up

## usage

usage(rcode=2)

Display a usage message and exit.

rcode
  the return code passed back to the calling process.

Up

## windowsDesktopEntries

windowsDesktopEntries()

Function to generate data for the Windows Desktop links.

Returns:
  list of tuples containing the desktop link name, the link target and the icon target

Return Type:
  list of tuples of (str, str, str)

Up

## windowsDesktopNames

windowsDesktopNames()

Function to generate the link names for the Windows Desktop.

Returns:
  list of desktop link names

Return Type:
  list of str

Up

## windowsProgramsEntry

windowsProgramsEntry()

Function to generate the name of the Start Menu top entry.

Returns:
  name of the Start Menu top entry

Return Type:
  str

Up

## wrapperNames

wrapperNames(dname, wfile)

Create the platform specific names for the wrapper script.

dname
  name of the directory to place the wrapper into
wfile
  basename (without extension) of the wrapper script

Returns:
  the names of the wrapper scripts

Up