Re: [WiX-users] custom action executing managed executables
Beyond what the other people suggested, I think the QtExec CA already does what you suggested with the executable data. However, you really shouldn't use an executable. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Doubrovkine Sent: Monday, October 22, 2007 14:30 To: wix-users@lists.sourceforge.net Subject: [WiX-users] custom action executing managed executables Dear all, I read robmen's article on managed custom actions. I have an installer type activity to execute that I must do during installation (installing performance counters). You need to be admin to do that, so I have to run it within the installation. We want to execute the InstallPerfCounters.exe with a CA, which works easily with a CustomAction. Unfortunately you don't get any feedback except success and failure. I'd like InstallPerfCounters.exe to log back. So I thought of a simple solution: implement a C++ custom action that spawns InstallPerfCounters.exe, hooks up to its stdout and logs all lines into the MSI log using the MSI API. Thus anything that InstallPerfCounters.exe outputs will appear in the log. Has anyone done something like this? Is this a good/bad/crazy idea? Thx dB. Daniel Doubrovkine (dB.) Development Manager Lead Architect Application Security Inc. appsecinc.comhttp://www.appsecinc.com/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
Re: [WiX-users] custom action executing managed executables
This appears not to change in .NET Framework 3.5 Beta 2, which isn't too surprising as this is part of System.dll and hence one of the 'red bits', so the assembly is still marked version 2.0.0.0 and part of '.NET Framework 2.0 SP1'. Yes, the new Framework bits are added onto the existing Framework in new assemblies, apart from a few places where new methods have been added to existing classes. For completeness, .NET Framework 3.5 adds support for Windows Vista and Server 2008's new 'PERFLIB 2.0' which changes the way performance counters are defined and managed. This time it looks like the Framework people have actually understood that you might want to register the counters in an elevated process and use them from a non-privileged one. This will entail additional extensions to how WiX currently does it, because, guess what, the only documented way to do it is to run lodctr with a /m switch specifying the XML-derived manifest. Well, barely documented - MSDN says to look on TechNet, there's no command-line reference for Windows Vista on there, and the Windows Server 2008 documentation omits lodctr.exe. I can't find any documented APIs to do this - maybe you still call LoadPerfCounterTextStrings passing effectively the lodctr command line? But MSDN only refers to the old .ini method. Honestly, though, I don't think anyone will be using PerfLib 2.0 for a while simply because it's only supported on Windows Vista and Server 2008. There isn't a library to transform back to the old way for downlevel Windows. -- Mike Dimmick _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Dimmick Sent: 22 October 2007 23:17 To: 'Daniel Doubrovkine'; wix-users@lists.sourceforge.net Subject: Re: [WiX-users] custom action executing managed executables WiX includes functionality to call the LoadPerfCounterTextStrings and UnloadPerfCounterTextStrings APIs and create the registry entries required. See the PerformanceCategory and PerformanceCounter elements in the Util schema. This feature is new in WiX v3.0. If still using WiX 2.0, you can instead specify an INI file which contains the counter information, which in turn includes a header file which defines the order of the names. This is in fact what .NET does internally when you call PerformanceCounterCategory.Create - it's the only supported method of doing it - but they have failed to provide a way to export the INI and header files, such as you might need to do if, I don't know, you were building an installer! .NET actually runs the lodctr.exe program, which has shipped with Windows since at least Windows 2000 I believe (it might have been a resource kit tool in NT 4.0, it certainly was before that), whereas WiX currently calls the APIs which were only added in Windows 2000. If you want to build a horrible hack tool using reflection g, see System.Diagnostics.PerformanceCounterLib.CreateSymbolFile and CreateIniFile in System.dll. Sadly PerformanceCounterLib is declared 'internal' while both methods are declared 'private', that's why you'd have to use reflection. You'd also have to add the required registry entries yourself, see the CreateRegistryEntry method for what needs to be added. Still, I'd much prefer doing this than some messy managed custom action lashup. Or you could simply see the code in src\ext\UtilExtension\wixext\UtilCompiler.cs from WiX v3.0 in the ParsePerformanceCategoryElement method. -- Mike Dimmick _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Doubrovkine Sent: 22 October 2007 22:30 To: wix-users@lists.sourceforge.net Subject: [WiX-users] custom action executing managed executables Dear all, I read robmen's article on managed custom actions. I have an installer type activity to execute that I must do during installation (installing performance counters). You need to be admin to do that, so I have to run it within the installation. We want to execute the InstallPerfCounters.exe with a CA, which works easily with a CustomAction. Unfortunately you don't get any feedback except success and failure. I'd like InstallPerfCounters.exe to log back. So I thought of a simple solution: implement a C++ custom action that spawns InstallPerfCounters.exe, hooks up to its stdout and logs all lines into the MSI log using the MSI API. Thus anything that InstallPerfCounters.exe outputs will appear in the log. Has anyone done something like this? Is this a good/bad/crazy idea? Thx dB. Daniel Doubrovkine (dB.) Development Manager Lead Architect Application Security Inc. appsecinc.com http://www.appsecinc.com/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com
[WiX-users] custom action executing managed executables
Dear all, I read robmen's article on managed custom actions. I have an installer type activity to execute that I must do during installation (installing performance counters). You need to be admin to do that, so I have to run it within the installation. We want to execute the InstallPerfCounters.exe with a CA, which works easily with a CustomAction. Unfortunately you don't get any feedback except success and failure. I'd like InstallPerfCounters.exe to log back. So I thought of a simple solution: implement a C++ custom action that spawns InstallPerfCounters.exe, hooks up to its stdout and logs all lines into the MSI log using the MSI API. Thus anything that InstallPerfCounters.exe outputs will appear in the log. Has anyone done something like this? Is this a good/bad/crazy idea? Thx dB. Daniel Doubrovkine (dB.) Development Manager Lead Architect Application Security Inc. appsecinc.com http://www.appsecinc.com/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
Re: [WiX-users] custom action executing managed executables
This is probably a timely posting/read for you: http://blogs.msdn.com/windows_installer_team/archive/2007/10/20/integration-hurdles-for-exe-custom-actions.aspx Daniel Doubrovkine [EMAIL PROTECTED] wrote: Dear all, I read robmens article on managed custom actions. I have an installer type activity to execute that I must do during installation (installing performance counters). You need to be admin to do that, so I have to run it within the installation. We want to execute the InstallPerfCounters.exe with a CA, which works easily with a CustomAction. Unfortunately you dont get any feedback except success and failure. Id like InstallPerfCounters.exe to log back. So I thought of a simple solution: implement a C++ custom action that spawns InstallPerfCounters.exe, hooks up to its stdout and logs all lines into the MSI log using the MSI API. Thus anything that InstallPerfCounters.exe outputs will appear in the log. Has anyone done something like this? Is this a good/bad/crazy idea? Thx dB. Daniel Doubrovkine (dB.) Development Manager Lead Architect Application Security Inc. appsecinc.com - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
Re: [WiX-users] custom action executing managed executables
WiX includes functionality to call the LoadPerfCounterTextStrings and UnloadPerfCounterTextStrings APIs and create the registry entries required. See the PerformanceCategory and PerformanceCounter elements in the Util schema. This feature is new in WiX v3.0. If still using WiX 2.0, you can instead specify an INI file which contains the counter information, which in turn includes a header file which defines the order of the names. This is in fact what .NET does internally when you call PerformanceCounterCategory.Create - it's the only supported method of doing it - but they have failed to provide a way to export the INI and header files, such as you might need to do if, I don't know, you were building an installer! .NET actually runs the lodctr.exe program, which has shipped with Windows since at least Windows 2000 I believe (it might have been a resource kit tool in NT 4.0, it certainly was before that), whereas WiX currently calls the APIs which were only added in Windows 2000. If you want to build a horrible hack tool using reflection g, see System.Diagnostics.PerformanceCounterLib.CreateSymbolFile and CreateIniFile in System.dll. Sadly PerformanceCounterLib is declared 'internal' while both methods are declared 'private', that's why you'd have to use reflection. You'd also have to add the required registry entries yourself, see the CreateRegistryEntry method for what needs to be added. Still, I'd much prefer doing this than some messy managed custom action lashup. Or you could simply see the code in src\ext\UtilExtension\wixext\UtilCompiler.cs from WiX v3.0 in the ParsePerformanceCategoryElement method. -- Mike Dimmick _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Doubrovkine Sent: 22 October 2007 22:30 To: wix-users@lists.sourceforge.net Subject: [WiX-users] custom action executing managed executables Dear all, I read robmen's article on managed custom actions. I have an installer type activity to execute that I must do during installation (installing performance counters). You need to be admin to do that, so I have to run it within the installation. We want to execute the InstallPerfCounters.exe with a CA, which works easily with a CustomAction. Unfortunately you don't get any feedback except success and failure. I'd like InstallPerfCounters.exe to log back. So I thought of a simple solution: implement a C++ custom action that spawns InstallPerfCounters.exe, hooks up to its stdout and logs all lines into the MSI log using the MSI API. Thus anything that InstallPerfCounters.exe outputs will appear in the log. Has anyone done something like this? Is this a good/bad/crazy idea? Thx dB. Daniel Doubrovkine (dB.) Development Manager Lead Architect Application Security Inc. appsecinc.com http://www.appsecinc.com/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users