]> git.lyx.org Git - lyx.git/commitdiff
Scons: NSIS support (installer target)
authorBo Peng <bpeng@lyx.org>
Thu, 25 Jan 2007 19:13:22 +0000 (19:13 +0000)
committerBo Peng <bpeng@lyx.org>
Thu, 25 Jan 2007 19:13:22 +0000 (19:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16854 a592a061-630c-0410-9148-cb99ea01b6c8

INSTALL.Win32
INSTALL.scons
development/Win32/packaging/installer/lyx.nsi
development/scons/SConstruct
development/scons/scons_utils.py

index 8bba61f0ac2446e414537b416441159550228ad0..f858b37bdc76b0001acbfe7724bce09dc747ef75 100644 (file)
@@ -113,3 +113,8 @@ Creating the Installer
        Finally, go to development\Win32\packaging\installer
        (in a normal Windows Explorer), right-click on lyx.nsi and click
        "Compile NSIS Script".
+
+       You can also use the installer target of scons. Namely, use a command like
+          $ 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.
index 44e5c100e153853ebd2d8afcc81f0a1dbd4fdda0..f0da4e24a92dbfca4639ebefda7d4a6bb19f054c 100644 (file)
@@ -126,6 +126,11 @@ Installation options:
   * DESTDIR: if specified, install to this directory instead of $prefix.
   * version_suffix=yes/no/something : if specified, this suffix will be 
     appended to the user data directory.
+  * win_installer: if specified under windows, and if 'installer' target
+    is given, generate NSIS installer specifed as win_installer which can 
+    be a full path name. The default is lyx-version-timestamp-Installer.exe
+    for a development version, and lyx-version-Installer.exe for a released
+    version.
 
 
 Compiler choice and flags:
@@ -147,7 +152,7 @@ You can specify one or more of the following targets:
   Programs:
     tex2lyx, client, lyx, all = tex2lyx + client + lyx
   Installation:
-    po, install = all + po
+    po, install = all + po, installer (windows only, need NSIS)
   Misc:
     msvs_projects
 
index ad2d7f849e6af3db7a78863d468b6f2bde9c1888..fa1d1dd2eb5f2c7d3944869d8d243ca3e50feec1 100644 (file)
@@ -24,9 +24,14 @@ SetCompressor /SOLID lzma
 !system '"${NSISDIR}\makensis.exe" "${FILES_PDFVIEW}\pdfview.nsi"'\r
 \r
 ;--------------------------------\r
-;LyX Installer\r
-\r
-OutFile "${SETUP_EXE}"\r
+;LyX Installer, output file can be specified using command line option\r
+; /DExeFile=/path/to/installer\r
+\r
+!ifdef ExeFile\r
+OutFile "${ExeFile}"\r
+!else\r
+Outfile "${SETUP_EXE}"\r
+!endif\r
 \r
 ;--------------------------------\r
 ;Components\r
index d7921308092a267b85d0d93ad1cb9eeb6954a8a5..e6dc0ce7535bf22e85bda94dabb18ca710bc8fd5 100644 (file)
@@ -189,6 +189,8 @@ opts.AddOptions(
         comp1,comp2,...: rebuild specified targets''', None),
     # can be set to a non-existing directory
     ('prefix', 'install architecture-independent files in PREFIX', default_prefix),
+    # replace the default name and location of the windows installer
+    ('win_installer', 'name or full path to the windows installer', None),
     # build directory, will use $mode if not set
     ('build_dir', 'Build directory', None),
     # version suffix
@@ -2015,10 +2017,19 @@ if build_installer:
     else:
         print 'No nsis compiler is found. Existing...'
         Exit(2)
-    installer = env.installer(# 'target.exe',
-            '$TOP_SRCDIR/development/Win32/packaging/installer/lyx.nsi')
+    if not env.has_key('win_installer') or env['win_installer'] is None:
+        if devel_version:
+            env['win_installer'] = '%s-%s-%s-Installer.exe' % (package_name, package_version, time.strftime('%Y-%m-%d'))
+        else:
+            env['win_installer'] = '%s-%s-Installer.exe' % (package_name, package_version)
+    # 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']})
+    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, \
+    env.Depends(installer, [lyx, tex2lyx] + \
         ['$TOP_SRCDIR/development/Win32/packaging/installer/%s' % x for x in win32_packaging_installer_files] + \
         ['$TOP_SRCDIR/development/Win32/packaging/installer/components/%s' % x for x in win32_packaging_installer_components_files] + \
         ['$TOP_SRCDIR/development/Win32/packaging/installer/dialogs/%s' % x for x in win32_packaging_installer_dialogs_files] + \
@@ -2026,7 +2037,6 @@ if build_installer:
         ['$TOP_SRCDIR/development/Win32/packaging/installer/include/%s' % x for x in win32_packaging_installer_include_files] + \
         ['$TOP_SRCDIR/development/Win32/packaging/installer/lang/%s' % x for x in win32_packaging_installer_lang_files ]
     )
-    print "installer is", installer
     frontend_env.Alias('installer', installer)
 
 
index d9e2d07f32c46f0a2b99e5dd4b850544d43de350..59458a0ba4d5f1d74e36257ce1b3d715e873b96a 100644 (file)
@@ -83,7 +83,7 @@ def env_nsis(source, target, env, for_signature):
             return '"' + str + '"'
         else:
             return str
-    ret = env['NSIS'] + " "
+    ret = env['NSIS'] + " /V2 "
     if env.has_key('NSISFLAGS'):
         for flag in env['NSISFLAGS']:
             ret += flag
@@ -92,12 +92,10 @@ def env_nsis(source, target, env, for_signature):
         for d in env['NSISDEFINES']:
             ret += '/D'+d
             if env['NSISDEFINES'][d]:
-                ret += '=' + quoteIfSpaced(toString(env['NSISDEFINES'][d],env))
+                ret += '=' + quoteIfSpaced(env['NSISDEFINES'][d])
             ret += ' '
     for s in source:
         ret += quoteIfSpaced(str(s))
-    print ret
-    Exit(0)
     return ret