Windows Vista with Custom Action
I have an install that includes a custom action that calls "an executable from installed files". This executable creates a scheduled task on Windows Vista. If I run the executable from the command line, the task is created like it should be. However, when the executable runs from the installer, it fails with a return code of LogonType() which means that the executable did not run with sufficient privileges to create the task.
I have the custom action in the Execute Deferred section, and I have it set to run with "Deferred Execution - System Context". I've tried adding a manifest (it's a .NET executable) that sets <requestedExecutionLevel level="highestAvailable" uiAccess="false" /> to the executable I am trying to run. I have made sure that the custom action is after all the files have been installed (insuring that both the executable and manifest are in place) and I have made sure that the "Enable User Account Control" checkbox is checked in the Installation Expert.
When the installation starts, it prompts for the UAC approval, and I can tell that my custom action fires and the executable runs, but if run under the installer, it fails with an Exception LogonType(). It works if I run it form the command line after the install.
Have I missed something? Any hints or suggestions would be very much appreciated.
Thanks,
Allen
Comments
All custom action must use the "asInvoker" option, not "requireAdministrator" or "highestAvailable". Otherwise you get the problem of the UAC prompt showing up or the thing just bombs.
If you are using Wise Installation Studio 7.0 with SP1, the help file explains this (embedding manifests in WiseScript was a new feature unavailable prior to SP1). This is touched on in the Wise help file if you open the WiseScript Package Editor (not the slimmed-down "WiseScript Editor", the full "WiseScript Package Editor"). Go to the Installation Expert tab > Build Settings page and hit F1 to open the help.
It has the following info for manifests:
asInvoker
Select this option for a WiseScript that runs as a custom action in an .MSI. The WiseScript runs with the level of the user who runs the .MSI. This prevents failure of the .MSI due to UAC prompting on the custom action execution.
If the WiseScript performs an action that requires elevation, then place the custom action in the Execute Deferred sequence between the InstallInitialize and InstallFinalize actions. This lets the action run with elevated privileges. However, if the user who runs the .MSI does not have elevated privileges, then the WiseScript will fail and cause the .MSI installation to fail.
highestAvailable
Select this option for a WiseScript installation only, typically one that runs differently depending on the level of the user. If an administrator runs the .EXE, the UAC prompt appears. If a standard user runs the .EXE, the UAC prompt does not appear and the .EXE runs as a standard user.
Do not select this option for a WiseScript custom action.
requireAdministrator
Select this option for a WiseScript installation only. When the WiseScript installation is run, the UAC prompt appears.
Do not select this option for a WiseScript custom action. If you do, the .MSI installation will fail due to UAC prompting on the custom action execution.
Never mind that they are specifically talking about using WiseScript .exe's for the custom action; The same info applies to other types of .exe custom actions.
Also, you may need to change that to run with user context. You know the user has the rights (the install would already have failed far earlier if not). If you leave it to run as System, you'll need to check that the system account really has enough rights to do whatever your custom action is doing...try making a scheduled task that runs your custom action (it'll run as System).
*This help info is only part of the latest releases of the Wise products: Wise Installation Studio 7.0 with SP1 and Wise Package Studio 7.0 Professional with SP3. Older releases of these versions or any older version of these products do not have this feature or help info. Wise Installation Express 7.0 SP1 also doesn't contain this info since it does not come with the WiseScript Package Editor (it only comes with the slimmed-down WiseScript Editor which doesn't contain this feature).
Hello, I am using Windows
Hello,
I am using Windows Installer and ORCA to edit the package. How/Where can I specify the asInvoker option in my custom action??
- milindsm
This forum is not for ORCA support
ORCA is a Microsoft tool, so support should be available in the Microsoft newsgroups.
asInvoker is an entry in a MANIFEST file
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Would you like to reply?
Login or Register to post your comment.