It seems to me that you are calling your custom action to uninstall the service *on an install* because you haven't got a condition on it. That looks like your first point of failure.
Curious why don't you have a choice about doing it the "proper" way as Arun described....... Phil Wilson -----Original Message----- From: Rajendra Magar [mailto:rma...@newfrontieradvisors.com] Sent: Tuesday, February 23, 2010 12:22 PM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Two of my attachments got clobbered on the way, so I am copy+pasting them here. (1) ServiceInstaller.wxs <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="product name" Language="1033" Version="1.0.0.0" Manufacturer="manufacturer name" UpgradeCode="{C14D63B3-E9F0-45cf-A86E-B609E48CC642}"> <Package Id="*" InstallerVersion="300" Compressed="yes" /> <!-- Allow only an administrator to install on the target machine --> <Condition Message="You need to be an administrator to install Network Client on this machine"> Privileged </Condition> <!-- Check for .NET 2.0 or higher --> <Condition Message="Network Client requires .NET Framework 2.0 or higher"> Installed OR <![CDATA[MsiNetAssemblySupport >= "2.0.50727"]]> </Condition> <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> <UI> <UIRef Id="WixUI_FeatureTree"/> <UIRef Id="WixUI_ErrorProgressText"/> </UI> <!-- Define installation directory structure --> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="NewId_Company" Name="Company"> <Directory Id="NewId_Product" Name="Product"> <Directory Id="NewId_NC_InstallLocation" Name="bin" /> </Directory> </Directory> </Directory> </Directory> <DirectoryRef Id="NewId_NC_InstallLocation"> <Component Id="NewId_NetworkClient.exe" Guid="{211B0BD3-ECB8-4fcb-9006-D8B33E1C092E}"> <File Id="NewId_NetworkClient.exe" KeyPath="yes" DiskId="1" Source="$(var.NFAQ.NetworkClient.TargetDir)\NetworkClient.exe" /> </Component> <Component Id="NewId_IUConfig.xml" Guid="{5B70C6EE-D3C9-46b4-B23E-1738E481631E}"> <File Id="NewId_IUConfig.xml" KeyPath="yes" DiskId="1" Source="IUConfig.xml" /> </Component> </DirectoryRef> <Feature Id="NewId_NetworkClientFeature" Title="Network Client" Level="1" AllowAdvertise="yes"> <ComponentRef Id="NewId_NetworkClient.exe"/> <ComponentRef Id="NewId_IUConfig.xml"/> </Feature> <!-- Install/Uninstall/Commit/Rollback Network Client Master Service --> <Binary Id="NewId_InstallUtil" SourceFile="C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtilLib.dll" /> <CustomAction Id="NewId_InstallServiceSetProp" Property="NewId_InstallService" Value="/installtype=notransaction /action=install /LogFile= "[#NewId_NetworkClient.exe]" "[NewId_NC_InstallLocation]IUConfig.xml""/> <CustomAction Id="NewId_InstallService" BinaryKey="NewId_InstallUtil" DllEntry="ManagedInstall" Execute="deferred" Impersonate="no"/> <CustomAction Id="NewId_UnInstallServiceSetProp" Property="NewId_UnInstallService" Value="/installtype=notransaction /action=uninstall /LogFile= "[#NewId_NetworkClient.exe]" "[NewId_NC_InstallLocation]IUConfig.xml""/> <CustomAction Id="NewId_UnInstallService" BinaryKey="NewId_InstallUtil" DllEntry="ManagedInstall" Execute="deferred" Impersonate="no"/> <CustomAction Id="NewId_CommitServiceSetProp" Property="NewId_CommitService" Value="/installtype=notransaction /action=commit /LogFile= "[#NewId_NetworkClient.exe]" "[NewId_NC_InstallLocation]IUConfig.xml""/> <CustomAction Id="NewId_CommitService" BinaryKey="NewId_InstallUtil" DllEntry="ManagedInstall" Execute="commit"/> <CustomAction Id="NewId_RollbackServiceSetProp" Property="NewId_RollbackService" Value="/installtype=notransaction /action=rollback /LogFile= "[#NewId_NetworkClient.exe]" "[NewId_NC_InstallLocation]IUConfig.xml""/> <CustomAction Id="NewId_RollbackService" BinaryKey="NewId_InstallUtil" DllEntry="ManagedInstall" Execute="rollback"/> <InstallExecuteSequence> <Custom Action="NewId_UnInstallServiceSetProp" After="MsiUnpublishAssemblies" /> <Custom Action="NewId_UnInstallService" After="NewId_UnInstallServiceSetProp" /> <Custom Action="NewId_InstallServiceSetProp" After="StartServices" /> <Custom Action="NewId_InstallService" After="NewId_InstallServiceSetProp" /> <Custom Action="NewId_RollbackServiceSetProp" After="NewId_InstallService" /> <Custom Action="NewId_RollbackService" After="NewId_RollbackServiceSetProp" /> <Custom Action="NewId_CommitServiceSetProp" After="NewId_RollbackService" /> <Custom Action="NewId_CommitService" After="NewId_CommitServiceSetProp" /> </InstallExecuteSequence> </Product> </Wix> (2) IUConfig.xml <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="2.0.50727" /> </startup> </configuration> Thank you, Raz -----Original Message----- From: Rajendra Magar [mailto:rma...@newfrontieradvisors.com] Sent: Tuesday, February 23, 2010 2:48 PM To: 'wix-users@lists.sourceforge.net' Subject: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Hi, I am working on a Visual Studio WiX project to install a .NET installer-based service using InstallUtilLib.dll/ManagedInstall. I was following the instructions in the following link. http://blog.vagmim.com/2004/09/installing-windows-services-created.html The preceding link uses InstallUtilLib.dll from .NET version 1.0 whereas I am using InstallUtilLib.dll from .NET version 2.0. When I tried to install the generated msi on a Vista machine, I got "Error 2869: The dialog ErrorDlg has the error style bit set, but is no an error dialog". When I tried to install on an XP machine, I got "InstallUtilLib.dll: Unknown error". I am attaching the verbose logs from both installation instances. I looked into the logs and also searched around in online forums but I can't seem to find a way to fix these errors by manipulating my WiX input. While I know that the author of the above link and Rob Mensching don't recommend installing services using a managed code custom action, I have no choice at the moment. :( Could someone please be kind with me and tell me what I could do to get my msi to install correctly? I am also attaching my WiX source and the config file used by InstallUtilLib.dll Sincerely, Raz Magar ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ 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 Portland House, Bressenden Place, London, SW1E 5BF (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 7821 3848 or e-mail inet.hqhelpd...@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). ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users