Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74570

Re: how to msi install Python to non-default target dir?

References <1405517362.434.YahooMailNeo@web163802.mail.gq1.yahoo.com> <CAKJDb-NYXOoht76PWMtGevEiZ4Lu34XmDog3A0FFWBukPcNPHw@mail.gmail.com> <1405521180.31678.YahooMailNeo@web163802.mail.gq1.yahoo.com>
From Zachary Ware <zachary.ware+pylist@gmail.com>
Date 2014-07-16 11:45 -0500
Subject Re: how to msi install Python to non-default target dir?
Newsgroups comp.lang.python
Message-ID <mailman.11888.1405529580.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jul 16, 2014 at 9:33 AM, Albert-Jan Roskam <fomcl@yahoo.com> wrote:
> From: Zachary Ware <zachary.ware+pylist@gmail.com>
>> Also, 'set' doesn't require quotes
>> around a value with spaces, and you're also quoting %PYTHONDIR% when
>> you use it in the msiexec command, so you're actually double-quoting
>> the dir name (which could also be the issue).
>
> That was it, thank you!!

Glad I could help :)

>> And, not necessarily an
>> issue that would prevent installing, but you may want to make sure
>> you're in the correctly-bitted Program Files directory if you're on
>> 64-bit Windows (%PROGRAMFILES% for 64-bit, %PROGRAMFILES(x86)% for
>> 32-bit; %PROGRAMFILES(x86)% will not be defined on 32-bit Windows or
>> in a 32-bit process on 64-bit Windows).
>
> Good point. The easiest solution would be to write one .bat for 32bit and one for 64bit.

You could also do something like (untested, but I've used similar in
the Doc/make.bat script):

   if DEFINED ProgramFiles(x86) set 64bitext=.amd64
   set PYTHONDIR=%ProgramFiles%\Python27
   set PYTHONMSI=python-2.7.3%64bitext%.msi
   msiexec /i %PYTHONMSI% TARGETDIR="%PYTHONDIR%" /qb

That's for 64-bit Python on 64-bit Windows, 32-bit Python on 32-bit
Windows.  Or:

   if DEFINED ProgramFiles(x86) set PgrmFls=%ProgramFiles(x86)%
   if NOT DEFINED ProgramFiles(x86) set PgrmFls=%ProgramFiles%
   set PYTHONDIR=%PgrmFls%\Python27
   msiexec /i python-2.7.3.msi TARGETDIR="%PYTHONDIR%" /qb

for 32-bit Python on either platform.

-- 
Zach

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: how to msi install Python to non-default target dir? Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-07-16 11:45 -0500

csiph-web