InstallSite Forum


  Reply to this topicStart new topicStart Poll

> custom action fails on Longhorn, custom action fails on Longhorn
aarthi_m
Posted: 2006-09-26 15:57
Quote Post





Group: Full Members
Posts: 65
Member No.: 9615
Joined: 2004-11-18



One of my custom actions fail when executed on Longhorn. The custom action invokes a exe which writes to program files. The custom action executes on the server side (installexec sequence) and has a deffered execution. The CA fails when it invokes the exe. The installer gave a UAC prompt when the install began. So, not sure why the exe fails with lack of privileges message.

If i try to invoke the exe independntly (not from the msi), there is a UAC prompt and the write to program files succeeds.

Any suggestions or reasons for this behavior???
PMEmail Poster
Top
Stefan Krueger
Posted: 2006-09-26 21:44
Quote Post


InstallSite.org


Group: Administrators
Posts: 11483
Member No.: 1
Joined: 2001-02-07



Did you also set the NoImpersonate bit for the custam action? See also this blog entry:
http://blogs.msdn.com/rflaming/archive/200.../23/768248.aspx


--------------------
PMEmail PosterUsers Website
Top
aarthi_m
Posted: 2006-09-27 08:33
Quote Post





Group: Full Members
Posts: 65
Member No.: 9615
Joined: 2004-11-18



Thanks Stefan, noimpersonate bit worked. Just to clarify my understanding on why this bit needs to be set - Even if the CA is set to deffered execution in system context, it will try to run as standard user unless the noimpersonate bit is set.
PMEmail Poster
Top
Stefan Krueger
Posted: 2006-09-27 14:26
Quote Post


InstallSite.org


Group: Administrators
Posts: 11483
Member No.: 1
Joined: 2001-02-07



In my understanding "system contect" in the InstallShield IDE is equivalent to setting the noimpersonate bit. Setting this bit is required to make sure your custom action runs with elevated privileges.


--------------------
PMEmail PosterUsers Website
Top
aarthi_m
Posted: 2006-09-27 16:02
Quote Post





Group: Full Members
Posts: 65
Member No.: 9615
Joined: 2004-11-18



In that case, the custom action should work when set for deffered execution in system context even if the noimpersonate flag is not set. But it did not.

PMEmail Poster
Top
Stefan Krueger
Posted: 2006-09-27 22:53
Quote Post


InstallSite.org


Group: Administrators
Posts: 11483
Member No.: 1
Joined: 2001-02-07



Yes that was my understanding. Actually I thought that "system context" *IS* the noimpersonate flag. If this is not the case: which effect in the .msi file does the "system contect" option have instead?


--------------------
PMEmail PosterUsers Website
Top
aarthi_m
Posted: 2006-09-28 16:40
Quote Post





Group: Full Members
Posts: 65
Member No.: 9615
Joined: 2004-11-18



You are right Stefan, setting "system context" is equivalent to the noimpersonate flag.

The custom actions which are after installfinalize, cannot be set to deffered in system context execution. So, if they need to run with admin privileges, how can it be done? Is there a way to run in elevated privilege mode?
PMEmail Poster
Top
Glytzhkof
Posted: 2006-09-29 00:45
Quote Post





Group: Moderators
Posts: 1307
Member No.: 5425
Joined: 2002-10-30



There should be no custom actions at all after InstallFinalize at all - inserting immediate mode custom actions here is a common error. If you need the custom action to access files after they are installed, put a deferred execution custom action in the deferred sequence after the InstallFiles standard action. Alternatively you can insert these custom actions in the UI sequence, but this is most definitely not recommended since they won't be run if the install is run silently.


--------------------
Regards
-Stein Åsmul
PMEmail Poster
Top
aarthi_m
Posted: 2006-10-04 12:31
Quote Post





Group: Full Members
Posts: 65
Member No.: 9615
Joined: 2004-11-18



If there should not be any custom actions(CA) in immediate mode after installfinalize, where should CA that install driver be placed? Keeping in mind that these CA will not have a corresponding roll back action and the recommendation that all CA between installinitialize and install finalize have a rollback action, where is it appropriate to place a driver installation custom action?

Such CA will need admin privilges, what should be done to elevate the privileges?

PMEmail Poster
Top
Glytzhkof
Posted: 2006-10-04 12:34
Quote Post





Group: Moderators
Posts: 1307
Member No.: 5425
Joined: 2002-10-30



I would try to insert the action in deferred mode right before InstallFinalize. Remember that immediate mode custom actions always run in user context, deferred actions run in LocalSystem context.


--------------------
Regards
-Stein Åsmul
PMEmail Poster
Top
elliot
Posted: 2006-12-21 11:15
Quote Post





Group: Full Members
Posts: 28
Member No.: 8507
Joined: 2004-03-23



Regarding putting CA after InstallFinalize:
Sometimes you do not have any other choice, rather than to execute CA after the InstallFinilize action.

From my own experience, this is a must if you have an application that has .NET assemblies that are being installed into the GAC, and you need to "use" these assemblies in the last stages of the installation.

If you will look at the "MsiAssembly Table" help in the MSDN, in the "Remarks" section, you will see an example to a CA which should be schedules after the InstallFinalize (according to Microsoft recommendations).

Igal
PMEmail PosterICQ
Top
Glytzhkof
Posted: 2006-12-22 04:48
Quote Post





Group: Moderators
Posts: 1307
Member No.: 5425
Joined: 2002-10-30



Hi Elliot, that's news to me, but I read the SDK and right you are. I have seen problems in the past where immediate mode custom actions after InstallFinalize have not been run properly when the install is run in silent mode. I guess this problem could be resolved in later versions of the msiexec engine?


--------------------
Regards
-Stein Åsmul
PMEmail Poster
Top
Stefan Krueger
Posted: 2006-12-23 11:16
Quote Post


InstallSite.org


Group: Administrators
Posts: 11483
Member No.: 1
Joined: 2001-02-07



Yes, but custom actions after InstallFinalize should not modify the target system, so they shouldn't need elevated rights I think.


--------------------
PMEmail PosterUsers Website
Top
aarthi_m
Posted: 2006-12-24 15:22
Quote Post





Group: Full Members
Posts: 65
Member No.: 9615
Joined: 2004-11-18



If actions after installfinalize cannot modify the target system, where should driver installations be put? Before installfinalize? These actions don't have a rollback and so it is not advisable to sequence them between installinit and finalize. What is recommened for driver installations?
PMEmail Poster
Top
Stefan Krueger
Posted: 2006-12-27 10:30
Quote Post


InstallSite.org


Group: Administrators
Posts: 11483
Member No.: 1
Joined: 2001-02-07



Why don't they have a rollback action?
For driver installations I would highly recommend using Microsoft's DIFx framework which has custom actions for msi setups.


--------------------
PMEmail PosterUsers Website
Top

InstallShield & AdminStudio Training

Kurse in deutscher Sprache hier.

Courses in English, French and Italian language here.


« Next Oldest | Custom Actions | Next Newest »

Topic Options Reply to this topicStart new topicStart Poll