Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

conditionally setting a features display property

120 views
Skip to first unread message

Chen Drori

unread,
Mar 27, 2001, 10:22:19 AM3/27/01
to
Is it possible to conditionally set a feature's "Display" property?
The default setting for this is "Visible and Collapsed".
Is there any way to conditionally set this property to one of the other
values?

--

Chen Drori ch...@pelicansecurity.com
Pelican Security http://www.pelicansecurity.com
Tel: +972-3-6488454 ext.124
Fax: +972-3-6488453


Robert M. Dickau (InstallShield)

unread,
Mar 28, 2001, 10:12:24 AM3/28/01
to
Apart from conditionally hiding a feature using a feature condition, there
appears to be no simple way to switch between, say, "Visible and Collapsed"
and "Visible and Expanded". (Other than having two nearly identical features
that differ only in the Display property, where you conditionally hide one
of them, which probably isn't worth it...)

"Chen Drori" <ch...@pelicansecurity.com> wrote in message
news:3ac0...@12.41.20.38...

--
Robert M. Dickau
Senior Technical Trainer
InstallShield Software Corp.
www.installshield.com/training


Chen Drori

unread,
Mar 29, 2001, 3:42:21 AM3/29/01
to
That's exactly what I want to do - conditionally hide a feature.
I do NOT want to set it's installlevel to 0, because that would uninstall it
if it was installed. I just want to make it invisible in the treecontrol of
the CustomSetup dialog. How do I get it to be invisible without playing
around with the installlevel?

"Robert M. Dickau (InstallShield)"
<i_wish_i_had_time_to_answer_individual_questions_through_e-mail_but_i_don't
@installshield.com> wrote in message news:3ac2...@12.41.20.38...

Robert M. Dickau (InstallShield)

unread,
Mar 29, 2001, 11:13:46 AM3/29/01
to
I haven't really tested it, but this might do the trick (modifying the
in-memory Feature table)...


prototype msi.MsiCloseHandle(HWND);

export prototype HideFeature(HWND);

function HideFeature(hMSI)
HWND hDB, hView, hRecord;
begin
hDB = MsiGetActiveDatabase(hMSI);
MsiDatabaseOpenView(hDB,
"SELECT * FROM `Feature` WHERE `Feature`=FeatureName",
hView);
MsiViewExecute(hView, 0);
MsiViewFetch(hView, hRecord);

MsiViewModify(hView, 6, hRecord); // 6 = delete

MsiRecordSetInteger(hRecord, 5, 0); // Display field of Feature record
MsiViewModify(hView, 7, hRecord); // 7 = insert temp

MsiViewClose(hView);
MsiCloseHandle(hRecord);
MsiCloseHandle(hView);
MsiCloseHandle(hDB);
end;

"Chen Drori" <ch...@pelicansecurity.com> wrote in message
news:3ac2...@12.41.20.38...


> That's exactly what I want to do - conditionally hide a feature.
> I do NOT want to set it's installlevel to 0, because that would uninstall
it
> if it was installed. I just want to make it invisible in the treecontrol
of
> the CustomSetup dialog. How do I get it to be invisible without playing
> around with the installlevel?
>
> "Robert M. Dickau (InstallShield)"

> <i> wrote in message news:3ac2...@12.41.20.38...

Stefan Krueger

unread,
Apr 28, 2001, 3:14:18 PM4/28/01
to
This is a very interesting solution. I wonder why it works (it seems
to work...)? I thought that you cannot modify records that come from
the original msi file, only such rows that you added at run time
temporarily. I had tested this with a listbox where I had specified
entries in the IDE and tried to remove some of them at runtime. This
didn't work. (Now I found out that I can change values for such
listbox entries, but I can't delete a row from the listbox table).
Does anyone know what the limitations are for modifying tables and
records from the msi file at runtime? I didn't find much documentation
about this. (I know that you can't store changes in the msi file, all
modifications are temporary - that's documented)

TIA,
Stefan Krueger


"Robert M. Dickau (InstallShield)"
<i_wish_i_had_time_to_answer_individual_questions_through_e-mail_but_i
_don't...@installshield.com> schrieb im Newsbeitrag
news:3ac3...@12.41.20.38...

Paul Little

unread,
May 10, 2001, 1:24:32 AM5/10/01
to
Hi. I'm trying to use this suggestion to conditionally hide features, but
it doesn't seem to work for features that have sub-features. The first
MsiViewModify call fails with ERROR_FUNCTION_FAILED (1627).

I have tried doing the same thing for each of the sub-features before doing
the top-level feature, but I still get the error (sub-features OR top-level
features that don't contain other features hide just fine).

Any ideas?

Thanks,
Paul L.

"Robert M. Dickau (InstallShield)"
<i_wish_i_had_time_to_answer_individual_questions_through_e-mail_but_i_don't

@installshield.com> wrote in message news:3ac3...@12.41.20.38...

Paul Little

unread,
May 10, 2001, 11:56:28 AM5/10/01
to
Well, now that I've had a little sleep, I realize why this is happening--the
referential integrity of the Feature table would be violated if the
top-level feature were deleted (since there are entries with its feature
name in the Feature_Parent column.

Has anybody solved this before? I'd rather not recreate the wheel.

Thanks,
Paul

"Paul Little" <pli...@acbs.com> wrote in message
news:3afa2911$1...@12.41.20.38...

Stefan Krueger

unread,
May 11, 2001, 6:44:40 AM5/11/01
to
Instead of deleteing the feature you might be able to change the
display setting using an UPDATE clause.
Haven't tried that, so please keep me informred of the results.

--
Stefan Krueger - Independent Setup Consultant

Visit InstallSite at http://www.installsite.org to download
free code samples, tips, tools and more...
For information about individual support and consulting services
please send a blank mail to the autoresponder at in...@installsite.org

Stefan Krueger and the InstallSite.org web site are not affiliated
with InstallShield Software Corporation.

"Paul Little" <pli...@acbs.com> schrieb im Newsbeitrag
news:3afabd2e$1...@12.41.20.38...

Paul Little

unread,
May 18, 2001, 7:31:40 PM5/18/01
to
Thanks for your reply Stefan. In the interest of time, I used another
approach. If I get a chance to go back and try this again, I'll let you
know whether or not this works.

-Paul

"Stefan Krueger" <nws...@installsite.org> wrote in message
news:3afbc4a2$1...@12.41.20.38...

a.n.o.n.y.m....@gmail.com

unread,
Dec 5, 2013, 2:58:04 AM12/5/13
to
Thanks for the good ideas. There's another great thread on this subject at the URL below, where I've posted an alternate solution. There, Robert also posted a more detailed code example:

http://community.flexerasoftware.com/showthread.php?172240-Hide-Feature-in-Basic-MSI-during-runtime&p=493121#post493121

Thanks,
Christopher

0 new messages