[Spambayes-checkins] spambayes/Outlook2000/installer .cvsignore,NONE,1.1 README.txt,NONE,1.1 spambayes_addin.iss,NONE,1.1 spambayes_addin.py,NONE,1.1 spambayes_addin.spec,NONE,1.1

Mark Hammond mhammond at users.sourceforge.net
Thu Feb 20 00:16:33 EST 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000/installer
In directory sc8-pr-cvs1:/tmp/cvs-serv23436

Added Files:
	.cvsignore README.txt spambayes_addin.iss spambayes_addin.py 
	spambayes_addin.spec 
Log Message:
First checkin of utilities for a stand-alone distribution.


--- NEW FILE: .cvsignore ---
SpamBayes-Outlook-Setup.exe
buildspambayes_addin
dist
warnspambayes_addin.txt

--- NEW FILE: README.txt ---
This directory contains scripts for the McMillan
Installer, and the Inno Setup Script.  Executing:

{Installer}\Build.py spambayes_addin.spec

Will create 'dist' and 'build_spambayes' directories.

Inno setup then is used to create the installation EXE.
--- NEW FILE: spambayes_addin.iss ---
;
; Inno Setup 3.x setup file for the Spambayes Outlook Addin
;

[Setup]
AppName=Spambayes Outlook Addin
AppVerName=Spambayes Outlook Addin 0.0.1
AppVersion=0.0.1
DefaultDirName={pf}\Spambayes Outlook Addin
DefaultGroupName=Spambayes Outlook Addin
OutputDir=.
OutputBaseFilename=SpamBayes-Outlook-Setup

[Files]
Source: "dist\spambayes_addin.dll"; DestDir: "{app}"; Flags: ignoreversion regserver
Source: "dist\*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs

[UninstallDelete]
Type: filesandordirs; Name: "{app}\support"


--- NEW FILE: spambayes_addin.py ---
import sys
import string
import os

import pythoncom
pythoncom.frozen = 1

inprocess = getattr(sys, 'frozen', None)

import addin
klasses = (addin.OutlookAddin,)

def DllRegisterServer():
    import win32com.server.register
    win32com.server.register.RegisterClasses(*klasses)
    addin.RegisterAddin(addin.OutlookAddin)
    return 0

def DllUnregisterServer():
    import win32com.server.register
    win32com.server.register.UnregisterClasses(*klasses)
    addin.UnregisterAddin(addin.OutlookAddin)
    return 0

if sys.frozen!="dll":
    import win32com.server.localserver
    for i in range(1, len(sys.argv)):
        arg = string.lower(sys.argv[i])
        if string.find(arg, "/reg") > -1 or string.find(arg, "--reg") > -1:
            DllRegisterServer()
            break

        if string.find(arg, "/unreg") > -1 or string.find(arg, "--unreg") > -1:
            DllUnregisterServer()
            break
        
        # MS seems to like /automate to run the class factories.
        if string.find(arg, "/automate") > -1:
            clsids = []
            for k in klasses:
                clsids.append(k._reg_clsid_)
            win32com.server.localserver.serve(clsids)
            break
    else:
        # You could do something else useful here.
        import win32api
        win32api.MessageBox(0, "This program hosts a COM Object and\r\nis started automatically", "COM Object")

--- NEW FILE: spambayes_addin.spec ---
#
# Specification file for Installer to construct an installable version of
# the Spambayes Outlook Addin
#
from os.path import basename, abspath, join

debug = 0

INSTALLER_ROOT = HOMEPATH
PROJECT_ROOT=".."

# Extra files we need - docs, images, etc.
extras = []
# All files in the image directory.
import glob
for fname in glob.glob(PROJECT_ROOT + "/images/*"):
    if os.path.isfile(fname):
        extras.append( ("images/"+basename(fname), abspath(fname), 'DATA') )
# docs
extras.append( ("about.html", join(PROJECT_ROOT, "about.html"), 'DATA') )
# config
extras.append( ("default_bayes_customize.ini", join(PROJECT_ROOT, "default_bayes_customize.ini"), 'DATA') )

excludes = ['timer', 'dde', 'win32help']

a = Analysis([INSTALLER_ROOT+'/support/_mountzlib.py',
              INSTALLER_ROOT+'/support/useUnicode.py',
              'spambayes_addin.py'],
             excludes = excludes, 
             pathex=[PROJECT_ROOT,os.path.join(PROJECT_ROOT, '..')])
pyz = PYZ(a.pure)
#exe = EXE(pyz,
#          a.scripts,
#          exclude_binaries=1,
#          name='buildspambayes_addin/spambayes_addin.exe',
#          debug=0,
#          strip=0,
#          console=0 )

dll = DLL(pyz,
          a.scripts,
          exclude_binaries=1,
          name='buildspambayes_addin/spambayes_addin.dll',
          debug=debug)
coll = COLLECT(dll,
               a.binaries + extras - [('MAPI32.dll','','')],
               strip=0,
               debug=debug,
               name='dist')





More information about the Spambayes-checkins mailing list