Scons windows installer integration:

* INSTALL.Win32: add instructin of building windows bundle installer
	* development/scons/SConstruct: add bundle and bundle_dir option
	* development/scons/scons_utils.py: handle bundle building
	* development/Win32/packaging/installer/lyx.nsi: 
		allow specify bundle .exe name from command line
	* development/Win32/packaging/installer/settings.user.nsh: 
		allow specify bundle directory from command line
	* development/Win32/packaging/installer/components/external.nsh:
		get files from bundle directory
	* development/Win32/packaging/installer/settings.nsh
		update miktex version (link needs to be updated as well?)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17081 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-02-07 07:55:38 +00:00
parent 666572dc19
commit 5402048cea
7 changed files with 52 additions and 9 deletions

View File

@ -128,3 +128,10 @@ Creating the Installer
$ scons -f development\scons\SConscript installer
This will create $BUILDDIR\lyx-version-timestamp-Installer.exe for a devel version,
and $BUILDDIR\lyx-version-Install.exe for a released version of lyx.
If you also want to generate bundled installer, download
lyx-windows-bundle-deps.zip from http://www.lyx.org/~bpeng, unpack
to lyx-windows-bundle-deps under the top source directory, and run
$ scons -f development\scons\SConstruct installer bundle=1
If you prefer to use another directory, you can use option bundle_dir like
$ scons -f development\scons\SConstruct installer bundle=1 bundle_dir=c:\bundle

View File

@ -94,7 +94,7 @@ External Components: MiKTeX, ImageMagick, Ghostscript
!macro InstallComponent COMPONENT
;Extract
File /oname=$PLUGINSDIR\${COMPONENT}Setup.exe ${INSTALL_${COMPONENT}}
File /oname=$PLUGINSDIR\${COMPONENT}Setup.exe ${FILES_BUNDLE}\${INSTALL_${COMPONENT}}
!insertmacro SetupComponent ${COMPONENT}

View File

@ -28,7 +28,11 @@ SetCompressor /SOLID lzma
; /DExeFile=/path/to/installer
!ifdef ExeFile
!ifdef SETUPTYPE_BUNDLE
OutFile "${BundleExeFile}"
!else
OutFile "${ExeFile}"
!endif
!else
Outfile "${SETUP_EXE}"
!endif

View File

@ -41,8 +41,8 @@ Settings for LyX installer
;--------------------------------
;Download size (in KB)
!define SIZE_DOWNLOAD_LATEX 43127
!define SIZE_DOWNLOAD_IMAGEMAGICK 6830
!define SIZE_DOWNLOAD_LATEX 47271
!define SIZE_DOWNLOAD_IMAGEMAGICK 7096
!define SIZE_DOWNLOAD_GHOSTSCRIPT 12669
!define SIZE_DOWNLOAD_VIEWER 1459
@ -57,8 +57,8 @@ Settings for LyX installer
;--------------------------------
;Locations of setup files for components (for bundled setup)
!define INSTALL_LATEX "basic-miktex-2.5.2471.exe"
!define INSTALL_IMAGEMAGICK "ImageMagick-6.3.0-7-Q16-windows-dll.exe"
!define INSTALL_LATEX "basic-miktex-2.5.2580.exe"
!define INSTALL_IMAGEMAGICK "ImageMagick-6.3.2-2-Q16-windows-dll.exe"
!define INSTALL_GHOSTSCRIPT "gs854w32-gpl.exe"
!define INSTALL_VIEWER "gsv48w32.exe"

View File

@ -16,6 +16,12 @@
!define FILES_DEPS "..\..\..\..\lyx-windows-deps-msvc-qt4"
!endif
!ifdef FilesBundle
!define FILES_BUNDLE "${FilesBundle}"
!else
!define FILES_BUNDLE "..\..\..\..\lyx-windows-bundle-deps"
!endif
;Location of Windows installation
!ifdef FilesWindows

View File

@ -193,6 +193,10 @@ opts.AddOptions(
('win_installer', 'name or full path to the windows installer', None),
# the deps package used to create minimal installer (qt and other libraries)
('deps_dir', 'path to the development depedency packages with zlib, iconv, zlib and qt libraries', None),
# whether or not build bundle installer
BoolOption('bundle', 'Whether or not build bundle installer', False),
# the bundle directory, containing bundled applications
PathOption('bundle_dir', 'path to the bundle dependency package with miktex setup.exe etc', None),
# build directory, will use $mode if not set
('build_dir', 'Build directory', None),
# version suffix
@ -2164,25 +2168,44 @@ if build_installer:
# provide default setting
if not env.has_key('deps_dir') or env['deps_dir'] is None:
env['deps_dir'] = os.path.join(env.Dir('$TOP_SRCDIR').abspath, 'lyx-windows-deps-msvc-qt4')
if not os.path.isdir(env['deps_dir']):
if not os.path.isdir(env.Dir('$deps_dir').abspath):
print 'Development dependency package is not found.'
Exit(1)
else:
env['deps_dir'] = env.Dir(env['deps_dir']).abspath
env['deps_dir'] = env.Dir('$deps_dir').abspath
# build bundle?
if env.has_key('bundle_dir') and os.path.isdir(env.Dir('$bundle_dir').abspath):
env['bundle_dir'] = env.Dir('$bundle_dir').abspath
elif os.path.isdir(os.path.join(env.Dir('$TOP_SRCDIR').abspath, 'lyx-windows-bundle-deps')):
env['bundle_dir'] = os.path.join(env.Dir('$TOP_SRCDIR').abspath, 'lyx-windows-bundle-deps')
else:
env['bundle_dir'] = None
# if absolute path is given, use it, otherwise, write to current directory
if not (':' in env['win_installer'] or '/' in env['win_installer'] or '\\' in env['win_installer']):
env['win_installer'] = os.path.join(env.Dir('$BUILDDIR').abspath, env['win_installer'])
env.Append(NSISDEFINES={
'ExeFile':env['win_installer'],
'BundleExeFile':env['win_installer'].replace('.exe', '-bundle.exe'),
'FilesLyx':env.Dir(dest_prefix_dir).abspath,
'FilesDeps':env['deps_dir'],
'FilesBundle':env['bundle_dir'],
})
installer = env.installer(env['win_installer'],
'$TOP_SRCDIR/development/Win32/packaging/installer/lyx.nsi')
# since I can not use a scanner, explicit dependent is required
env.Depends(installer, 'install')
frontend_env.Alias('installer', installer)
env.Alias('installer', installer)
# also generate bundle?
if env.has_key('bundle') and env['bundle']:
if env['bundle_dir'] is None or not os.path.isdir(env['bundle_dir']):
print 'Bundle directory does not exist (default to %s\lyx-windows-bundle-deps.' % env.Dir('$TOP_SRCDIR').abspath
print 'Use bundle_dir option to specify'
Exit(1)
# generator of the builder will add bundle stuff depending on output name
bundle_installer = env.installer(env['win_installer'].replace('.exe', '-bundle.exe'),
'$TOP_SRCDIR/development/Win32/packaging/installer/lyx.nsi')
env.Depends(bundle_installer, 'install')
env.Alias('installer', bundle_installer)
Default('lyx')
Alias('all', ['lyx', 'client', 'tex2lyx'])

View File

@ -94,6 +94,9 @@ def env_nsis(source, target, env, for_signature):
if env['NSISDEFINES'][d]:
ret += '=' + quoteIfSpaced(env['NSISDEFINES'][d])
ret += ' '
# bundled?
if '-bundle.exe' in str(target[0]):
ret += '/DSETUPTYPE_BUNDLE=1 '
for s in source:
ret += quoteIfSpaced(str(s))
return ret