| InstallSite · E-mail and password recovery note · Contact |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| aarthi_m |
Posted: 2006-09-26 15:57
|
|
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??? |
| Stefan Krueger |
Posted: 2006-09-26 21:44
|
![]() InstallSite.org Group: Administrators Posts: 11227 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 -------------------- Stefan Krüger
Microsoft Windows Installer MVP InstallSite.org Stefan's Blog ![]() Read this before sending me e-mail or private messages |
| aarthi_m |
Posted: 2006-09-27 08:33
|
|
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.
|
| Stefan Krueger |
Posted: 2006-09-27 14:26
|
![]() InstallSite.org Group: Administrators Posts: 11227 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.
-------------------- Stefan Krüger
Microsoft Windows Installer MVP InstallSite.org Stefan's Blog ![]() Read this before sending me e-mail or private messages |
| aarthi_m |
Posted: 2006-09-27 16:02
|
|
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.
|
| Stefan Krueger |
Posted: 2006-09-27 22:53
|
![]() InstallSite.org Group: Administrators Posts: 11227 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?
-------------------- Stefan Krüger
Microsoft Windows Installer MVP InstallSite.org Stefan's Blog ![]() Read this before sending me e-mail or private messages |
| aarthi_m |
Posted: 2006-09-28 16:40
|
|
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? |
| Glytzhkof |
Posted: 2006-09-29 00:45
|
|
Group: Moderators Posts: 1301 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 |
| aarthi_m |
Posted: 2006-10-04 12:31
|
|
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? |
| Glytzhkof |
Posted: 2006-10-04 12:34
|
|
Group: Moderators Posts: 1301 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 |
| elliot |
Posted: 2006-12-21 11:15
|
|
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 |
| Glytzhkof |
Posted: 2006-12-22 04:48
|
|
Group: Moderators Posts: 1301 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 |
| Stefan Krueger |
Posted: 2006-12-23 11:16
|
![]() InstallSite.org Group: Administrators Posts: 11227 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.
-------------------- Stefan Krüger
Microsoft Windows Installer MVP InstallSite.org Stefan's Blog ![]() Read this before sending me e-mail or private messages |
| aarthi_m |
Posted: 2006-12-24 15:22
|
|
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?
|
| Stefan Krueger |
Posted: 2006-12-27 10:30
|
![]() InstallSite.org Group: Administrators Posts: 11227 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. -------------------- Stefan Krüger
Microsoft Windows Installer MVP InstallSite.org Stefan's Blog ![]() Read this before sending me e-mail or private messages |
![]() |
![]() ![]() ![]() |