[pywin32-checkins] pywin32 pywin32_postinstall.py,1.3,1.4
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <th...@us...> - 2003-12-03 08:20:19
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1:/tmp/cvs-serv11275 Modified Files: pywin32_postinstall.py Log Message: Add some notes about how this script is run from inside bdist_wininst. And accept the '-remove' command line argument, otherwise uninstallation will fail. Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pywin32_postinstall.py 1 Dec 2003 10:13:25 -0000 1.3 --- pywin32_postinstall.py 3 Dec 2003 08:20:12 -0000 1.4 *************** *** 19,24 **** verbose = 1 ! def file_created(file): ! pass def AbortRetryIgnore(desc, func, *args): --- 19,34 ---- verbose = 1 ! try: ! # When this script is run from inside the bdist_wininst installer, ! # file_created() and directory_created() are additional builtin ! # functions which write lines to Python23\pywin32-install.log. This is ! # a list of actions for the uninstaller, the format is inspired by what ! # the Wise installer also creates. ! file_created ! except NameError: ! def file_created(file): ! pass ! def directory_created(directory): ! pass def AbortRetryIgnore(desc, func, *args): *************** *** 135,138 **** --- 145,149 ---- if verbose: print "Creating directory", make_dir + directory_created(make_dir) os.mkdir(make_dir) *************** *** 154,157 **** --- 165,177 ---- print msg.strip() % os.path.basename(sys.argv[0]) + # NOTE: If this script is run from inside the bdist_wininst created + # binary installer or uninstaller, the command line args are either + # '-install' or '-remove'. + + # Important: From inside the binary installer this script MUST NOT + # call sys.exit() or raise SystemExit, otherwise not only this script + # but also the installer will terminate! (Is there a way to prevent + # this from the bdist_wininst C code?) + if __name__=='__main__': if len(sys.argv)==1: *************** *** 178,181 **** --- 198,203 ---- elif arg == "-quiet": verbose = 0 + elif arg == "-remove": + break # we do nothing for now else: print "Unknown option:", arg |