[python-win32] Distributing a Python app using MSI
Emlyn Jones
emlynj at gmail.com
Tue Mar 28 19:24:19 CEST 2006
> On 3/28/06, Emlyn Jones <emlynj at gmail.com> wrote:
> > On 3/28/06, Mark Mc Mahon <mark.m.mcmahon at gmail.com> wrote:
> > > Hi Emlyn,
> > >
> > > On 3/28/06, Emlyn Jones <emlynj at gmail.com> wrote:
> > > > Hello,
> > > > This maybe better suited to the Distutils-SIG, but for now I'll try it here.
> > > > I'm just wondering if anybody on this list has ever used the msilib functions
> > > > used to build the Python installer to build an MSI installer for their own
> > > > Python application. Sort of like distutils but to install scripts into a user
> > > > specified folder as well as modules into .../site-packages.
> > > > It looks like I could hack the msi.py script used to build the Python
> > > > installation but I wondered if anybody could point me towards a hello world
> > > > type example, I'm not really up to speed on the finer details of MSI.
> > > > Google'n around it looks like I will have to install the extension modules
> > > > using distutils and then my application using some other method. I'd like to
> > > > install the whole lot (including dependencies if necessary; Stuff like
> > > > fpconst) using MSI.
> > > > If I'm being silly/missing something shouts will be gratefully heard.
> > >
> > > So let me see if I understand...
> > > You have a bunch of files (.py, .pyd) etc.
> > >
> > > Do they need to go into different directories (e.g.
> > > windows/python\lib\site-packages) or you can put them all under one
> > > directory?
> > > - If you are putting everything under one directory then I guess it
> > > shouldn't be THAT difficult (though MSI is reasonably complicated!)
> > >
> > > If you are putting files under various directories - then it becomes
> > > more complicated - but still possible.
> > >
> > > My suggestion would be to use distutils first to collect everything
> > > into one usable/clean structure - then build the MSI out of that.
> > >
> > > I have worked quite a bit with MSI - but never created my own from
> > > Scratch - some people use WIX (which I think was open sourced from
> > > Microsoft themselves).
> > >
> > > > Cheers,
> > > > Emlyn.
> > > > P.S. py2exe et. al. are not an option because it's a web application.
> > >
> > > I hope that was of some use,
> > > Mark
> > >
> > Hello, thanks for the reply.
> > Yes, that's useful.
> > I have a bunch of py and pyd files as you say; some get installed as
> > Python modules (in site-packages) some get installed elsewhere (in a
> > user specified folder).
> > I wasn't aware of WIX, a quick look through the tutorial suggests it
> > is what I'm looking for. I was just thinking that if Python had the
> > were with-all (let's face it, when doesn't Python have the were
> > with-all), it might be a less steep learning curve.
> > I guess my next decision is whether to re package the existing
> > extension modules (fpconst and the PyWebSvc stuff) and install them as
> > components or to find a way of getting msi to call `python setup.py
> > install`. Either way, I think your suggestion of grouping them all in
> > a single distutils package first is the way to go.
> > At least I know I'm heading in roughly the right direction.
> > One more question though, if that's ok. I can test for Python by
> > checking for the registry entries but what's the best way to check
> > that the win32 stuff. Is it just a case of looking for the folders
> > under site-packages? I guess a little Python script that attempts to
> > import stuff and returns an error code may be another way.
> >
> > Cheers,
> > Emlyn.
> >
>
On 3/28/06, Mark Mc Mahon <mark.m.mcmahon at gmail.com> wrote:
..snip..
> I don't completely see why you need an MSI though. You are requiring
> Python on the target machine - why not use something like sdist with a
> custom install script? (note I am not an expert in distutils - so
> maybe it doesn't do what you need!)
>
..snip..
No, I'm not 100% sure yet either. I'm thinking that I do because I
don't want all my code installed in site-packages and I can't see a
way to get distutils to install stuff outside of the Python directory
tree (or indeed to ask where it should be installed). I'm not a
distutils expert either but I think it's designed for installing
Python modules rather than Python applications. Unfortunatly I need to
do both and ideally from a single install. There does seem to be a
number of options, I guess it's just suck it and see. One other
thought is to make an MSI to install everything that can't be
installed using distutils and then run msiexec from distutils using a
custom Python script as you suggest. A single install bundle has to be
favourite though.
Decisions, Decisions!
Cheers,
Emlyn.
More information about the Python-win32
mailing list