nrvr.wins.win7.autounattend
index
/usr/lib/python2.7/site-packages/nrvr/wins/win7/autounattend.py

nrvr.wins.win7.autounattend - Create and manipulate Windows 7 installer autounattend.xml files
 
Classes provided by this module include
Win7UdfImage
Win7AutounattendFileContent
 
To be improved as needed.
 
Idea and first implementation - Leo Baschy <srguiwiz12 AT nrvr DOT com>
 
Public repository - https://github.com/srguiwiz/nrvr-commander
 
Copyright (c) Nirvana Research 2006-2015.
Simplified BSD License

 
Modules
       
nrvr
re

 
Classes
       
nrvr.wins.common.autounattend.InstallerAutounattendFileContent(__builtin__.object)
Win7AutounattendFileContent
nrvr.wins.common.autounattend.WinUdfImage(nrvr.diskimage.isoimage.IsoImage)
Win7UdfImage

 
class Win7AutounattendFileContent(nrvr.wins.common.autounattend.InstallerAutounattendFileContent)
    The text content of a Windows installer autounattend.xml file for use with a Windows 7 installer.
 
 
Method resolution order:
Win7AutounattendFileContent
nrvr.wins.common.autounattend.InstallerAutounattendFileContent
__builtin__.object

Methods defined here:
__init__(self, string)
Create new autounattend file content container.

Methods inherited from nrvr.wins.common.autounattend.InstallerAutounattendFileContent:
acceptEula(self, fullname, organization=None, productkey=None)
Accept software license terms.
 
fullname
    according to documentation should be name of the end user.
 
organization
    according to documentation should be name of the organization that owns the computer.
    
    Some value has to be provided.
    
    If None then default to fullname.
 
productkey
    according to documentation should be a product key.
    
    If None then do not change value.
    
    A product key contains settings that specify which edition to install.
    
    This probably is a legal matter and you may have to figure this out between yourself,
    the supplier of the operating system which you are installing, and counsel you may employ.
    
    Warnings aside, this could be quite simple.  Enterprises apparently have license agreements
    in place with the supplier of the operating system which you are installing.
    And, many computers are sold bundled with valid licenses already.
    And, licenses can be bought.
 
return
    self, for daisychaining.
addFirstLogonCommand(self, order, commandLine, description='')
Add a command to run the first time a user logs on to the computer.
 
This is to run a service or command that needs to finish before other commands can start, a synchronous command.
A synchronous command is run after logon but before the user sees the desktop.
 
order
    an integer from 1 through 500.
 
commandLine
    commandLine.
    
    Escapes '&', '<', and '>'.
 
description
    description.
    May be empty string.
    
    Escapes '&', '<', and '>'.
 
return
    self, for daisychaining.
addLocalAccount(self, username, pwd, fullname, groups)
Add a local account.
 
username
    username.
 
pwd
    password.
    May be empty string.
 
fullname
    full name.
 
groups
    a list of groups, e.g. ["Administrators"].
 
return
    self, for daisychaining.
addLogonCommand(self, order, commandLine, description='')
Add a command to run the first time a user logs on to the computer.
 
This is to run a service or command that can start at the same time as others, an asynchronous command.
 
order
    an integer from 1 through 500.
 
commandLine
    commandLine.
    
    Escapes '&', '<', and '>'.
 
description
    description.
    May be empty string.
    
    Escapes '&', '<', and '>'.
 
return
    self, for daisychaining.
addNetworkConfigurationStatic(self, mac, ipaddress, netmask='255.255.255.0', gateway=None, nameservers=None, limitRoutingToLocalByNetmask=False)
Add an additional network device with static IP.
 
As implemented only supports IPv4.
 
mac
    the MAC, e.g. "01:23:45:67:89:ab" or "01-23-45-67-89-AB".
 
ipaddress
    IP address.
 
netmask
    netmask.
    Defaults to 255.255.255.0.
 
gateway
    gateway.
    If None then default to ip.1.
 
nameservers
    one nameserver or a list of nameservers.
    If None then default to gateway.
    If empty list then do not add any.
 
return
    self, for daisychaining.
adjustFor32Bit(self)
Adjust for 32-bit.
 
return
    self, for daisychaining.
adjustFor64Bit(self)
Adjust for 32-bit.
 
return
    self, for daisychaining.
enableAutoLogon(self, username, pwd)
Enable automatic logon.
 
username
    username.
 
pwd
    password.
    May be empty string.
 
return
    self, for daisychaining.
replaceAdminPw(self, pwd)
Replace administrator password.
 
return
    self, for daisychaining.
replaceComputerName(self, computerName)
Replace computer name.
 
return
    self, for daisychaining.
replaceLanguageAndLocale(self, languageAndLocale)
Replace language and locale.
 
languageAndLocale
    e.g. "de-DE" to replace "en-US".
    
    As implemented does not do any sanity checking.
 
return
    self, for daisychaining.

Data descriptors inherited from nrvr.wins.common.autounattend.InstallerAutounattendFileContent:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
string
The whole content.

 
class Win7UdfImage(nrvr.wins.common.autounattend.WinUdfImage)
    A Windows 7 installer UDF DVD-ROM disk image.
 
 
Method resolution order:
Win7UdfImage
nrvr.wins.common.autounattend.WinUdfImage
nrvr.diskimage.isoimage.IsoImage
__builtin__.object

Methods defined here:
__init__(self, isoImagePath)
Create new Windows 7 installer Win7UdfImage descriptor.
 
A descriptor can describe an .iso image that does or doesn't yet exist on the host disk.

Methods inherited from nrvr.wins.common.autounattend.WinUdfImage:
cloneWithAutounattend(self, _autounattendFileContent, modifications=[], cloneIsoImagePath=None)
Clone with autounattend.xml file added and modified to automatically boot with it.
 
For more on behavior see documentation of class IsoImage method cloneWithModifications.
 
For details of modifications see method modificationsIncludingAutounattendFile,
which might be different per Windows version specific subclass.
 
_autounattendFileContent
    An InstallerAutounattendFileContent object.
    
    If None then proceed nevertheless.
 
modifications
    a list of additional IsoImageModification instances.
 
cloneIsoImagePath
    if not given then in same directory with a timestamp in the filename.
 
return
    IsoImage(cloneIsoImagePath).
cloneWithModifications(self, modifications=[], cloneIsoImagePath=None, udf=True, ignoreJoliet=False, pause=False)
Clone with any number of instances of IsoImageModification applied.
 
A temporary assembly directory in the same directory as cloneIsoImagePath needs disk space,
but it is removed automatically upon completion of cloning.
 
modifications
    a list of IsoImageModification instances.
 
cloneIsoImagePath
    if not given then in same directory with a timestamp in the filename.
 
return
    WinUdfImage(cloneIsoImagePath).
genisoimageOptions(self, bootImage='boot.bin', label=None, udf=True, ignoreJoliet=False)
Auxiliary method, called by cloneWithModifications.
 
Can be overridden by subclass methods genisoimageOptions,
which may want to extend the returned list.
 
Could be improved in the future.
Could recognize content of .iso image.
Could select different options depending on content of .iso image.
Maybe could use iso-info -d 9 -i self.isoImagePath.
Could be overridden for a subclass.
modificationForElToritoBootImage(self)
Construct and return an instance of IsoImageModification, to be processed
by method cloneWithModifications.
 
As implemented copies El Torito boot image from sectors into a file.
modificationMakeEiCfg(self, editionId, oem=False, volumeLicense=False)
Construct and return an instance of IsoImageModification, to be processed
by method cloneWithModifications.
 
As implemented writes a new sources/ei.cfg file from scratch.
 
editionId
    a string.
    For Windows 7 one of "Starter", "HomeBasic", "HomePremium", "Professional", "Ultimate", "Enterprise".
    For Windows 8 one of "Core", "Professional", "ProfessionalWMC", "Enterprise".
modificationsIncludingAutounattendFile(self, _autounattendFileContent)
Construct and return a list of modifications to be passed to method cloneWithModifications.
 
This method is called by method cloneWithAutounattend, which takes the returned list
and passes it to method cloneWithModifications.
 
Subclasses may provide further implementations of this method.
Possibly different per Windows version specific subclass.
This class implementation does return an essential list.
 
_autounattendFileContent
    An InstallerAutounattendFileContent object.
    
    If None then proceed nevertheless.
 
Return a list of modifications which will be passed to method cloneWithModifications.

Class methods inherited from nrvr.wins.common.autounattend.WinUdfImage:
commandsUsedInImplementation(cls) from __builtin__.type
Return a list to be passed to SystemRequirements.commandsRequired().
 
This class can be passed to SystemRequirements.commandsRequiredByImplementations().

Methods inherited from nrvr.diskimage.isoimage.IsoImage:
cloneWithModificationsUsingMount(self, modifications=[], cloneIsoImagePath=None, udf=False, ignoreJoliet=True, pause=False)
Clone with any number of instances of IsoImageModification applied.
 
This is an older implementation which regrettably because of the mount command requires
having superuser privileges.
It is still here in case a newer implementation doesn't work right, which could be for any
of a number of reasons, for example for symbolic links.
 
A temporary assembly directory in the same directory as cloneIsoImagePath needs disk space,
but it is removed automatically upon completion of cloning.
 
modifications
    a list of IsoImageModification instances.
 
cloneIsoImagePath
    if not given then in same directory with a timestamp in the filename.
 
return
    IsoImage(cloneIsoImagePath).
copyToDirectory(self, copyDirectory, udf=False, ignoreJoliet=True, tolerance=0.0)
Copy all files into a directory.
 
Not using mount command, no need to run as root.
exists(self)
Return True if .iso image exists on the host disk.
mount(self, mountDir, udf=False)
Mount .iso image.
remove(self)
Remove (delete) .iso image from the host disk.
unmount(self)
Unmount .iso image.

Data descriptors inherited from nrvr.diskimage.isoimage.IsoImage:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
isoImagePath
Path of the .iso image.