Index: trunk/setup.py
===================================================================
--- trunk/setup.py (revision 4357)
+++ trunk/setup.py (revision 4366)
@@ -38,11 +38,13 @@
 from install_scripts.common import BIN_DIRNAME, PIXMAPS_DIR, ICONS_DIR, \
         BASE_DOCS_DIR, DOCS_DIR, LOCALE_DIR, CONFIG_DIR, MISC_DIR, SQL_DIR
-
-py2exe_cmdclass = py2exe_options = py2app_options = None
+from install_scripts import common
+
+py2exe_cmdclass = py2exe_options = py2app_options = revert_rename = None
 if 'py2exe' in sys.argv:
     from install_scripts.windows.py2exe_setup import py2exe_cmdclass, \
             py2exe_options
 if 'py2app' in sys.argv:
-    from install_scripts.macosx.py2app_setup import py2app_options
+    from install_scripts.macosx.py2app_setup import py2app_options, \
+            revert_rename
 
 
@@ -386,5 +388,5 @@
         version = VERSION,
         scripts = [
-            os.path.join(BIN_DIRNAME, 'umit'),
+            common.UMIT_MAIN,
             os.path.join(BIN_DIRNAME, 'umit_scheduler.py')],
         packages = [
@@ -415,3 +417,7 @@
     options.update(py2app_options)
 
-setup(**options)
+try:
+    setup(**options)
+finally:
+    if revert_rename:
+        revert_rename()
