Browse Source

Adding README to installer.

Dan Helfman 9 years ago
parent
commit
c9b4cf35a1
3 changed files with 27 additions and 5 deletions
  1. 2
    0
      .hgignore
  2. 0
    2
      README
  3. 25
    3
      setup.py

+ 2
- 0
.hgignore View File

@@ -5,6 +5,8 @@ syntax: glob
5 5
 luminotes.log
6 6
 luminotes_error.log
7 7
 luminotes.db
8
+README.txt
9
+COPYING.txt
8 10
 session/*
9 11
 files/*
10 12
 build/*

+ 0
- 2
README View File

@@ -8,8 +8,6 @@ and even includes some tips on creating your wiki. You can check it out at:
8 8
 
9 9
   http://luminotes.com/guide
10 10
 
11
-If you'd like to actually install the Luminotes server, see the INSTALL file.
12
-
13 11
 Enjoy!
14 12
 
15 13
 Luminotes Copyright (C) 2007-2008 Dan Helfman

+ 25
- 3
setup.py View File

@@ -94,11 +94,15 @@ class InnoScript:
94 94
     print >> ofi, r"DefaultDirName={pf}\%s" % self.name
95 95
     print >> ofi, r"DefaultGroupName=%s" % self.name
96 96
     print >> ofi, r"SetupIconFile=static\images\luminotes.ico"
97
+    print >> ofi, r"UninstallIconFile=static\images\luminotes.ico"
97 98
     print >> ofi
98 99
 
99 100
     print >> ofi, r"[Files]"
100 101
     for path in self.windows_exe_files + self.lib_files:
101
-      print >> ofi, r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion' % (path, os.path.dirname(path))
102
+      if "readme" in path.lower():
103
+        print >> ofi, r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion isreadme' % (path, os.path.dirname(path))
104
+      else:
105
+        print >> ofi, r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion' % (path, os.path.dirname(path))
102 106
     print >> ofi
103 107
 
104 108
     print >> ofi, r"[Icons]"
@@ -148,10 +152,10 @@ try:
148 152
   import py2exe
149 153
   from py2exe.build_exe import py2exe
150 154
 
151
-  class Build_installer(py2exe):
155
+  class Build_installer( py2exe ):
152 156
     # This class first builds the exe file(s), then creates a Windows installer.
153 157
     # You need InnoSetup for it.
154
-    def run(self):
158
+    def run( self ):
155 159
       # generate an initial database file
156 160
       try:
157 161
         os.remove( "luminotes.db" )
@@ -161,6 +165,10 @@ try:
161 165
       from tools import initdb
162 166
       initdb.main( ( "-l", ) )
163 167
 
168
+      # copy the README and COPYING files to have ".txt" extensions and Windows newlines
169
+      self.copy_doc( "README" )
170
+      self.copy_doc( "COPYING" )
171
+
164 172
       # First, let py2exe do it's work.
165 173
       py2exe.run(self)
166 174
 
@@ -179,6 +187,17 @@ try:
179 187
       print "*** compiling the inno setup script***"
180 188
       script.compile()
181 189
       # Note: By default the final setup.exe will be in an Output subdirectory.
190
+
191
+    @staticmethod
192
+    def copy_doc( path ):
193
+      out = file( "%s.txt" % path, "w" )
194
+
195
+      for line in file( path ).readlines():
196
+        line = line.rstrip( "\r\n" )
197
+        out.write( "%s\r\n" % line )
198
+
199
+      out.close()
200
+
182 201
 except ImportError:
183 202
   class Build_installer:
184 203
     pass
@@ -194,6 +213,8 @@ setup(
194 213
   distclass = Luminotes,
195 214
   cmdclass = { "py2exe": Build_installer }, # override default py2exe class
196 215
   data_files = [
216
+    ( "", [ "README.txt", ] ),
217
+    ( "", [ "COPYING.txt", ] ),
197 218
     ( "", [ "luminotes.db", ] ),
198 219
     ( "static/css", files( "static/css/*.*" ) ),
199 220
     ( "static/html", files( "static/html/*.*" ) ),
@@ -201,6 +222,7 @@ setup(
201 222
     ( "static/images/toolbar", files( "static/images/toolbar/*.*" ) ),
202 223
     ( "static/images/toolbar/small", files( "static/images/toolbar/small/*.*" ) ),
203 224
     ( "static/js", files( "static/js/*.*" ) ),
225
+    ( "static/js", files( "static/js/*_LICENSE" ) ),
204 226
     ( "files", files( "files/.empty" ) ),
205 227
   ],
206 228
   options = dict(