Login | Register
My pages Projects Community openCollabNet

Discussions > SCons Development (OBSOLETE) > [scons-dev] MSI tool suffix handling broken? (+proposed patch)

Project highlights:

14 Nov 2017: Release 3.0.1 is now available at the download page.

18 Sep 2017: Release 3.0.0 is now available at the download page.

03 Nov 2016: Release 2.5.1 is now available at the download page.

scons
Discussion topic

Back to topic list

[scons-dev] MSI tool suffix handling broken? (+proposed patch)

Author "Aaron Zollman" <aaron dot zollman at redjack dot com>
Full name "Aaron Zollman" <aaron dot zollman at redjack dot com>
Date 2009-03-16 06:58:05 PDT
Message Dev team,

In trying to package an MSI on Windows using WiX, I kept running into an
error that seems to be caused by incorrect use of suffixes in
SCons/Tool/packaging/msi.py . env.Package() sets default_name =
"%(NAME)s-%(VERSION)s", and MSI, which should create both a .wxs (spec
file) and .msi (installer) target, uses this same default name for its
target without suffixes or modifications. This leads to an error -
"multiple ways to build the same target were specified" for NAME-VERSION.
Passing in target= to env.Package() only causes further errors.

My read of the code suggests there are two fixes needed. The first is a
misuse of "ensure_suffix='.wxs'" at msi.py:494 -- ensure_suffix is used
deep in SCons.Util.adjustixes, and should be True/False, not the suffix
itself.
Second is that the msi.py:package() should be adding a suffix to the
default target name passed in, as (for example) rpm.py and tarbz2.py do.

With the attached patch to msi.py, I create NAME-VERSION.wxs and
NAME-VERSION.msi, as expected.

Please let me know if this is helpful or if more information is needed; a
quick search of the archives didn't show anything about it. Thanks for
your work on SCons so far -- surprisingly intuitive, easy make system for
the cross-platform, cross-architecture tool we're developing.

--
 Aaron Zollman, RedJack


--- msi-orig.py 2009-03-16 09:42:05.119840000 -0400
+++ msi.py 2009-03-16 09:42:20.752318400 -0400
@@ -491,7 +491,7 @@
 # this builder is the entry-point for .wxs file compiler.
 wxs_builder = Builder(
     action = Action( build_wxsfile, string_wxsfile ),
- ensure_suffix = '.wxs' )
+ suffix = '.wxs' )

 def package(env, target, source, PACKAGEROOT, NAME, VERSION,
             DESCRIPTION, SUMMARY, VENDOR, X_MSI_LANGUAGE, **kw):
@@ -514,6 +514,7 @@
     specfile = apply( wxs_builder, [env, target, source], kw )

     # now call the WiX Tool with the built specfile added as a source.
+ env['BUILDERS']['WiX​'].set_suffix('.msi'​)
     msifile = env.WiX(target, specfile)

     # return the target and source tuple.

« Previous message in topic | 1 of 4 | Next message in topic »

Messages

Show all messages in topic

[scons-dev] MSI tool suffix handling broken? (+proposed patch) "Aaron Zollman" <aaron dot zollman at redjack dot com> "Aaron Zollman" <aaron dot zollman at redjack dot com> 2009-03-16 06:58:05 PDT
     Re: [scons-dev] MSI tool suffix handling broken? (+proposed patch) pscholl Philipp Scholl 2009-03-16 08:06:44 PDT
     Re: [scons-dev] MSI tool suffix handling broken? (+proposed patch) Greg Virgin <greg dot virgin at redjack dot com> Greg Virgin <greg dot virgin at redjack dot com> 2009-03-16 13:20:36 PDT
     RE: [scons-dev] MSI tool suffix handling broken? (+proposed patch) "Aaron Zollman" <zollman at redjack dot com> "Aaron Zollman" <zollman at redjack dot com> 2009-03-17 09:58:10 PDT
Messages per page: