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

Changing Features Durign an Install

200 views
Skip to first unread message

Paul Michniewicz

unread,
Jul 11, 2001, 1:49:41 PM7/11/01
to
Hello

We are forcing our clients to perform a custom install of our product.
Before they get to the "Custom Setup" dialog panel of the install, we would
like to be able to use a CA to alter the state of installable features based
on the serial number entered by our clients from the "Customer Information"
dialog panel. What is the best way to do this?

It will also be necessary for us to extract feature states after the "Custom
Setup" dialog panel so that the setup can display the appropriate sequence
of dialog panels to the client. If we can extract the current states of
these features, we can then set setup properties upon which the subsequent
sequence of dialog panels for the setup can be determined. Again, what is
the best way to do this?

thanks in advance,

Paul Michniewicz
Release Engineer for eProcess
Jetform Corporation
(613) 751-4800 ext 5421
pmic...@jetform.com
___________________________

What we have tried...

1) Setting Feature Conditions which seem to only take effect on the setup
initialization but not during the setup itself.

2) CA that use the MsiSetFeatureState cannot be run through a DoAction from
a Dialog Panel because it hangs the setup i.e. on selecting "Next" from the
"Customer Information" panel.

3) Setting a CA in Sequences unser Installation/User Interface between the
"Customer Information" and "Custom Setup" dialog panels also fails. As I am
calling this from a Custom Action, I've assumed that the "hInstall" passed
as a parameter to the CA can be used with these functions as it was with the
MsiGetProperty() and MsiSetProperty() functions (where I get and set install
property values).

Sample Install Sheild Script...

function BOOL Feature_PAC_AgentDesigner(hInstall)
...
// MsiDoActions

// NewhInstall = MsiOpenPackage("PathtoPackage...", &handInstall)
// NOTE: -- But hInstall is a passed parameter to the CA.
// Is this the CA parameter the one I use or do I have
to create another with this method?

nReturn = MsiDoAction(hInstall, "CostInitialize");
// NOTE: CA fails here with a 2705 Error -- "Invalid Table: [2]; Could
not be linked as Tree". The "hInstall" passed to the CA was used.

nReturn = MsiDoAction(hInstall, "FileCost");
nReturn = MsiDoAction(hInstall, "CostFinalize");
nReturn = MsiSetInstallLevel(hInstall, 100);
// NOTE: Seem to be required according to MSI Help for
MsiSetFeatureState() function
// although in the examples for MsiGetFeatureCost(), it
doesn't appear to be required.

// Check PAC for runtime bit and enable/disable Agent Feature
bResult = JfPacIsAllowed (FKP_ALL, FKF_EPIC_RUNTIME, svPAC);
// NOTE: This comes from our DLL that is streamed into the binary table
checks the serial number for values

if (bResult = TRUE) then
nReturn = MsiSetProperty(hInstall, "PACRUNTIME", "1");
nReturn = MsiSetFeatureState(hInstall, "Agent", INSTALLSTATE_LOCAL);
// Enable feature
else
nReturn = MsiSetProperty(hInstall, "PACRUNTIME", "0");
nReturn = MsiSetFeatureState(hInstall, "Agent", INSTALLSTATE_ABSENT);
// Disable feature
endif;
...

David L. Cole

unread,
Jul 11, 2001, 7:17:06 PM7/11/01
to
Paul,

One way would be to write a customn action which uses MsiGetFeatureState and
MsiSetFeatureState. See the MSI help for the details.

Cheers,

David Cole

Paul Michniewicz

unread,
Jul 13, 2001, 3:12:58 PM7/13/01
to
Progress...

1) InstallShield Knowledge Base Q103163 shows how features can be enabled
and disabled during runtime. However, according to the literature, dialog
panels that modify the feature selection i.e. the Custom Setup dialog panel,
must be run after the CostFinalize standard action. My new question is
this...

After performing a CostFinalize, is there any way to disable features
presented in the Feature Tree of the Custom Install Dialog based on a serial
number obtained from a previous dialog?

2) The MsiGetFeatureState function can be called from an Install Script CA
at any point after the CostFinalize standard action and Custm Setup dialog.
It appears as though I can use this to set properties from script which in
turn can be used to control whatever subsequent dialog panels I wish to
display.

Any ideas?

Paul

"Paul Michniewicz" <pmic...@jetform.com> wrote in message
news:3b4c93c0$1...@12.41.20.38...

Edward Clements

unread,
Jul 14, 2001, 3:25:29 AM7/14/01
to
Paul,

Re 1), you would need to use AddLocal and Remove events (plus Remove and
AddLocal events respectively, with the exact opposite conditions, in case
the user clicks on Back and changes the feature selection)

Re 2), what happens for me when I use MsiSetFeatureState in an InstallScript
CA under Win2000, the whole setup just hangs at that point (something to do
with locks and threads, I think)

Hope this helps,

Edward Clements

"Paul Michniewicz" <pmic...@jetform.com> wrote in message

news:3b4f...@12.41.20.38...

Edward Clements

unread,
Jul 17, 2001, 12:42:43 PM7/17/01
to
Paul,

[Could you please in the future reply only via the newsgroup (hit "Reply to
group" instead of "Reply")? thanks]

>... AddLocal and Remove are Installer Properties...
If you take a look at the MSI-help, you can see that both AddLocal and
Remove are ControlEvents; ADDLOCAL and REMOVE are properties...

What I was suggesting was to add one or more AddLocal Events (select
AddLocal from the drop-down combo in the "Event" column) to the "Next"
button with the Argument being the feature name (case sensitive?) to enable
those specific features, with the necessary conditions. In addition, you
would need to also add "Remove" events with the same feature-names and the
opposite conditions.

Hope this helps,

Edward Clements

"Paul Michniewicz" <pmic...@jetform.com> wrote via eMail
>Hi Edward!
>
>Thanks for your reply.
>
>Just to clarify... AddLocal and Remove are Installer Properties. By
"events"
>I presume that you I would use a DoAction to run a CA that creates the
>delimited list of features and sets each property by using MsiSetProperty.
>
>cheers,
>
>Paul

"Edward Clements" <kli...@compuserve.com> wrote in message

...


Paul Michniewicz

unread,
Jul 17, 2001, 3:11:19 PM7/17/01
to
Thanks Edward.

I tried what you had suggested and the features can be disabled and enabled
via our serial number in the manner you described below.

In the Custom Setup, however, the user still has the ability to enable the
disabled features. Is there a way in which I can disable and hide features
from the user (this would be similar to conditionally setting the feature
install level to 0).

cheers,

Paul

"Edward Clements" <kli...@compuserve.com> wrote in message

news:3b54...@12.41.20.38...

Edward Clements

unread,
Jul 18, 2001, 2:38:49 AM7/18/01
to
Paul,

Take a look at the thread "conditionally setting a features display
property" (started on 27/03/2001); if you can't find it in the newsgroup any
more, try the thread "Another one for Robert Dickau . . ." (May 3, 2001).
Both of these threads are in the installshield.iswi.general newsgroup...

Edward Clements

"Paul Michniewicz" <pmic...@jetform.com> wrote in message

news:3b548fca$1...@12.41.20.38...

Paul Michniewicz

unread,
Jul 18, 2001, 6:34:43 PM7/18/01
to
Hi Edward!

I tried the solution offered. It didn't work. Granted, I do have subfeatures
which are already hidden beneath the features I would like to disable. I
altered the SQL script so that the column names aren't quoted. If column
names are quoted, the MsiDatabaseOpenView returns a 1615 Error or a
ERROR_BAD_QUERY_SYNTAX.

At any rate, this is what I tried...

In my first attempt, I tried to hide the parent features as per the script
presented in Rob Dickau's earlier posts. The features still appeared in the
feature tree.

In the second attempt, I hide the already hidden child features with the
given script and then hide the parent features as I did in the first step. I
received an 1627 error ERROR_FUNCTION_FAILED when the script attempted to
disable the parent features. This occured on first line with the
MsiViewModify function.

There was a suggestion in the earlier posts to try an UPDATE instead. I
wondering if anyone has tried this. I will take a stab at this approach
tomorrow.

Thanks for the help thus far... I've learned much!

cheers,

Paul
______________________________
Taken from Robert M. Dickau's post to "Another one for Robert Dickau . . ."
(May 3, 2001).

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='DesignTools'", // PXM -- Edited
for my needs
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;


"Edward Clements" <kli...@compuserve.com> wrote in message

news:3b55...@12.41.20.38...

Paul Michniewicz

unread,
Jul 19, 2001, 1:04:20 PM7/19/01
to
One more follow up note...
I tried using the UPDATE clause suggested by Stefan Krueger. It doesn't work
and produces the 1627 ERROR_FUNCTION_FAILED. I also attempted to disable the
child features in the same manner before hiding the parent feature. I
presume that the reason for this is similar to that given by Paul Little
(See "conditionally setting the display feature property" thread posted
March 27, 2001) "...the referential integrity of the Feature table would be
violated if the top-level feature were deleted [or modified]".
Thanks again for your help...
cheers,
Paul
__________________________
Code Used (DOES NOT WORK for Features with Sub Features)
...
hDB = MsiGetActiveDatabase(hInstall);
szQuery = "UPDATE Feature SET Feature.Display=0 WHERE
Feature.Feature='MyFeature'";
nResturn = MsiDatabaseOpenView(hDB, szQuery, hView);

// 1627 Error was returned by the MsiViewExecute for the Parent Feature
// The function seems to execute properly for child features
nReturn = MsiViewExecute(hView,0);

nReturn = MsiViewClose(View);
nReturn = MsiCloseHandle(hView);
nReturn = MsiCloseHandle(hDB);
...

"Edward Clements" <kli...@compuserve.com> wrote in message

news:3b55...@12.41.20.38...

0 new messages