]> git.lyx.org Git - lyx.git/commitdiff
Scons windows installer integration:
authorBo Peng <bpeng@lyx.org>
Wed, 7 Feb 2007 07:55:38 +0000 (07:55 +0000)
committerBo Peng <bpeng@lyx.org>
Wed, 7 Feb 2007 07:55:38 +0000 (07:55 +0000)
* 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

INSTALL.Win32
development/Win32/packaging/installer/components/external.nsh
development/Win32/packaging/installer/lyx.nsi
development/Win32/packaging/installer/settings.nsh
development/Win32/packaging/installer/settings.user.nsh
development/scons/SConstruct
development/scons/scons_utils.py

index 50907b264e26bcffd8a2f64575ec857fd3cdaacc..ed55f7660a507929ceb0c9abd49e60a0f6af131b 100644 (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
index 568f295ce36871cc12d2bc476682c1952d95c8d8..db03dabab8e9131592a0f0adc9c0be8ff083ce69 100644 (file)
@@ -94,7 +94,7 @@ External Components: MiKTeX, ImageMagick, Ghostscript
   !macro InstallComponent COMPONENT\r
 \r
     ;Extract\r
-    File /oname=$PLUGINSDIR\${COMPONENT}Setup.exe ${INSTALL_${COMPONENT}}\r
+    File /oname=$PLUGINSDIR\${COMPONENT}Setup.exe ${FILES_BUNDLE}\${INSTALL_${COMPONENT}}\r
     \r
     !insertmacro SetupComponent ${COMPONENT}\r
     \r
index fa1d1dd2eb5f2c7d3944869d8d243ca3e50feec1..34718ceab9aa5709a624e895da6cb8953034e60a 100644 (file)
@@ -28,7 +28,11 @@ SetCompressor /SOLID lzma
 ; /DExeFile=/path/to/installer\r
 \r
 !ifdef ExeFile\r
+!ifdef SETUPTYPE_BUNDLE\r
+OutFile "${BundleExeFile}"\r
+!else\r
 OutFile "${ExeFile}"\r
+!endif\r
 !else\r
 Outfile "${SETUP_EXE}"\r
 !endif\r
index aa4a681702272d6ff3a349a8e517d6327901c97f..ebe312bc8924129c76dc486c86730e99510a5eae 100644 (file)
@@ -41,8 +41,8 @@ Settings for LyX installer
 ;--------------------------------\r
 ;Download size (in KB)\r
 \r
-!define SIZE_DOWNLOAD_LATEX 43127\r
-!define SIZE_DOWNLOAD_IMAGEMAGICK 6830\r
+!define SIZE_DOWNLOAD_LATEX 47271\r
+!define SIZE_DOWNLOAD_IMAGEMAGICK 7096\r
 !define SIZE_DOWNLOAD_GHOSTSCRIPT 12669\r
 !define SIZE_DOWNLOAD_VIEWER 1459\r
 \r
@@ -57,8 +57,8 @@ Settings for LyX installer
 ;--------------------------------\r
 ;Locations of setup files for components (for bundled setup)\r
 \r
-!define INSTALL_LATEX "basic-miktex-2.5.2471.exe"\r
-!define INSTALL_IMAGEMAGICK "ImageMagick-6.3.0-7-Q16-windows-dll.exe"\r
+!define INSTALL_LATEX "basic-miktex-2.5.2580.exe"\r
+!define INSTALL_IMAGEMAGICK "ImageMagick-6.3.2-2-Q16-windows-dll.exe"\r
 !define INSTALL_GHOSTSCRIPT "gs854w32-gpl.exe"\r
 !define INSTALL_VIEWER "gsv48w32.exe"\r
 \r
index f2e85509f83d0d3f37d687ea8d47b7d1649b9649..f01242e99381179e998b86cf2ddca651136ebdd9 100644 (file)
 !define FILES_DEPS "..\..\..\..\lyx-windows-deps-msvc-qt4"\r
 !endif\r
 \r
+!ifdef FilesBundle\r
+!define FILES_BUNDLE "${FilesBundle}"\r
+!else\r
+!define FILES_BUNDLE "..\..\..\..\lyx-windows-bundle-deps"\r
+!endif\r
+\r
 ;Location of Windows installation\r
 \r
 !ifdef FilesWindows\r
index e4efb09dd9f33139ad270a9ae42b174a5d48f0f7..f1029bf9d5fc1b60c673764a5712340a50084f18 100644 (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'])
index 9187c5cf125e5105034c293c8aca5f65ee9becf3..bd2c7b079a3e05cbe3adb5ae48ef42ae95c4136d 100644 (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