Got frozen windows build working again

git-svn-id: http://comictagger.googlecode.com/svn/trunk@458 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
beville@gmail.com 2013-02-07 04:50:10 +00:00
parent 811759478a
commit 9d56a2ce9a
3 changed files with 13 additions and 25 deletions

View File

@ -37,25 +37,22 @@ class ComicTaggerSettings:
@staticmethod
def baseDir():
if platform.system() == "Darwin" and getattr(sys, 'frozen', None):
return sys._MEIPASS
if getattr(sys, 'frozen', None):
if platform.system() == "Darwin":
return sys._MEIPASS
else: # Windows
return os.path.dirname( os.path.abspath( sys.argv[0] ) )
else:
#return os.path.dirname( os.path.abspath( sys.argv[0] ) )
#return os.path.dirname( os.path.realpath(sys.argv[0] ) )
return os.path.dirname( os.path.abspath( __file__) )
@staticmethod
def getGraphic( filename ):
graphic_folder = os.path.join(ComicTaggerSettings.baseDir(), '..', 'graphics')
if not os.path.exists(graphic_folder):
graphic_folder = os.path.join(ComicTaggerSettings.baseDir(), 'graphics')
graphic_folder = os.path.join(ComicTaggerSettings.baseDir(), 'graphics')
return os.path.join( graphic_folder, filename )
@staticmethod
def getUIFile( filename ):
ui_folder = os.path.join(ComicTaggerSettings.baseDir(), '..', 'ui')
if not os.path.exists(ui_folder):
ui_folder = os.path.join(ComicTaggerSettings.baseDir(), 'ui')
ui_folder = os.path.join(ComicTaggerSettings.baseDir(), 'ui')
return os.path.join( ui_folder, filename )
def setDefaultValues( self ):

View File

@ -2,15 +2,6 @@
from distutils.core import setup
import distutils.command.install_scripts
#import os
#import shutil
# Things are weird if the script has a py. Will this break things for windows???
#if not os.path.exists('scripts/comictagger'):
# if not os.path.exists('scripts'):
# os.makedirs('scripts')
# shutil.copyfile('comictagger.py', 'scripts/comictagger')
setup(name = "comictagger",
version = "1.1.1",

View File

@ -2,21 +2,21 @@
# rm, cp, grep, cut, cat
TAGGER_BASE:= c:\Users\tony\Dropbox\tagger\comictagger
TAGGER_SRC := $(TAGGER_BASE)\src
TAGGER_SRC := $(TAGGER_BASE)\comictaggerlib
DIST_DIR := $(TAGGER_BASE)\windows\dist
NSIS_CMD := "C:\Program Files (x86)\NSIS\makensis.exe"
VERSION := $(shell grep version "$(TAGGER_BASE)\ctversion.py" | cut -d= -f2)
VERSION := $(shell grep version "$(TAGGER_SRC)\ctversion.py" | cut -d= -f2)
all: clean dist package
dist:
cd "$(TAGGER_BASE)" &
"C:\Python27\Scripts\cxfreeze.bat" $(TAGGER_SRC)\comictagger.py --icon nsis\app.ico
"C:\Python27\Scripts\cxfreeze.bat" $(TAGGER_BASE)\comictagger.py --icon nsis\app.ico
#--base-name=Win32GUI
cp -R C:\Python27\Lib\site-packages\PyQt4\plugins\imageformats $(DIST_DIR)
cp "$(TAGGER_SRC)\UnRAR2\UnRARDLL\unrar.dll" $(DIST_DIR)
cp "$(TAGGER_BASE)\*.ui" $(DIST_DIR)
cp -r "$(TAGGER_BASE)\graphics" $(DIST_DIR)
cp "$(TAGGER_SRC)\UnRAR2\UnRARDLL\unrar.dll" $(DIST_DIR)
cp -r "$(TAGGER_SRC)\ui" $(DIST_DIR)
cp -r "$(TAGGER_SRC)\graphics" $(DIST_DIR)
rm "$(DIST_DIR)\QtWebKit4.dll"
rm "$(DIST_DIR)\PyQt4.QtWebKit.pyd"