2009-06-01 09:55:11 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# Created By: Virgil Dupras
|
|
|
|
# Created On: 2009-05-22
|
2010-01-01 20:11:34 +00:00
|
|
|
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
2009-08-05 08:59:46 +00:00
|
|
|
#
|
|
|
|
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
|
|
|
# which should be included with this package. The terms are also available at
|
|
|
|
# http://www.hardcoded.net/licenses/hs_license
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
# On Windows, PyInstaller is used to build an exe (py2exe creates a very bad looking icon
|
|
|
|
# The release version is outdated. Use at least r672 on http://svn.pyinstaller.org/trunk
|
|
|
|
|
|
|
|
import os
|
2009-06-07 08:18:42 +00:00
|
|
|
import os.path as op
|
2009-06-01 09:55:11 +00:00
|
|
|
import shutil
|
|
|
|
from app import DupeGuru
|
|
|
|
|
|
|
|
def print_and_do(cmd):
|
|
|
|
print cmd
|
|
|
|
os.system(cmd)
|
|
|
|
|
|
|
|
# Removing build and dist
|
2009-06-07 08:18:42 +00:00
|
|
|
if op.exists('build'):
|
|
|
|
shutil.rmtree('build')
|
|
|
|
if op.exists('dist'):
|
|
|
|
shutil.rmtree('dist')
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
version = DupeGuru.VERSION
|
|
|
|
versioncomma = version.replace('.', ', ') + ', 0'
|
|
|
|
verinfo = open('verinfo').read()
|
|
|
|
verinfo = verinfo.replace('$versioncomma', versioncomma).replace('$version', version)
|
|
|
|
fp = open('verinfo_tmp', 'w')
|
|
|
|
fp.write(verinfo)
|
|
|
|
fp.close()
|
|
|
|
print_and_do("python C:\\Python26\\pyinstaller\\Build.py dgpe.spec")
|
|
|
|
os.remove('verinfo_tmp')
|
|
|
|
|
2009-10-14 16:01:24 +00:00
|
|
|
print_and_do("del dist\\*90.dll") # They're in vcredist, no need to include them
|
2010-01-13 16:02:59 +00:00
|
|
|
print_and_do("xcopy /Y /S /I ..\\..\\help_pe\\dupeguru_pe_help dist\\help")
|
2009-06-01 09:55:11 +00:00
|
|
|
|
2010-02-06 07:58:37 +00:00
|
|
|
# AdvancedInstaller.com has to be in your PATH
|
2009-06-01 09:55:11 +00:00
|
|
|
shutil.copy('installer.aip', 'installer_tmp.aip') # this is so we don'a have to re-commit installer.aip at every version change
|
2010-02-06 07:58:37 +00:00
|
|
|
print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % version)
|
|
|
|
print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force')
|
2009-06-01 09:55:11 +00:00
|
|
|
os.remove('installer_tmp.aip')
|