Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Properties & EnableUserControl / SecureCustomProp.


1 reply to this topic

Pizzero

Pizzero
  • Full Members
  • 22 posts

Posted 14 November 2007 - 14:42

Hello,

authoring my MSI-projects I noticed that properties (& custom actions) are processed in different ways, depending on its usage (installation, change, repair, uninstallation) and by whom executed (Administrator, standard user) and how authored (with or without using "EnableUserControl" and "SecureCustomProperties").

Due to unexplainable results I wrote a very simple test-msi database to understand this processing better. However instead of getting some answers I must admit that I'm more confuscated than before.

I would like to present my absolutely simple test-MSI here, and I hope that somebody can explain the results I got...

I'm using three properties:

* "PUBPROP1": Public property changed first by a custom action #2 (CA2, Type 307), only in the execution sequence and then by a custom action #1 (CA1, Type 307), present in UI and execution sequence (both set a property and are scheduled to run at most 1x).

* "PUBPROPD": Public property set by a Combobox in a dialog in the UI sequence

* "PrivProp": Private property set by a RadioButtonGroup in a dialog in the UI sequence

This three properties are written to a file from within a deferred custom action #3 in system context (CA3, Type 3170).

The code for this very simple installer database is (of course simplified, and normally embedded into a bare Installshield Basic-MSI project):

CODE

Property - Table

PUBPROP1=1
PUBPROPD=A
PrivProp=A

InstallUISequence

100) CA1 PUBPROP1=3 (CA, execute 1x, Type 307)
200) Dialog sets PrivProp=N and PUBPROPD=N via controls

InstallExecuteSequence

100) CA2 PUBPROP1=2 (CA, execute 1x, Type 307)
200) CA1 PUBPROB1=3 (CA, execute 1x, Type 307)
1000) CA3 saves [RestrictedUserControl], [PUBPROP1], [PUBPROPD] and [PrivProp] to Textfile (CA, deferred in system context, Type 3170)

cmd /c echo RUT=[RestrictedUserControl] Pub=[PUBPROP1] PubD=[PUBPROPD] Priv=[PrivProp] >> "[INSTALLDIR]properties.txt"


What one would expect as result would be:

* When the UI sequence will be run (Installation & Change), then PUBPROBD should be set to "N", when appropriately selected and PUBPROP1 should be set to 2, because it should be overwritten by CA2, while CA1 should not be called twice.
* The private property "PrivProp" should always be observed to be "A" (the only statement that seems to hold true.)
* The default values for PUBPROB1 (1) and PUBPROBD (A) should be observed, when RestrictedUserControl=1 ("RUT").

However here are the observed results, after executing the install on freshly installed Windows Vista .

CODE

                                 RUT    PUBPROP1        PUBPROPD        PrivProp
Admin, 4all/4user, Install:      {}        3               N               A
Admin, 4all/4user, Change:       1         1               A               A    (*)
Admin, 4all/4user, Repair:       {}        3               A               A
Admin, 4all/4user, Uninstall:    1         3               A               A

                                 RUT    PUBPROP1        PUBPROPD        PrivProp
User, 4user, Install:            {}        3               N               A
User, 4user, Change:             {}        3               N               A
User, 4user, Repair:             {}        3               A               A
User, 4user, Uninstall:          {}        3               A               A

                                 RUT    PUBPROP1        PUBPROPD        PrivProp
Admin, 4all,eup, Install:        {}        3               N               A
Admin, 4all,eup, Change:         {}        3               N               A    (*)
Admin, 4all,eup, Repair:         {}        3               A               A
Admin, 4all,eup, Uninstall:      {}        3               A               A

                                 RUT    PUBPROP1        PUBPROPD        PrivProp
Admin, 4all,scp, Install:        {}        3               N               A
Admin, 4all,scp1, Change:        1         3               A               A    (*)
Admin, 4all,scp2, Change:        1         1               N               A    (*)
Admin, 4all,scp3, Change:        1         1               A               A    (*)
Admin, 4all,scp, Repair:         {}        3               A               A
Admin, 4all,scp, Uninstall:      1         3               A               A

                                 RUT    PUBPROP1        PUBPROPD        PrivProp
User, 4user,scp, Install:        {}        3               N               A
User, 4user,scp, Change:         {}        3               N               A
User, 4user,scp, Repair:         {}        3               A               A
User, 4user,scp, Uninstall:      {}        3               A               A

Admin, 4all means administrator (currently logged in) installs for all users [ALLUSERS]=1.
Admin, 4user means administrator (currently logged in) installs for non-admin user. (appropiately filled into user-field and [ALLUSERS]={})
User, 4user means User (currently logged in) installs for him (standard user) (appropiately filled into user-field and [ALLUSERS]={})
RUT=[RestrictedUserControl]
„eup“ means, EnableUserControl=1 had been included in property table.
„scp“, „scp1“ means, SecureCustomProperties=PUBPROP1; PUBPROPD; PrivProp (in this order) included in property table.
„scp2“ means, SecureCustomProperties=PUBPROPD; PrivProp; PUBPROP1 (in this order) included in property table.
„scp3“ means, SecureCustomProperties=PrivProp; PUBPROP1; PUBPROPD (in this order) included in property table.
*) In this cases (Admin & Change Install) the UAC=User Account Control does not show up. Installation starts immediately.


The results have been collected with great care.

The values differ sometimes greatly from what has been expected.

My conclusionn till now:
* It seems that setting EnableUserControl=1 produces the closest results compared to what has been expected (though I would not like very much to do it, because MSI-developers will have had their reasons to not pass all public properties to the server side)
* What is very strange is that the order of the Properties in SecureCustomProperties seems to be relevant. I think this is not acceptable.
* What I cannot understand is that I never observe PUBROP1=2. Does this mean that CA1 always gets executed or is it some other strange installer behaviour?

I would really appreciate any answers and any thoughts I would get on this topic.

Thank you very much in advance!

Pizzero

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 November 2007 - 21:50

I haven't gone throgh all of your matrix yet, but regarding CA2 it looks like the documentation for msidbCustomActionTypeFirstSequence is slightly unclear when it says:
QUOTE
Execute once if present in both sequence tables.

It goes on to say:
QUOTE
Skips action in execute sequence if UI sequence has run.

Ad it seems that's actually the truth: the custom action is skipped if the UI sequence has run. It doesn't care if this very custom action has run before, it only looks whether the UI sequence has run or if the install runs in silent mode. I think this explains the behaviour you are seeing.