1. Alex Willmer
  2. trac-ticketlinks

Source

trac-ticketlinks / setup.py

Diff from to

File setup.py

  • Ignore whitespace
                 if not self.dry_run:
                     mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777
                     os.chmod(file, mode)
+        elif os.name == 'nt':
+            # Install post-install script on windows
+            ofile, copied = self.copy_file(os.path.join(self.build_dir,
+                                                        'trac-postinstall.py'),
+                                            self.install_dir)
+            if copied:
+                self.outfiles.append(ofile)
 
 
 class my_install_data (install_data):
 class my_bdist_wininst(bdist_wininst):
     def initialize_options(self):
         bdist_wininst.initialize_options(self)
-        self.title = "Trac %s" % VERSION
-        self.bitmap = "setup_wininst.bmp"
+        self.title = 'Trac %s' % VERSION
+        self.bitmap = 'setup_wininst.bmp'
+        self.install_script = 'trac-postinstall.py'
 distutils.command.bdist_wininst.bdist_wininst = my_bdist_wininst
 
 
                   (_p('share/man/man1'), glob(_p('scripts/*.1'))),
                   (_p('share/trac/wiki-default'), glob(_p('wiki-default/[A-Z]*')))],
       scripts=[_p('scripts/trac-admin'),
+               _p('scripts/trac-postinstall.py'),
                _p('scripts/tracd'),
                _p('scripts/tracdb2env'),
                _p('cgi-bin/trac.cgi')],