パフォーマンス カウンタ カスタムアクション

(WiXUtilExtension の一部である) PerfCounter エレメントは、あなたのパフォーマンス カウンタを Windows API に登録する事を可能にします。登録成功するのに すべて一緒に働く いくつかの部品が あります:

サンプル WiX ソース フラグメントと PerfCounter.ini

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <DirectoryRef Id="BinDir">
      <Component Id="SharedNative" DiskId="1">
 
        <Registry Id="Shared_r1" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\MyApplication\Performance" Name="Open" Value="OpenPerformanceData" Type="string" />
        <Registry Id="Shared_r2" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\MyApplication\Performance" Name="Collect" Value="CollectPerformanceData" Type="string" />
        <Registry Id="Shared_r3" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\MyApplication\Performance" Name="Close" Value="ClosePerformanceData" Type="string" />
        <Registry Id="Shared_r4" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\MyApplication\Performance" Name="Library" Value="[!PERFDLL.DLL]" Type="string" />
 
       <File Id="PERFDLL.DLL" Name="MyPerfDll.dll" Source="x86\debug\0\myperfdll.dll" />
 
       <File Id="PERFCOUNTERS.H" Name="PerfCounters.h" Source="x86\debug\0\perfcounters.h" />
       <File Id="PERFCOUNTERS.INI" Name="PerfCounters.ini" Source="x86\debug\0\perfcounters.ini" >
          <PerfCounter Name="MyApplication" />
       </File>
 
      </Component>
    </DirectoryRef>
  </Fragment>
</Wix>

サンプル PerfCounters.ini:
[info]
drivername=MyApplication
symbolfile=PerfCounters.h
 
[languages] 
009=English
004=Chinese
 
[objects]
PERF_OBJECT_1_009_NAME=Performance object name
PERF_OBJECT_1_004_NAME=Performance object name in Chinese
 
[text]  
OBJECT_1_009_NAME=Name of the device
OBJECT_1_009_HELP=Displays performance statistics of the device
OBJECT_1_004_NAME=Name of the device in Chinese
OBJECT_1_004_HELP=Displays performance statistics of the device in Chinese
 
DEVICE_COUNTER_1_009_NAME=Name of first counter
DEVICE_COUNTER_1_009_HELP=Displays the current value of the first counter
DEVICE_COUNTER_1_004_NAME=Name of the first counter in Chinese
DEVICE_COUNTER_1_004_HELP=Displays the value of the first counter in Chinese
 
DEVICE_COUNTER_2_009_NAME=Name of the second counter
DEVICE_COUNTER_2_009_HELP=Displays the current rate of the second counter
DEVICE_COUNTER_2_004_NAME=Name of the second counter in Chinese
DEVICE_COUNTER_2_004_HELP=Displays the rate of the second counter in Chinese
 
PERF_OBJECT_1_009_NAME=Name of the third counter
PERF_OBJECT_1_009_HELP=Displays the current rate of the third counter
PERF_OBJECT_1_004_NAME=Name of the third counter in Chinese
PERF_OBJECT_1_004_HELP=Displays the rate of the third counter in Chinese
サンプル PerfCounters.h:
#define OBJECT_1    0
#define DEVICE_COUNTER_1    2
#define DEVICE_COUNTER_2    4
#define PERF_OBJECT_1    8