Go Back   PackageDeploy Application Packaging Forums > Package Development > Application Packaging > Platformsdk MSI

Reply
 
LinkBack Thread Tools Display Modes
Old 06-03-2009, 06:02 AM   #11 (permalink)
Steven Bethard
Guest
 
Posts: n/a
Default Re: CustomAction that sets ProductName



"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!
  Reply With Quote
Old 06-03-2009, 06:02 AM   #12 (permalink)
Kalle Olavi Niemitalo
Guest
 
Posts: n/a
Default Re: CustomAction that sets ProductName

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.
  Reply With Quote
Old 06-03-2009, 06:02 AM   #13 (permalink)
Bob Arnson [MSFT]
Guest
 
Posts: n/a
Default Re: CustomAction that sets ProductName

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/

  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:33 PM.


vBulletin, Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
2007 - 2012 PackageDeploy.com