views:

42

answers:

1

I ran into the following problem: I need to supply the installation package to the client. Part of the code is python, so I have to make sure that it is installed. I am using NSIS for the installation ans would like to install python into a predefined by me folder (let it be c:\Program Files\Project\Python26). For that I downloaded the python's msi and trying to execute the following to install it

msiexec  /package "$INSTDIR\packages\python-2.6.5.msi" /quiet TARGETDIR=c:\Program Files\Project\Python26

This works the first time (when python is not already installed), but if the python is already installed, I have to choose between reinstalling/repairing/changing. Does anybody know how to make sure that I can install python in the my directory without affecting potentially installed python?

A: 

Per the docs, options such as /p (or maybe /o or /c, depending on your exact intent) should serve your purposes.

Alex Martelli
Thanks Alex for the answer, but I guess I need to clarify - if Python is already installed - I DO NOT want to do anything with it, option p/o/c will reinstall python - I want original python be intact and just install the new one(I do not need to update registry keys - they will not be since I am using /quiet, or add it to PATH variable). Sorry for not being clear.
Sergey
@Sergey, you're wrong: `/p` is documented (in the URL I already gave) as "Reinstalls only if file is missing." -- so **if** there's an "original python", i.e. it is **not** missing, `/p` will indeed make `msiexec` "leave it alone", just as you wish. The other options can fix previous installs that are present but somehow damaged (e.g. have the wrong checksum, for `/c`), which makes sense to be since if that happens it means they have been broken, therefore are **not** intact but shattered -- but if you're somehow magically certain that, if present, they're intact, then `/p` works for you, no?
Alex Martelli