Michael, thank you for the tip. Raz
-----Original Message----- From: Michael Osmond [mailto:mosm...@baytech.com.au] Sent: Wednesday, February 24, 2010 3:50 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Raz, I do not know of a built in property. You want something like (I have mocked this up, so you will need to check the values for account names, and the VersionNT value for XP which i think is 510): <Property Id="SERVICEACCOUNT" Secure="yes" Value="NetworkService" /> <CustomAction Id="SetServiceAcct_Win2kXp" Property="SERVICEACCOUNT" Value="LocalSystem" Execute="firstSequence" /> <InstallExecuteSequence> <Custom Action=" SetServiceAcct_Win2kXp " After="Somewhere" ><![CDATA[VersionNT <= 510]]></Custom> </InstallExecuteSequence> Michael -----Original Message----- From: Rajendra Magar [mailto:rma...@newfrontieradvisors.com] Sent: Thursday, 25 February 2010 5:45 AM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Michael, thank you for your insight. Is there a built-in property that I can use that will automatically resolve to the right account name depending on the target platform? If I have to define this property myself, is there a way to automatically set its value depending on the target platform? Thank you, Raz -----Original Message----- From: Michael Osmond [mailto:mosm...@baytech.com.au] Sent: Tuesday, February 23, 2010 5:57 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Hi I know I am coming in late on this one, so forgive me if I cover something that has already been said. My understanding is that NetworkService came in with Windows 2003 so it is not "native" so to speak to windows 2000/XP. What you could do set the Account to be a property, and depending on the platform type resolve your property to an account that is suitable to the platform. I would suggest that on anything less than 2003 you use LocalSystem. Also, NetworkService is called such because it is able to impersonate the Machine identity when connecting to network resources LocalSystem in fact also has this ability. Regards Michael -----Original Message----- From: Rajendra Magar [mailto:rma...@newfrontieradvisors.com] Sent: Wednesday, 24 February 2010 8:38 AM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Yes I did. I used 'Account="NT Authority\Network Service"' and it worked in all of the machine configurations I tested but the experience described in the link below tells me that this value could be fragile. http://www.mail-archive.com/wix-users@lists.sourceforge.net/msg27992.html Are you aware of a value that will work with 100% guarantee in all the platforms? I can't seem to find any documentation on that. Thank you, Raz -----Original Message----- From: Arun Perregatturv [mailto:aperregatt...@napcosecurity.com] Sent: Tuesday, February 23, 2010 5:21 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Did you try using Network Service? with std wix servicecontrol? Arun Perregattur -----Original Message----- From: Rajendra Magar [mailto:rma...@newfrontieradvisors.com] Sent: Tuesday, February 23, 2010 5:01 PM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll In my case I am required to use NetworkService because the installer I am working on is supposed to install a client that looks for problems to solve on a network drive. Thank you, Raz -----Original Message----- From: Arun Perregatturv [mailto:aperregatt...@napcosecurity.com] Sent: Tuesday, February 23, 2010 4:55 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll For our service we set the Account to LocalSystem and works fine. Arun Perregattur -----Original Message----- From: Rajendra Magar [mailto:rma...@newfrontieradvisors.com] Sent: Tuesday, February 23, 2010 4:44 PM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll Arun and Phil, Thank you but I am stuck with a .NET installer class which does much more than just install the service so I did not use ServiceInstall and ServiceControl. Besides ServiceInstall doesn't seem to obey the service parameters set by the installer class. For example, the .NET installer class I have sets the service account to NetworkService and if I want to use NetworkService account to run the installed service using ServiceInstall I have to specify Account="NT Authority\Network Service", which I have been warned in several forums may not always work for all Windows platforms. Please let me know if you are aware of a good documentation on what Account value to use that will work on all target machines. Phil, thank you for the "condition" hint. The link I pasted below (http://blog.vagmim.com/2004/09/installing-windows-services-created.html) had conditions around the custom actions. I am afraid I seemed to have ignored them since I didn't understand what they were exactly. I will try with those conditions and provide an update. Sincerely, Raz -----Original Message----- From: Wilson, Phil [mailto:phil.wil...@invensys.com] Sent: Tuesday, February 23, 2010 4:20 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Problem installing a .NET installer-based service using InstallUtilLib.dll 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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