We do this and it works for us (Same situation). Add a reference to the util extension, and add it to your namespace definitions
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> then in the appropriate component.... <util:EventSource Name='AppName' Log='AppName' EventMessageFile='[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll' SupportsErrors='yes' SupportsWarnings='yes' SupportsInformationals='yes'/> -----Original Message----- From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] Sent: Saturday, October 24, 2009 5:30 PM To: 'General discussion for Windows Installer XML toolset.' Subject: Re: [WiX-users] How do I add both a HKLM and a HKCU key to the registry? I need a custom action to create the event source as otherwise when my 2 services and app try to write to the event log they fail. If the services/app tries to create the event source, if it does not exist, there is a supposed delay and the event log cannot be written to and this indeed seems to be the case when I have debugged this. I'm fine with installing app per machine and the only reason I want to do anything with HKCU is to make sure I clear out registry entries per user when the product is uninstalled. Maybe my app is NEVER supposed to write to HKCU if installed for all users. Is that true? Ideally I want to install/uninstall for all users but allow each actual user to have their own window coordinates and other persisted user only data. Not sure if this is allowed for. Question: If an application is installed per user for 3 users for a total of 3 installs, is there some sort of reference count kept for the # of users that installed the app such that the app is really uninstalled after the last user uninstalls it? I know Win7 and Server 2008 are different so let's not consider those in regards to this question as they seem to actually install in a user program files folder rather than the common folder. Thanks for all your help Blair! - Dave -----Original Message----- From: Rob Mensching [mailto:r...@robmensching.com] Sent: Saturday, October 24, 2009 5:23 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] How do I add both a HKLM and a HKCU key to the registry? Why do you need a custom action for event logs? Also, writing/deleting per-user content via installation packages rarely works out as well as people hope because you can't modify all the user profiles. Only the current user. In general, HKCU stuff should be managed by the application. Finally, a verbose log file should explain why a Component is not being installed. The behavior you are describing so far is not expected. There is something else. On Sat, Oct 24, 2009 at 1:33 AM, Dave Kolb <d...@dotnetcodeslingers.com>wrote: > Well I flipped the order of the components in the directory node and the > feature node and still only the HKCU key got installed. > > I think I will just have a custom action update/delete the registry for me > since I have to do that with event logs anyway. > > - Dave > > -----Original Message----- > From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] > Sent: Saturday, October 24, 2009 3:50 AM > To: 'General discussion for Windows Installer XML toolset.' > Subject: RE: [WiX-users] How do I add both a HKLM and a HKCU key to the > registry? > > Hi Blair, you probably meant adding KeyPath to a <RegistryValue> element. > After I did that, I got this to somewhat work but only the HKCU key gets > created and not the HKLM key. No complaints during install in the log file. > I am doing a perMachine install and it seems if anything it should do the > HKLM key and not the HKCU key. Maybe it just does the second one for some > reason? > > - Thanks, Dave > > <Package Platform="$(var.ProcessorArchitecture)" > Manufacturer="$(var.Property_Author)" InstallScope="perMachine" > InstallerVersion="$(var.Property_InstallerVersion)" > Compressed="yes" > Comments="CmdMan Manager Service"/> > > <Property Id="MYCOMPANYNAME" Value="49thLatitude" /> > <Property Id="MYPRODUCTROOT" Value="CmdMan" /> > > <!-- Define the directory structure. --> > <Directory Id="TARGETDIR" Name="SourceDir"> > > <!-- add our root registry entry --> > <Component Id="C_HKLM_RegistryEntries" Guid="{xxx}"> > <RegistryKey Root="HKLM" > > Key="Software\[MYCOMPANYNAME]\[MYPRODUCTROOT]\CmdMan.Manager.Service" > Action="createAndRemoveOnUninstall"> > <RegistryValue Type="integer" Name="Installed" Value="1" > KeyPath="yes"/> > </RegistryKey> > </Component> > <Component Id="C_HKCU_RegistryEntries" Guid="{zzz}"> > <RegistryKey Root="HKCU" > > Key="Software\[MYCOMPANYNAME]\[MYPRODUCTROOT]\CmdMan.Manager.Service" > Action="createAndRemoveOnUninstall"> > <RegistryValue Type="integer" Name="Installed" Value="1" > KeyPath="yes"/> > </RegistryKey> > </Component> > Etc... > > <Feature Id="DefaultFeature" ConfigurableDirectory="TARGETDIR" > Level="1"> > <ComponentRef Id="C_HKLM_RegistryEntries"/> > <ComponentRef Id="C_HKCU_RegistryEntries"/> > Etc... > > -----Original Message----- > From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] > Sent: Saturday, October 24, 2009 1:58 AM > To: 'General discussion for Windows Installer XML toolset.' > Subject: RE: [WiX-users] How do I add both a HKLM and a HKCU key to the > registry? > > > Candle doesn't like Keypath on that element: error CNDL0004: The > RegistryKey > element contains an unexpected attribute 'KeyPath'. > > > -----Original Message----- > From: Blair [mailto:os...@live.com] > Sent: Saturday, October 24, 2009 1:22 AM > To: 'General discussion for Windows Installer XML toolset.' > Subject: Re: [WiX-users] How do I add both a HKLM and a HKCU key to the > registry? > > Try adding KeyPath="yes" to each of your two RegistryKey elements. > > -----Original Message----- > From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] > Sent: Friday, October 23, 2009 6:34 PM > To: 'General discussion for Windows Installer XML toolset.' > Subject: [WiX-users] How do I add both a HKLM and a HKCU key to the > registry? > > During install, I am trying to add both an HKLM key and an HKCU key for my > product. My wxs looks like the below. When this compiles I get the error > > > > "ICE57: Component 'C_HKCU_RegistryEntries' has both per-user > and per-machine data with a per-machine KeyPath ". > > > > I have both components in the features element and since I have these > defined are separate components I do not understand why this does not work. > Any suggestions much appreciated. > > > > Thanks, Dave > > > > <!-- Define the directory structure. --> > > <Directory Id="TARGETDIR" Name="SourceDir"> > > > > <!-- add our root registry entries --> > > <Component Id="C_HKLM_RegistryEntries" Guid="xxx"> > > <RegistryKey Root="HKLM" > > Key="Software\[MYCOMPANYNAME]\[MYPRODUCTROOT]\Manager" > > Action="createAndRemoveOnUninstall"> > > </RegistryKey> > > </Component> > > <Component Id="C_HKCU_RegistryEntries" Guid="xxx"> > > <RegistryKey Root="HKCU" > > Key="Software\[MYCOMPANYNAME]\[MYPRODUCTROOT]\Manager" > > Action="createAndRemoveOnUninstall"> > > </RegistryKey> > > </Component> > > > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature > database 4537 (20091023) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > ---------------------------------------------------------------------------- > -- > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > ---------------------------------------------------------------------------- > -- > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > ---------------------------------------------------------------------------- -- > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > -- virtually, Rob Mensching - http://RobMensching.com LLC ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users