Installing Shield 2009 Premier Custom Action in Vista Home / Premium / Ultimate
Environment: Install Shield 2009 Premier, Vista (Home / Premium, Ultimate)
I have a custom action in Install Shield 2009 that will fire during installation. If setup.exe works fine, but when running MyApplication.msi on Vista (note that custom actions work fine on other OSs), it shows an exception doing the custom action. The custom action just executes the exe with the command line arguments.
This exe only performs fine on this OS. But when MyApplication.msi wants to run it, it shows an exception.
I think: MyApplication.msi cannot grant the correct privilege (administrative) for a custom action (.exe) to run. But setup.exe can.
How can this be solved ...?
In the custom action wizard for my custom action for the "In-Script Execution" parameter I selected "Deferred execution in system context"
a source to share
You didn't specify, but it looks like your setup.exe has a manifest that requires administrative rights (if you get a UAC prompt when running setup.exe, it does). It also seems that the exe you are trying to run from your custom action has similar requirements for administrative privileges. The custom exe action in MSI uses CreateProcess which cannot be raised.
If your action is executed in a UI sequence, you need to use ShellExecute or ShellExecuteEx somehow - this can be done with a custom InstallScript action using LaunchApplication with the LAAW_OPTION_USE_SHELLEXECUTE flag, or with C ++ which calls ShellExecuteEx directly.
If your action is executed in the Execute sequence, you must mark it as Deferred in System Context so that it starts at elevated context to begin with. This is generally preferred (at least from a user perspective) as it avoids the extra UAC prompt that another method would show. However, any deferred action has limitations (such as minimal property access) that you might need to check out.
a source to share