Assuming that you have that custom action in both old and new setups, take a look at the entire log. It might be happening when the old install is being removed and the service is really not there because the condition doesn't look right to me, if my thinking is correct.
NOT ((REMOVE~="ALL") AND (NOT UPGRADINGPRODUCTCODE)) When the old product is being upgraded, REMOVE="ALL" is true and UPGRADINGPRODUCTCODE is true. That expression evaluates to NOT (true and (not true)), and that entire expression is therefore true, so that custom action is running when the old product is being uninstalled. Phil W -----Original Message----- From: Sameer Arora [mailto:arora...@gmail.com] Sent: Friday, March 09, 2012 10:20 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Configuring service being installed fails during silent upgrade (but passes when UI is enabled) Ping... Appreciate all suggestions and pointers. On Wed, Feb 8, 2012 at 11:08 AM, Sameer Arora <arora...@gmail.com> wrote: > Hi, > > I have a WiX 3.5 project that installs and starts a windows service and > thereafter executes a custom action to configure the service using command > line utility sc.exe that ships with the OS. > > This MSI can be used both for fresh install or major upgrade. > It uses custom dialogs to capture user information in global properties > (which can be passed from command line as well). > > For a fresh install, the MSI installation succeeds whether run in normal > or quiet mode (UI enabled/suppressed). > However, for a major upgrade, installation succeeds only in normal mode, > but fails in quiet mode with sc.exe failing to find the installed service > (error details below). > > My initial hunch was that with UI enabled, there is sufficient time lag > between execution of service installation and configuring steps so that > sc.exe succeeds in finding the service installed. > In quiet mode OTOH, the steps may get executed too quickly for sc.exe to > find the service installed and hence the failure. > > To test this, I tweaked the InstallExecuteSequence to increase the > "distance" between StartServices and the custom action (even introduced a > sleep in an intermediate custom action), but to no avail. > I also looked into the InstallUISequence but couldn't see anything that > might impact service installation or config steps. > > Any thoughts what could be the cause/remedy? > Appreciate all pointers. > > Sameer > > OS is Win7, but not sure if OS is a factor here. > > --- Error from installation log: Begin---- > ... > MSI (s) (A0:0C) [08:50:40:235]: Executing op: > CustomActionSchedule(Action=QtExecDeferred,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="C:\Windows\SysWOW64\sc.exe" > sidtype "<service name>" "unrestricted") > MSI (s) (A0:7C) [08:50:40:278]: Invoking remote custom action. DLL: > C:\Windows\Installer\MSIB16A.tmp, Entrypoint: CAQuietExec > MSI (s) (A0:C0) [08:50:40:278]: Generating random cookie. > MSI (s) (A0:C0) [08:50:40:283]: Created Custom Action Server with PID 7120 > (0x1BD0). > MSI (s) (A0:A8) [08:50:40:320]: Running as a service. > MSI (s) (A0:A8) [08:50:40:322]: Hello, I'm your 32bit Elevated custom > action server. > CAQuietExec: OpenService FAILED 1060: > CAQuietExec: > CAQuietExec: The specified service does not exist as an installed service. > CAQuietExec: > CAQuietExec: Error 0x80070424: Command line returned an error. > CAQuietExec: Error 0x80070424: CAQuietExec Failed > CustomAction QtExecDeferred returned actual error code 1603 (note this may > not be 100% accurate if translation happened inside sandbox) > ... > --- Error from installation log: End---- > > > ---- WiX Code snippets: Begin ---- > > <!--Custom Action definition--> > <CustomAction Id="SetServiceSidToUnrestricted_CmdLine" > Property="QtExecDeferred" Value='"[SystemFolder]sc.exe" sidtype > "$(var.agentHostServiceName)" "$(var.agentServiceSidType)"' /> > <CustomAction Id="QtExecDeferred" BinaryKey="WixCA" > DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/> > ... > > <!-- InstallExecuteSequence--> > ... > <InstallInitialize Sequence=n /> > ... > <InstallServices Sequence=x>VersionNT</InstallServices> > <StartServices Sequence=x+1>VersionNT</StartServices> > > <!--Run this custom action on install/upgrade/repair, do not run only > on an uninstall --> > <Custom Action="QtExecDeferred" After="StartServices"> > <![CDATA[ > NOT ((REMOVE~="ALL") AND (NOT UPGRADINGPRODUCTCODE)) > ]]> > </Custom> > > .... > > <InstiallFinalize/> > > ---- WiX Code snippets: End---- > ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users *** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at 3rd Floor, 40 Grosvenor Place, London, SW1X 7AW (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/en/legal/default.aspx. You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail recept...@invensys.com. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates). ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users