Exemple #1
0
def die(message):
    message = "%s.\n\nThere may be useful diagnostic information in /var/log/install.log." % message
    alertDialog.show(message, 'Installation Failed')
Exemple #2
0
PACKAGE_PATH = sys.argv[1]
print "PACKAGE_PATH: %s" % PACKAGE_PATH
PLONE_HOME = sys.argv[2]
print "PLONE_HOME: %s" % PLONE_HOME

# Find Base Resources directory
BASE_RESOURCES = os.path.normpath( 
    os.path.join(PACKAGE_PATH, '../pythonZopePloneBase.pkg/Contents/Resources')  
  )
print "BASE_RESOURCES: %s" % BASE_RESOURCES
# add it to the python path
sys.path.insert(1, BASE_RESOURCES)
import alertDialog


if os.path.exists(PLONE_HOME) and \
   not os.access(PLONE_HOME, os.W_OK | os.X_OK):
    alertDialog.show(PLONE_HOME_EXISTS % PLONE_HOME, ABORT_TITLE)
    exit(1)    
    

if PACKAGE_PATH.endswith('standaloneZope.pkg') or PACKAGE_PATH.endswith('standaloneZope-1.pkg'):
     installMode = 'standalone'
     destination = os.path.join(PLONE_HOME, 'zinstance')
elif PACKAGE_PATH.endswith('zeoCluster.pkg') or PACKAGE_PATH.endswith('zeoCluster-1.pkg'):
     installMode = 'zeo'
     destination = os.path.join(PLONE_HOME, 'zeocluster')

if os.path.exists(destination):
    alertDialog.show(INSTANCE_EXISTS % destination, ABORT_TITLE)
    sys.exit(1)