visual studio 2012 - WiX msi custom action not running on limited privileges on Windows 7 -
have been trying create wix installer latest project. have strange issue if run msi via cmd prompt admin works fine, custom actions kick off without fuss , works fine, if double click msi custom actions don't work , installer fails. i'm using visual studio 2012 , using windows 7.
<!--custom actions--> <binary id='customshortcut' sourcefile='$(var.customdir)\testinstallercustom.ca.dll'/> <binary id='customdir' sourcefile='$(var.customdir)\testinstallercustom.ca.dll'/> <binary id='removedir' sourcefile='$(var.customdir)\testinstallercustom.ca.dll'/> <customaction id='customshortcutid' binarykey='customshortcut' dllentry='customshortcut' execute='immediate' impersonate='no' return='check' /> <customaction id='customdirid' binarykey='customdir' dllentry='customdir' execute='immediate' impersonate='no' return='check'/> <customaction id='removedirid' binarykey='removedir' dllentry='removedir' execute='immediate' impersonate='no' return='check'/> <installexecutesequence> <custom action='customdirid' before='installfinalize'/> <custom action='customshortcutid' after='installfinalize'/> <custom action="removedirid" after="installvalidate">remove="all"</custom> </installexecutesequence>
the 'immediate'
custom actions not executed elevated part of install. elevated in installation process run elevated (as you've seen). have custom action elevated must part of transaction script. set customaction
element execute='deferred'
attribute.
note: deferred custom actions have other limitations documented in msi sdk: 'deferred execution custom actions' topic. since looks custom actions modifying machine state, you'll want adding rollback custom actions undo changes done deferred custom actions.
writing custom actions quite challenging. part of reason why custom actions largest contributor installation failures. if can avoid writing custom actions, highly recommend doing so. :)
Comments
Post a Comment