summary refs log blame commit diff stats
path: root/win32/wdkpt/vs2010/wdkpt.aip
blob: 38502e5e4d4795bd283e5cd607562be2d0d90341 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                        
                                                                                                                                                               






                                                                                                                                                                                                                                                  



                                                                                                      
                                                                                                 
                                                   
                                                                                                                
                                                           










                                                                                                                
                                                                                                 










                                                                                                                                                                                                  

                                                              
                                                                                                                                                                                                                 








                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                  











































































                                                                                                                                                                                                







                                                                                                                            
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOCUMENT Type="Advanced Installer" CreateVersion="9.2" version="9.5" Modules="simple" RootPath="." Language="en" Id="{F800981F-A57B-40E4-91FE-3C228741E1AD}">
  <COMPONENT cid="caphyon.advinst.msicomp.MsiValidationComponent">
    <ROW Table="File" Column="Sequence" MinValue="1" MaxValue="32767" Description="Sequence with respect to the media images; order must track cabinet order." Options="0" ColumnType="2" ColumnIndex="7" ColumnSize="2" MsiKey="File#Sequence"/>
    <ROW Table="Media" Column="LastSequence" MinValue="0" MaxValue="32767" Description="File sequence number for the last file for this media." Options="0" ColumnType="2" ColumnIndex="1" ColumnSize="2" MsiKey="Media#LastSequence"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">
    <ROW Property="ALLUSERS" Value="2" MultiBuildValue="DefaultBuild:1"/>
    <ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/>
    <ROW Property="ARPHELPLINK" Value="http://www.hexchat.org/developers/wdk-platform-toolset"/>
    <ROW Property="ARPURLINFOABOUT" Value="http://www.hexchat.org/developers/wdk-platform-toolset"/>
    <ROW Property="ARPURLUPDATEINFO" Value="http://www.hexchat.org/developers/wdk-platform-toolset"/>
    <ROW Property="Manufacturer" Value="HexChat" ValueLocId="*"/>
    <ROW Property="ProductCode" Value="1033:{6C7B98A1-9E15-4756-9FCA-0566ED776BE3} " Type="16"/>
    <ROW Property="ProductLanguage" Value="1033"/>
    <ROW Property="ProductName" Value="Visual Studio 2010 Windows Driver Kit Platform Toolset" ValueLocId="*"/>
    <ROW Property="ProductVersion" Value="1.1" Type="32"/>
    <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
    <ROW Property="UpgradeCode" Value="{1947FE78-21A1-4B81-99CE-E07AAEE6077D}"/>
    <ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
    <ROW Property="WindowsType9XDisplay" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiDirsComponent">
    <ROW Directory="APPDIR" Directory_Parent="TARGETDIR" DefaultDir="APPDIR:." IsPseudoRoot="1"/>
    <ROW Directory="MSBuild_Dir" Directory_Parent="ProgramFilesFolder" DefaultDir="MSBuild"/>
    <ROW Directory="Microsoft.Cpp_Dir" Directory_Parent="MSBuild_Dir" DefaultDir="Micros~1.Cpp|Microsoft.Cpp"/>
    <ROW Directory="PlatformToolsets_1_Dir" Directory_Parent="x64_Dir" DefaultDir="Platfo~1|PlatformToolsets"/>
    <ROW Directory="PlatformToolsets_Dir" Directory_Parent="Win32_Dir" DefaultDir="Platfo~1|PlatformToolsets"/>
    <ROW Directory="Platforms_Dir" Directory_Parent="v4.0_Dir" DefaultDir="Platfo~1|Platforms"/>
    <ROW Directory="ProgramFilesFolder" Directory_Parent="TARGETDIR" DefaultDir="Progra~1|ProgramFilesFolder" IsPseudoRoot="1"/>
    <ROW Directory="TARGETDIR" DefaultDir="SourceDir"/>
    <ROW Directory="WDK7_1_Dir" Directory_Parent="PlatformToolsets_1_Dir" DefaultDir="WDK7"/>
    <ROW Directory="WDK7_Dir" Directory_Parent="PlatformToolsets_Dir" DefaultDir="WDK7"/>
    <ROW Directory="Win32_Dir" Directory_Parent="Platforms_Dir" DefaultDir="Win32"/>
    <ROW Directory="v4.0_Dir" Directory_Parent="Microsoft.Cpp_Dir" DefaultDir="v4.0"/>
    <ROW Directory="x64_Dir" Directory_Parent="Platforms_Dir" DefaultDir="x64"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
    <ROW Component="Microsoft.Cpp.Win32.WDK7.props" ComponentId="{3EA16365-3C7E-4F84-A326-C7F28B33F487}" Directory_="WDK7_Dir" Attributes="0" KeyPath="Microsoft.Cpp.Win32.WDK7.props" Type="0"/>
    <ROW Component="Microsoft.Cpp.x64.WDK7.props" ComponentId="{50DB333C-5D3E-4A14-80B9-BA1D727BD220}" Directory_="WDK7_1_Dir" Attributes="0" KeyPath="Microsoft.Cpp.x64.WDK7.props" Type="0"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
    <ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="Microsoft.Cpp.Win32.WDK7.props Microsoft.Cpp.x64.WDK7.props"/>
    <ATTRIBUTE name="CurrentFeature" value="MainFeature"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
    <ROW File="Microsoft.Cpp.Win32.WDK7.props" Component_="Microsoft.Cpp.Win32.WDK7.props" FileName="Micros~1.pro|Microsoft.Cpp.Win32.WDK7.props" Attributes="0" SourcePath="Microsoft.Cpp.Win32.WDK7.props" SelfReg="false" NextFile="Microsoft.Cpp.Win32.WDK7.targets"/>
    <ROW File="Microsoft.Cpp.Win32.WDK7.targets" Component_="Microsoft.Cpp.Win32.WDK7.props" FileName="Micros~1.tar|Microsoft.Cpp.Win32.WDK7.targets" Attributes="0" SourcePath="Microsoft.Cpp.Win32.WDK7.targets" SelfReg="false" NextFile="Microsoft.Cpp.x64.WDK7.props"/>
    <ROW File="Microsoft.Cpp.x64.WDK7.props" Component_="Microsoft.Cpp.x64.WDK7.props" FileName="Micros~1.pro|Microsoft.Cpp.x64.WDK7.props" Attributes="0" SourcePath="Microsoft.Cpp.x64.WDK7.props" SelfReg="false" NextFile="Microsoft.Cpp.x64.WDK7.targets"/>
    <ROW File="Microsoft.Cpp.x64.WDK7.targets" Component_="Microsoft.Cpp.x64.WDK7.props" FileName="Micros~1.tar|Microsoft.Cpp.x64.WDK7.targets" Attributes="0" SourcePath="Microsoft.Cpp.x64.WDK7.targets" SelfReg="false"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">
    <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="." PackageFileName="Visual Studio 2010 Windows Driver Kit Platform Toolset 1.1" Languages="en" InstallationType="4" UseLargeSchema="true"/>
    <ATTRIBUTE name="CurrentBuild" value="DefaultBuild"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent">
    <ROW Path="&lt;AI_DICTS&gt;ui.ail"/>
    <ROW Path="&lt;AI_DICTS&gt;ui_en.ail"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.FragmentComponent">
    <ROW Fragment="CommonUI.aip" Path="&lt;AI_FRAGS&gt;CommonUI.aip"/>
    <ROW Fragment="MaintenanceTypeDlg.aip" Path="&lt;AI_THEMES&gt;classic\fragments\MaintenanceTypeDlg.aip"/>
    <ROW Fragment="MaintenanceWelcomeDlg.aip" Path="&lt;AI_THEMES&gt;classic\fragments\MaintenanceWelcomeDlg.aip"/>
    <ROW Fragment="SequenceDialogs.aip" Path="&lt;AI_THEMES&gt;classic\fragments\SequenceDialogs.aip"/>
    <ROW Fragment="Sequences.aip" Path="&lt;AI_FRAGS&gt;Sequences.aip"/>
    <ROW Fragment="StaticUIStrings.aip" Path="&lt;AI_FRAGS&gt;StaticUIStrings.aip"/>
    <ROW Fragment="UI.aip" Path="&lt;AI_THEMES&gt;classic\fragments\UI.aip"/>
    <ROW Fragment="Validation.aip" Path="&lt;AI_FRAGS&gt;Validation.aip"/>
    <ROW Fragment="VerifyRemoveDlg.aip" Path="&lt;AI_THEMES&gt;classic\fragments\VerifyRemoveDlg.aip"/>
    <ROW Fragment="VerifyRepairDlg.aip" Path="&lt;AI_THEMES&gt;classic\fragments\VerifyRepairDlg.aip"/>
    <ROW Fragment="WelcomeDlg.aip" Path="&lt;AI_THEMES&gt;classic\fragments\WelcomeDlg.aip"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiBinaryComponent">
    <ROW Name="aicustact.dll" SourcePath="&lt;AI_CUSTACTS&gt;aicustact.dll"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiControlComponent">
    <ATTRIBUTE name="FixedSizeBitmaps" value="0"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiControlEventComponent">
    <ROW Dialog_="WelcomeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_INSTALL" Ordering="1"/>
    <ROW Dialog_="MaintenanceWelcomeDlg" Control_="Next" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="99"/>
    <ROW Dialog_="CustomizeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_MAINT" Ordering="101"/>
    <ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_INSTALL" Ordering="197"/>
    <ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="WelcomeDlg" Condition="AI_INSTALL" Ordering="201"/>
    <ROW Dialog_="CustomizeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="1"/>
    <ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_MAINT" Ordering="198"/>
    <ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="202"/>
    <ROW Dialog_="MaintenanceTypeDlg" Control_="ChangeButton" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="501"/>
    <ROW Dialog_="MaintenanceTypeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceWelcomeDlg" Condition="AI_MAINT" Ordering="1"/>
    <ROW Dialog_="MaintenanceTypeDlg" Control_="RemoveButton" Event="NewDialog" Argument="VerifyRemoveDlg" Condition="AI_MAINT AND InstallMode=&quot;Remove&quot;" Ordering="601"/>
    <ROW Dialog_="VerifyRemoveDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT AND InstallMode=&quot;Remove&quot;" Ordering="1"/>
    <ROW Dialog_="MaintenanceTypeDlg" Control_="RepairButton" Event="NewDialog" Argument="VerifyRepairDlg" Condition="AI_MAINT AND InstallMode=&quot;Repair&quot;" Ordering="601"/>
    <ROW Dialog_="VerifyRepairDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT AND InstallMode=&quot;Repair&quot;" Ordering="1"/>
    <ROW Dialog_="VerifyRepairDlg" Control_="Repair" Event="EndDialog" Argument="Return" Condition="AI_MAINT AND InstallMode=&quot;Repair&quot;" Ordering="399"/>
    <ROW Dialog_="VerifyRemoveDlg" Control_="Remove" Event="EndDialog" Argument="Return" Condition="AI_MAINT AND InstallMode=&quot;Remove&quot;" Ordering="299"/>
    <ROW Dialog_="PatchWelcomeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_PATCH" Ordering="201"/>
    <ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_PATCH" Ordering="199"/>
    <ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="PatchWelcomeDlg" Condition="AI_PATCH" Ordering="203"/>
    <ROW Dialog_="ResumeDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_RESUME" Ordering="299"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiCustActComponent">
    <ROW Action="AI_DOWNGRADE" Type="19" Target="4010"/>
    <ROW Action="AI_InstallModeCheck" Type="1" Source="aicustact.dll" Target="UpdateInstallMode" WithoutSeq="true"/>
    <ROW Action="AI_PREPARE_UPGRADE" Type="65" Source="aicustact.dll" Target="PrepareUpgrade"/>
    <ROW Action="AI_RESTORE_LOCATION" Type="65" Source="aicustact.dll" Target="RestoreLocation"/>
    <ROW Action="AI_ResolveKnownFolders" Type="1" Source="aicustact.dll" Target="AI_ResolveKnownFolders"/>
    <ROW Action="AI_ResolveLocalizedCredentials" Type="1" Source="aicustact.dll" Target="GetLocalizedCredentials"/>
    <ROW Action="AI_SHOW_LOG" Type="65" Source="aicustact.dll" Target="LaunchLogFile" WithoutSeq="true"/>
    <ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/>
    <ROW Action="SET_APPDIR" Type="307" Source="APPDIR" Target="[ProgramFilesFolder][Manufacturer]\[ProductName]"/>
    <ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/>
    <ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiInstExSeqComponent">
    <ROW Action="AI_DOWNGRADE" Condition="AI_NEWERPRODUCTFOUND AND (UILevel &lt;&gt; 5)" Sequence="210"/>
    <ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=&quot;&quot;" Sequence="749"/>
    <ROW Action="AI_STORE_LOCATION" Condition="(Not Installed) OR REINSTALL" Sequence="1501"/>
    <ROW Action="AI_PREPARE_UPGRADE" Condition="AI_UPGRADE=&quot;No&quot; AND (Not Installed)" Sequence="1399"/>
    <ROW Action="AI_ResolveKnownFolders" Sequence="52"/>
    <ROW Action="AI_ResolveLocalizedCredentials" Sequence="51"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">
    <ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=&quot;&quot;" Sequence="749"/>
    <ROW Action="AI_ResolveKnownFolders" Sequence="52"/>
    <ROW Action="AI_ResolveLocalizedCredentials" Sequence="51"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiLaunchConditionsComponent">
    <ROW Condition="VersionNT" Description="[ProductName] cannot be installed on [WindowsType9XDisplay]" DescriptionLocId="AI.LaunchCondition.No9X" IsPredefined="true" Builds="DefaultBuild"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiThemeComponent">
    <ATTRIBUTE name="UsedTheme" value="classic"/>
  </COMPONENT>
  <COMPONENT cid="caphyon.advinst.msicomp.MsiUpgradeComponent">
    <ROW UpgradeCode="[|UpgradeCode]" VersionMax="[|ProductVersion]" Attributes="1025" ActionProperty="OLDPRODUCTS"/>
    <ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="2" ActionProperty="AI_NEWERPRODUCTFOUND"/>
  </COMPONENT>
</DOCUMENT>
>\t%s", name, msg); } error_printed++; } static int print_summary (int announce, char* format) { char sysinfo[bsize]; char buffer[bsize]; char cpu_model[bsize]; char cpu_cache[bsize]; char cpu_vendor[bsize]; char os_host[bsize]; char os_user[bsize]; char os_kernel[bsize]; unsigned long long mem_total; unsigned long long mem_free; unsigned int count; double cpu_freq; int giga = 0; int weeks; int days; int hours; int minutes; int seconds; sysinfo[0] = '\0'; snprintf (buffer, bsize, "%s", xchat_get_info (ph, "version")); format_output ("HexChat", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (sysinfo)); /* BEGIN OS PARSING */ if (xs_parse_os (os_user, os_host, os_kernel) != 0) { xchat_printf (ph, "%s\tERROR in parse_os()", name); return XCHAT_EAT_ALL; } snprintf (buffer, bsize, "%s", os_kernel); format_output ("OS", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (sysinfo)); /* BEGIN DISTRO PARSING */ if (xs_parse_distro (buffer) != 0) { strncpy (buffer, "Unknown", bsize); } format_output ("Distro", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (sysinfo)); /* BEGIN CPU PARSING */ if (xs_parse_cpu (cpu_model, cpu_vendor, &cpu_freq, cpu_cache, &count) != 0) { xchat_printf (ph, "%s\tERROR in parse_cpu()", name); return XCHAT_EAT_ALL; } if (cpu_freq > 1000) { cpu_freq /= 1000; giga = 1; } if (giga) { snprintf (buffer, bsize, "%d x %s (%s) @ %.2fGHz", count, cpu_model, cpu_vendor, cpu_freq); } else { snprintf (buffer, bsize, "%d x %s (%s) @ %.0fMHz", count, cpu_model, cpu_vendor, cpu_freq); } format_output ("CPU", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (sysinfo)); /* BEGIN MEMORY PARSING */ if (xs_parse_meminfo (&mem_total, &mem_free, 0) == 1) { xchat_printf (ph, "%s\tERROR in parse_meminfo!", name); return XCHAT_EAT_ALL; } snprintf (buffer, bsize, "%s", pretty_freespace ("Physical", &mem_free, &mem_total)); format_output ("RAM", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (sysinfo)); /* BEGIN DISK PARSING */ if (xs_parse_df (NULL, buffer)) { xchat_printf (ph, "%s\tERROR in parse_df", name); return XCHAT_EAT_ALL; } format_output ("Disk", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (buffer)); /* BEGIN VIDEO PARSING */ if (xs_parse_video (buffer)) { xchat_printf (ph, "%s\tERROR in parse_video", name); return XCHAT_EAT_ALL; } format_output ("VGA", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (buffer)); /* BEGIN SOUND PARSING */ if (xs_parse_sound (buffer)) { strncpy (buffer, "Not present", bsize); } format_output ("Sound", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (buffer)); /* BEGIN ETHERNET PARSING */ if (xs_parse_ether (buffer)) { strncpy (buffer, "None found", bsize); } format_output ("Ethernet", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (buffer)); /* BEGIN UPTIME PARSING */ if (xs_parse_uptime (&weeks, &days, &hours, &minutes, &seconds)) { xchat_printf (ph, "%s\tERROR in parse_uptime()", name); return XCHAT_EAT_ALL; } if (minutes != 0 || hours != 0 || days != 0 || weeks != 0) { if (hours != 0 || days != 0 || weeks != 0) { if (days !=0 || weeks != 0) { if (weeks != 0) { snprintf (buffer, bsize, "%dw %dd %dh %dm %ds", weeks, days, hours, minutes, seconds); } else { snprintf (buffer, bsize, "%dd %dh %dm %ds", days, hours, minutes, seconds); } } else { snprintf (buffer, bsize, "%dh %dm %ds", hours, minutes, seconds); } } else { snprintf (buffer, bsize, "%dm %ds", minutes, seconds); } } format_output ("Uptime", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (buffer)); if (announce) { xchat_commandf (ph, "SAY %s", sysinfo); } else { xchat_printf (ph, "%s", sysinfo); } return XCHAT_EAT_ALL; } static int print_os (int announce, char* format) { char buffer[bsize]; char user[bsize]; char host[bsize]; char kernel[bsize]; if (xs_parse_os (user, host, kernel) != 0) { xchat_printf (ph, "%s\tERROR in parse_os()", name); return XCHAT_EAT_ALL; } snprintf (buffer, bsize, "%s@%s, %s", user, host, kernel); format_output ("OS", buffer, format); if (announce) { xchat_commandf (ph, "SAY %s", buffer); } else { xchat_printf (ph, "%s", buffer); } return XCHAT_EAT_ALL; } static int print_distro (int announce, char* format) { char name[bsize]; if (xs_parse_distro (name) != 0) { xchat_printf (ph, "%s\tERROR in parse_distro()!", name); return XCHAT_EAT_ALL; } format_output("Distro", name, format); if (announce) { xchat_commandf (ph, "SAY %s", name); } else { xchat_printf (ph, "%s", name); } return XCHAT_EAT_ALL; } static int print_cpu (int announce, char* format) { char model[bsize]; char vendor[bsize]; char cache[bsize]; char buffer[bsize]; unsigned int count; double freq; int giga = 0; if (xs_parse_cpu (model, vendor, &freq, cache, &count) != 0) { xchat_printf (ph, "%s\tERROR in parse_cpu()", name); return XCHAT_EAT_ALL; } if (freq > 1000) { freq /= 1000; giga = 1; } if (giga) { snprintf (buffer, bsize, "%d x %s (%s) @ %.2fGHz w/ %s L2 Cache", count, model, vendor, freq, cache); } else { snprintf (buffer, bsize, "%d x %s (%s) @ %.0fMHz w/ %s L2 Cache", count, model, vendor, freq, cache); } format_output ("CPU", buffer, format); if (announce) { xchat_commandf (ph, "SAY %s", buffer); } else { xchat_printf (ph, "%s", buffer); } return XCHAT_EAT_ALL; } static int print_ram (int announce, char* format) { unsigned long long mem_total; unsigned long long mem_free; unsigned long long swap_total; unsigned long long swap_free; char string[bsize]; if (xs_parse_meminfo (&mem_total, &mem_free, 0) == 1) { xchat_printf (ph, "%s\tERROR in parse_meminfo!", name); return XCHAT_EAT_ALL; } if (xs_parse_meminfo (&swap_total, &swap_free, 1) == 1) { xchat_printf (ph, "%s\tERROR in parse_meminfo!", name); return XCHAT_EAT_ALL; } snprintf (string, bsize, "%s - %s", pretty_freespace ("Physical", &mem_free, &mem_total), pretty_freespace ("Swap", &swap_free, &swap_total)); format_output ("RAM", string, format); if (announce) { xchat_commandf (ph, "SAY %s", string); } else { xchat_printf (ph, "%s", string); } return XCHAT_EAT_ALL; } static int print_disk (int announce, char* format) { char string[bsize] = {0,}; #if 0 if (*word == '\0') { if (xs_parse_df (NULL, string)) { xchat_printf (ph, "ERROR in parse_df"); return XCHAT_EAT_ALL; } } else { if (xs_parse_df (*word, string)) { xchat_printf (ph, "ERROR in parse_df"); return XCHAT_EAT_ALL; } } #endif if (xs_parse_df (NULL, string)) { xchat_printf (ph, "%s\tERROR in parse_df", name); return XCHAT_EAT_ALL; } format_output ("Disk", string, format); if (announce) { xchat_commandf (ph, "SAY %s", string); } else { xchat_printf (ph, "%s", string); } return XCHAT_EAT_ALL; } static int print_vga (int announce, char* format) { char vid_card[bsize]; char agp_bridge[bsize]; char buffer[bsize]; int ret; if ((ret = xs_parse_video (vid_card)) != 0) { xchat_printf (ph, "%s\tERROR in parse_video! %d", name, ret); return XCHAT_EAT_ALL; } if (xs_parse_agpbridge (agp_bridge) != 0) { snprintf (buffer, bsize, "%s", vid_card); } else { snprintf (buffer, bsize, "%s @ %s", vid_card, agp_bridge); } format_output ("VGA", buffer, format); if (announce) { xchat_commandf (ph, "SAY %s", buffer); } else { xchat_printf (ph, "%s", buffer); } return XCHAT_EAT_ALL; } static int print_sound (int announce, char* format) { char sound[bsize]; if (xs_parse_sound (sound) != 0) { xchat_printf (ph, "%s\tERROR in parse_asound()!", name); return XCHAT_EAT_ALL; } format_output ("Sound", sound, format); if (announce) { xchat_commandf (ph, "SAY %s", sound); } else { xchat_printf (ph, "%s", sound); } return XCHAT_EAT_ALL; } static int print_ethernet (int announce, char* format) { char ethernet_card[bsize]; if (xs_parse_ether (ethernet_card)) { strncpy (ethernet_card, "None found", bsize); } format_output ("Ethernet", ethernet_card, format); if (announce) { xchat_commandf (ph, "SAY %s", ethernet_card); } else { xchat_printf (ph, "%s", ethernet_card); } return XCHAT_EAT_ALL; } static int print_uptime (int announce, char* format) { char buffer[bsize]; int weeks; int days; int hours; int minutes; int seconds; if (xs_parse_uptime (&weeks, &days, &hours, &minutes, &seconds)) { xchat_printf (ph, "%s\tERROR in parse_uptime()", name); return XCHAT_EAT_ALL; } if (minutes != 0 || hours != 0 || days != 0 || weeks != 0) { if (hours != 0 || days != 0 || weeks != 0) { if (days !=0 || weeks != 0) { if (weeks != 0) { snprintf (buffer, bsize, "%dw %dd %dh %dm %ds", weeks, days, hours, minutes, seconds); } else { snprintf (buffer, bsize, "%dd %dh %dm %ds", days, hours, minutes, seconds); } } else { snprintf (buffer, bsize, "%dh %dm %ds", hours, minutes, seconds); } } else { snprintf (buffer, bsize, "%dm %ds", minutes, seconds); } } format_output ("Uptime", buffer, format); if (announce) { xchat_commandf (ph, "SAY %s", buffer); } else { xchat_printf (ph, "%s", buffer); } return XCHAT_EAT_ALL; } static int netdata_cb (char *word[], char *word_eol[], void *userdata) { char netdata[bsize]; char format[bsize]; unsigned long long bytes_recv; unsigned long long bytes_sent; if (*word[2] == '\0') { xchat_printf (ph, "%s\tYou must specify a network device (e.g. /NETDATA eth0)!", name); return XCHAT_EAT_ALL; } if (xs_parse_netdev (word[2], &bytes_recv, &bytes_sent) != 0) { xchat_printf (ph, "%s\tERROR in parse_netdev", name); return XCHAT_EAT_ALL; } bytes_recv /= 1024; bytes_sent /= 1024; snprintf (netdata, bsize, "%s: %.1f MB Recieved, %.1f MB Sent", word[2], (double)bytes_recv/1024.0, (double)bytes_sent/1024.0); xchat_pluginpref_get_str (ph, "format", format); format_output ("Netdata", netdata, format); if (xchat_list_int (ph, NULL, "type") >= 2) { xchat_commandf (ph, "SAY %s", netdata); } else { xchat_printf (ph, "%s", netdata); } return XCHAT_EAT_ALL; } static int netstream_cb (char *word[], char *word_eol[], void *userdata) { char netstream[bsize]; char mag_r[5]; char mag_s[5]; char format[bsize]; unsigned long long bytes_recv; unsigned long long bytes_sent; unsigned long long bytes_recv_p; unsigned long long bytes_sent_p; struct timespec ts = {1, 0}; if (*word[2] == '\0') { xchat_printf (ph, "%s\tYou must specify a network device (e.g. /NETSTREAM eth0)!", name); return XCHAT_EAT_ALL; } if (xs_parse_netdev(word[2], &bytes_recv, &bytes_sent) != 0) { xchat_printf (ph, "%s\tERROR in parse_netdev", name); return XCHAT_EAT_ALL; } while (nanosleep (&ts, &ts) < 0); if (xs_parse_netdev(word[2], &bytes_recv_p, &bytes_sent_p) != 0) { xchat_printf (ph, "%s\tERROR in parse_netdev", name); return XCHAT_EAT_ALL; } bytes_recv = (bytes_recv_p - bytes_recv); bytes_sent = (bytes_sent_p - bytes_sent); if (bytes_recv > 1024) { bytes_recv /= 1024; snprintf (mag_r, 5, "KB/s"); } else { snprintf (mag_r, 5, "B/s"); } if (bytes_sent > 1024) { bytes_sent /= 1024; snprintf (mag_s, 5, "KB/s"); } else { snprintf (mag_s, 5, "B/s"); } snprintf (netstream, bsize, "%s: Receiving %llu %s, Sending %llu %s", word[2], bytes_recv, mag_r, bytes_sent, mag_s); xchat_pluginpref_get_str (ph, "format", format); format_output ("Netstream", netstream, format); if (xchat_list_int (ph, NULL, "type") >= 2) { xchat_commandf (ph, "SAY %s", netstream); } else { xchat_printf (ph, "%s", netstream); } return XCHAT_EAT_ALL; } static void list_settings () { char list[512]; char buffer[512]; char* token; xchat_pluginpref_list (ph, list); xchat_printf (ph, "%s\tCurrent Settings:", name); token = strtok (list, ","); while (token != NULL) { xchat_pluginpref_get_str (ph, token, buffer); xchat_printf (ph, "%s\t%s: %s\n", name, token, buffer); token = strtok (NULL, ","); } } static void reset_settings () { xchat_pluginpref_set_str (ph, "pciids", DEFAULT_PCIIDS); xchat_pluginpref_set_str (ph, "format", DEFAULT_FORMAT); xchat_pluginpref_set_int (ph, "percent", DEFAULT_PERCENT); } static int sysinfo_cb (char *word[], char *word_eol[], void *userdata) { error_printed = 0; int announce = 0; int buffer; char format[bsize]; if (!xchat_pluginpref_get_str (ph, "format", format)) { xchat_printf (ph, "%s\tError reading config file!", name); return XCHAT_EAT_ALL; } if (xchat_list_int (ph, NULL, "type") >= 2) { announce = 1; } if (!g_ascii_strcasecmp ("HELP", word[2])) { xchat_printf (ph, sysinfo_help); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("LIST", word[2])) { list_settings (); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("SET", word[2])) { if (!g_ascii_strcasecmp ("", word_eol[4])) { xchat_printf (ph, "%s\tEnter a value!\n", name); return XCHAT_EAT_ALL; } if (!g_ascii_strcasecmp ("format", word[3])) { xchat_pluginpref_set_str (ph, "format", word_eol[4]); xchat_printf (ph, "%s\tformat is set to: %s\n", name, word_eol[4]); } else if (!g_ascii_strcasecmp ("percent", word[3])) { buffer = atoi (word[4]); /* don't use word_eol, numbers must not contain spaces */ if (buffer > 0 && buffer < INT_MAX) { xchat_pluginpref_set_int (ph, "percent", buffer); xchat_printf (ph, "%s\tpercent is set to: %d\n", name, buffer); } else { xchat_printf (ph, "%s\tInvalid input!\n", name); } } else if (!g_ascii_strcasecmp ("pciids", word[3])) { xchat_pluginpref_set_str (ph, "pciids", word_eol[4]); xchat_printf (ph, "%s\tpciids is set to: %s\n", name, word_eol[4]); } else { xchat_printf (ph, "%s\tInvalid variable name! Use 'pciids', 'format' or 'percent'!\n", name); return XCHAT_EAT_ALL; } return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("RESET", word[2])) { reset_settings (); xchat_printf (ph, "%s\tSettings have been restored to defaults.\n", name); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("OS", word[2])) { print_os (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("DISTRO", word[2])) { print_distro (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("CPU", word[2])) { print_cpu (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("RAM", word[2])) { print_ram (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("DISK", word[2])) { print_disk (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("VGA", word[2])) { print_vga (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("SOUND", word[2])) { print_sound (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("ETHERNET", word[2])) { print_ethernet (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("UPTIME", word[2])) { print_uptime (announce, format); return XCHAT_EAT_ALL; } else if (!g_ascii_strcasecmp ("", word[2])) { print_summary (announce, format); return XCHAT_EAT_ALL; } else { xchat_printf (ph, sysinfo_help); return XCHAT_EAT_ALL; } } int xchat_plugin_init (xchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg) { ph = plugin_handle; *plugin_name = name; *plugin_desc = desc; *plugin_version = version; char buffer[bsize]; xchat_hook_command (ph, "SYSINFO", XCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL); xchat_hook_command (ph, "NETDATA", XCHAT_PRI_NORM, netdata_cb, NULL, NULL); xchat_hook_command (ph, "NETSTREAM", XCHAT_PRI_NORM, netstream_cb, NULL, NULL); /* this is required for the very first run */ if (xchat_pluginpref_get_str (ph, "pciids", buffer) == 0) { xchat_pluginpref_set_str (ph, "pciids", DEFAULT_PCIIDS); } if (xchat_pluginpref_get_str (ph, "format", buffer) == 0) { xchat_pluginpref_set_str (ph, "format", DEFAULT_FORMAT); } if (xchat_pluginpref_get_int (ph, "percent") == -1) { xchat_pluginpref_set_int (ph, "percent", DEFAULT_PERCENT); } xchat_command (ph, "MENU ADD \"Window/Display System Info\" \"SYSINFO\""); xchat_printf (ph, "%s plugin loaded\n", name); return 1; } int xchat_plugin_deinit (void) { xchat_command (ph, "MENU DEL \"Window/Display System Info\""); xchat_printf (ph, "%s plugin unloaded\n", name); return 1; }