Windows Installer runs EXE-style custom actions by calling CreateProcess,
which does not allow UAC prompting, and will fail if the OS Loader considers
that the prompt would have been required.

I believe that the WixShellExec custom action should work for you.

-----Original Message-----
From: Paul Adams [mailto:p...@cbord.com] 
Sent: Wednesday, August 18, 2010 8:24 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Execute program on exit

Hi.  I have an issue with a WIX installer that runs a custom action
using the "Finish" button in the exit dialog.  I've tried to follow the
tutorials/examples (which are wonderful, btw), but my action fails for
Server 2008 installs.  The same MSI works fine for Server 2003.
Currently, I'm blaming the UAC for this, but I'm not 100% sure.  The
problem seems security related, but if I turn off UAC (never notify
setting), I get the same problem and log file error.  
 
I'd prefer to keep this action in the final UI screen as I like the
checkbox that users can use to control the action.  I can give that up
if things need to run outside the UI sequence (I've read about using a
deferred custom action w/ impersonate="no", but have not tried that
yet).  The program I'd like to run is a managed code exe (C#) that is
our configuration tool.  It basically edits an XML file, validates
configuration values, etc and is also intended to run after installation
for configuration changes.  After the install on 2008 I can run the tool
fine either by a double click or the command line -- I do get the UAC
prompt when running the exe (which is what I expect).  The exe has a
proper UAC manifest that states that the requestedExecutionLevel is
"requireAdministrator".
 
Relevant details:
 
When running the installer as an admin, I get the UAC prompt as
expected.
 
ALLUSER=1 (the installer is for a windows service)
 
I've set up WIX properties to show the checkbox and prompt on the exit
dialog:
 
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
    <CustomAction Id="StartAppOnExit" FileKey="NetMenuCMFile"
ExeCommand="" Execute="immediate" Impersonate="yes" Return="check" />
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Value="!(loc.OnExitCheckboxText)" />

    <UI>
         ....
        <Publish Dialog="ExitDialog" Control="Finish" Order="1"
Event="DoAction"
Value="StartAppOnExit">WIXUI_EXITDIALOGOPTIONALCHECKBOX</Publish>
    </UI>
 
The verbose log contains this about the failure:
 
Action 17:34:12: ExitDialog. Dialog created
MSI (c) (28:24) [17:34:14:502]: Doing action: StartAppOnExit
MSI (c) (28:24) [17:34:14:502]: Note: 1: 2205 2:  3: ActionText 
Action 17:34:14: StartAppOnExit. 
Action start 17:34:14: StartAppOnExit.
MSI (c) (28:24) [17:34:14:505]: Note: 1: 1721 2: StartAppOnExit 3:
C:\Program Files\CBORD\DataService\NetMenuCM.exe 4:  
Error 1721. There is a problem with this Windows Installer package. A
program required for this install to complete could not be run. Contact
your support personnel or package vendor. Action: StartAppOnExit,
location: C:\Program Files\CBORD\DataService\NetMenuCM.exe, command:  
MSI (c) (28:24) [17:34:19:177]: Product: CBORD Data Service for GFS
(8.6.100.3433) -- Error 1721. There is a problem with this Windows
Installer package. A program required for this install to complete could
not be run. Contact your support personnel or package vendor. Action:
StartAppOnExit, location: C:\Program
Files\CBORD\DataService\NetMenuCM.exe, command:  
 
Action ended 17:34:19: StartAppOnExit. Return value 3.
DEBUG: Error 2896:  Executing action StartAppOnExit failed.
The installer has encountered an unexpected error installing this
package. This may indicate a problem with this package. The error code
is 2896. The arguments are: StartAppOnExit, , 
Action ended 17:34:19: ExitDialog. Return value 3.
 
I'm wondering if I'm missing some WIX setting that would allow such
actions to work on Server 2008.  Also, what is considered "best
practice" for running such programs?  Thanks for any help.
 
Paul Adams
Advisory Software Engineer
The CBORD Group, Inc.
1317 Hague Rd
St. Paul, MN 55104
T: 651.602.0262 
F: (by request)
p...@cbord.com
www.cbord.com <http://www.cbord.com/> 
 
Headquarters
61 Brown Road
Ithaca, NY 14850
T: 607.257.2410
F: 607.257.1902
 
----------------------------------------------------------------------------
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to