Get the Windows builder to create an HTML Help file too.

bzr-revno: 1444
This commit is contained in:
Raoul Snyman 2011-04-03 20:18:48 +02:00
commit d41c89799f
2 changed files with 33 additions and 16 deletions

View File

@ -69,6 +69,7 @@ Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs
[Icons]
Name: {group}\{#AppName}; Filename: {app}\{#AppExeName}
Name: {group}\{#AppName} (Debug); Filename: {app}\{#AppExeName}; Parameters: -l debug
Name: {group}\{#AppName} Help; Filename: {app}\{#AppName}.chm
Name: {group}\{cm:ProgramOnTheWeb,{#AppName}}; Filename: {#AppURL}
Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe}
Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: desktopicon

View File

@ -94,6 +94,10 @@ from subprocess import Popen, PIPE
python_exe = sys.executable
innosetup_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5',
u'ISCC.exe')
sphinx_exe = os.path.join(os.path.split(python_exe)[0], u'Scripts',
u'sphinx-build.exe')
hhc_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'HTML Help Workshop',
u'hhc.exe')
# Base paths
script_path = os.path.split(os.path.abspath(__file__))[0]
@ -109,6 +113,7 @@ i18n_utils = os.path.join(script_path, u'translation_utils.py')
# Paths
source_path = os.path.join(branch_path, u'openlp')
manual_path = os.path.join(branch_path, u'documentation', u'manual')
i18n_path = os.path.join(branch_path, u'resources', u'i18n')
winres_path = os.path.join(branch_path, u'resources', u'windows')
build_path = os.path.join(branch_path, u'build', u'pyi.win32', u'OpenLP')
@ -132,21 +137,6 @@ def update_code():
print output
raise Exception(u'Error updating the code')
def clean_build_directories():
dist_dir = os.path.join(build_path, u'dist')
build_dir = os.path.join(build_path, u'build')
if os.path.exists(dist_dir):
for root, dirs, files in os.walk(dist_dir, topdown=False):
print root
for file in files:
os.remove(os.path.join(root, file))
os.removedirs(dist_dir)
if os.path.exists(build_dir):
for root, dirs, files in os.walk(build_dir, topdown=False):
for file in files:
os.remove(os.path.join(root, file))
os.removedirs(build_dir)
def run_pyinstaller():
print u'Running PyInstaller...'
os.chdir(branch_path)
@ -240,6 +230,31 @@ def compile_translations():
if code != 0:
raise Exception('Error running lconvert on %s' % source_path)
def run_sphinx():
print u'Running Sphinx...'
os.chdir(manual_path)
sphinx = Popen((sphinx_exe, u'-b', u'htmlhelp', u'-d', u'build/doctrees',
u'source', u'build/htmlhelp'), stdout=PIPE)
output, error = sphinx.communicate()
code = sphinx.wait()
if code != 0:
print output
raise Exception(u'Error running Sphinx')
def run_htmlhelp():
print u'Running HTML Help Workshop...'
os.chdir(os.path.join(manual_path, u'build', u'htmlhelp'))
hhc = Popen((hhc_exe, u'OpenLP.chm'), stdout=PIPE)
output, error = hhc.communicate()
code = hhc.wait()
if code != 1:
print u'Exit code:', code
print output
raise Exception(u'Error running HTML Help Workshop')
else:
copy(os.path.join(manual_path, u'build', 'htmlhelp', u'OpenLP.chm'),
os.path.join(dist_path, u'OpenLP.chm'))
def run_innosetup():
print u'Running Inno Setup...'
os.chdir(winres_path)
@ -260,7 +275,6 @@ def main():
print "Inno Setup path:", innosetup_path
print "Windows resources:", winres_path
update_code()
#clean_build_directories()
run_pyinstaller()
write_version_file()
copy_enchant()
@ -268,6 +282,8 @@ def main():
copy_windows_files()
update_translations()
compile_translations()
run_sphinx()
run_htmlhelp()
run_innosetup()
print "Done."