|
|
#11 (permalink) |
|
Guest
Posts: n/a
|
"Steven Bethard" wrote: > > > "Kalle Olavi Niemitalo" wrote: > > > Steven Bethard <StevenBethard@discussions.microsoft.com> writes: > > > > > I played around with this a bit, but I'm stuck on the TARGETDIR part. Orca > > > tells me that "Only TARGETDIR or its children can have files". But I > > > potentially need to install files to multiple Python installations, e.g. > > > C:\Python24 and C:\Python25. I can use RegLocator etc. to set TARGETDIR to > > > one or the other of these, but not both as far as I can tell. I guess I could > > > set TARGETDIR to C: but that seems a little odd... > > > > In the Directory table, insert rows like: > > > > Directory='TARGETDIR', Directory_Parent=NULL, DefaultDir='SourceDir'; > > Directory='PYTHON24', Directory_Parent='TARGETDIR', DefaultDir='Python24'; > > Directory='PYTHON25', Directory_Parent='TARGETDIR', DefaultDir='Python25'; > > > > Then use RegLocator to set the PYTHON24 and PYTHON25 properties. > > As long as you set those properties before CostFinalize, Windows > > Installer will use them to set the target locations of the > > corresponding directories, and TARGETDIR will not affect them. > > If RegLocator doesn't find e.g. Python 2.4 and leaves PYTHON24 > > unset, then TARGETDIR does affect the PYTHON24 directory, but > > in that case you'll disable the feature, so no components will > > be installed there. > > Excellent. Thanks for the detailed information. > > One more question about this approach. How do I disable a feature based on > something I looked up from the registry? In particular, if I've tried and > failed to set PYTHON24DIR from the registry, how do I set the corresponding > entry in the Feature table to not display? I assume I need to modify the > Level column, but I can't see how to do that at install time. I think I figured this out - looks like I just need to add an entry to the Condition table with something like: Feature_=Python24Feature, Level=0, Condition=NOT PYTHON24DIR Thanks again everyone for your help! |
|
|
|
#12 (permalink) |
|
Guest
Posts: n/a
|
Steven Bethard <StevenBethard@discussions.microsoft.com> writes:
> I think I figured this out - looks like I just need to add an entry to the > Condition table with something like: > > Feature_=Python24Feature, Level=0, Condition=NOT PYTHON24DIR The documentation of the Condition table <http://msdn.microsoft.com/en-us/library/aa368014.aspx> warns: | Conditions should be carefully chosen so that a feature is not | enabled on install and then disabled on uninstall. This will | orphan the feature and the product will not be able to be | uninstalled. So please test this scenario: 1. Install Python 2.4. 2. Install your package, so Python24Feature gets installed. 3. Uninstall Python 2.4. 4. Uninstall your package. Is Python24Feature properly uninstalled? On the other hand, the documentation also says Windows Installer does not use the Condition table if the REMOVE property has been set. When uninstalling a product via Add or Remove Programs, I think Windows Installer sets REMOVE=ALL, so perhaps it'll work correctly. It's worth testing though. |
|
|
|
#13 (permalink) |
|
Guest
Posts: n/a
|
Kalle Olavi Niemitalo wrote:
> | Conditions should be carefully chosen so that a feature is not > | enabled on install and then disabled on uninstall. This will > | orphan the feature and the product will not be able to be > | uninstalled. http://www.joyofsetup.com/2008/05/16...an-be-removed/ Definitely an issue to verify. -- sig://boB http://joyofsetup.com/ |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|