From: Thomas H. <tho...@io...> - 2002-10-25 12:36:08
|
"Kevin Altis" <al...@se...> writes: > I've uploaded a new 0.6.9 Windows binary installer, replacing the old one. > The new version is identical except for a change to the > propertyEditor.rsrc.py file mentioned earlier and an install-pythoncard.py > script that should work on Win95, Win98, and WinME systems (fingers > crossed). Please report any problems. If there are none, I will upload > source .zip and tar.gz files tomorrow. > It creates shortcuts under Win98 SE, which I have here, but they don't work. The problem seems to be that the create_shortcut function doesn't like paths containing forward slashes as separators like these: target = os.path.join(lib_dir, "PythonCardPrototype/samples/samples.py") they work fine under Win2000, but on win98 it seems target = os.path.join(lib_dir, "PythonCardPrototype\\samples\\samples.py") is required. > Thanks again to Thomas Heller for all his help! > > ka I would like to thank *you* for the help in testing out the new bdist_wininst version. Thomas Here is the final script you should probably use, I've *tested* it under Win2000 and Win98 Second Edition: ----- install-pythoncard.py ----- """ __version__ = "$Revision: 1.2 $" __date__ = "$Date: 2002/10/24 23:13:10 $" """ # THIS FILE IS ONLY FOR USE WITH MS WINDOWS # It is run as parts of the bdist_wininst installer # Be sure to build the installer with # 'python setup.py --install-script=install-pythoncard.py' # or insert this into setup.cfg: # [bdist_wininst] # install-script=install-pythoncard.py import sys, os from distutils.sysconfig import get_python_lib if sys.platform[:3] != 'win': sys.exit() try: prg = get_special_folder_path("CSIDL_COMMON_PROGRAMS") except OSError: try: prg = get_special_folder_path("CSIDL_PROGRAMS") except OSError, reason: # give up - cannot install shortcuts print "cannot install shortcuts: %s" % reason sys.exit() lib_dir = get_python_lib(plat_specific=1) dest_dir = os.path.join(prg, "PythonCard") pythonw = os.path.join(sys.prefix, "pythonw.exe") if __name__ == '__main__': if "-install" == sys.argv[1]: try: os.mkdir(dest_dir) directory_created(dest_dir) except OSError: pass # create_shortcut(target, description, filename[, arguments[, \ # workdir[, iconpath[, iconindex]]]]) # file_created(path) # - register 'path' so that the uninstaller removes it # directory_created(path) # - register 'path' so that the uninstaller removes it # get_special_folder_location(csidl_string) target = os.path.join(lib_dir, "PythonCardPrototype\\samples\\samples.py") path = os.path.join(dest_dir, "Sample Launcher.lnk") create_shortcut(target, "Sample Launcher", path) file_created(path) path = os.path.join(dest_dir, "Resource Editor.lnk") arguments = os.path.join(lib_dir, "PythonCardPrototype\\tools\\resourceEditor\\resourceEditor.py") create_shortcut(pythonw, "Resource Editor", path, arguments) file_created(path) path = os.path.join(dest_dir, "Code Editor.lnk") arguments = os.path.join(lib_dir, "PythonCardPrototype\\tools\\codeEditor\\codeEditor.py") create_shortcut(pythonw, "Code Editor", path, arguments) file_created(path) path = os.path.join(dest_dir, "Find Files.lnk") arguments = os.path.join(lib_dir, "PythonCardPrototype\\tools\\findfiles\\findfiles.py") create_shortcut(pythonw, "Find Files", path, arguments) file_created(path) target = os.path.join(lib_dir, "PythonCardPrototype\\docs\\html\\index.html") path = os.path.join(dest_dir, "Documentation.lnk") create_shortcut(target, "Documentation", path) file_created(path) target = os.path.join(sys.prefix, "RemovePythonCardPrototype.exe") path = os.path.join(dest_dir, "Uninstall PythonCardPrototype.lnk") arguments = "-u " + os.path.join(sys.prefix, "PythonCardPrototype-wininst.log") create_shortcut(target, "Uninstall PythonCardPrototype", path, arguments) file_created(path) print "See the shortcuts installed in the PythonCard Programs Group" elif "-remove" == sys.argv[1]: pass ----- EOF ----- |