From 644ed06ac93a4a399efb699175313bb88dbc019b Mon Sep 17 00:00:00 2001
From: Fish <>
Date: Mon, 3 Mar 2008 10:49:20 +0000
Subject: [PATCH] Win32 updates. Setup tool now installs development files and
 checks for ActivePerl Installation, although current win32 build of NeoStats
 isn't perl-enabled yet.

---
 include/hash.h               |   2 +-
 include/support.h            |   4 +-
 lib/nxml/nxml.vcproj         |   2 +-
 modules/update/update.c      |   3 +-
 modules/update/update.vcproj |  15 ++--
 neostats.sln                 |  15 +++-
 tools/NeoStats.qsp           | 132 ++++++++++++++++++++++++-----------
 tools/buildwin32snap.bat     |  14 +---
 8 files changed, 123 insertions(+), 64 deletions(-)

diff --git a/include/hash.h b/include/hash.h
index 68dc2d72..d5d00049 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -214,7 +214,7 @@ extern "C" {
 EXPORTFUNC 	extern hash_t *hash_create (hashcount_t, hash_comp_t, hash_fun_t);
 	extern void hash_set_allocator (hash_t *, hnode_alloc_t, hnode_free_t, void *);
 EXPORTFUNC 	extern void hash_destroy (hash_t *);
-	extern void hash_free_nodes (hash_t *);
+EXPORTFUNC	extern void hash_free_nodes (hash_t *);
 	extern void hash_free (hash_t *);
 	extern hash_t *hash_init (hash_t *, hashcount_t, hash_comp_t, hash_fun_t, hnode_t **, hashcount_t);
 EXPORTFUNC 	extern void hash_insert (hash_t *, hnode_t *, const void *);
diff --git a/include/support.h b/include/support.h
index d15f6691..255f7354 100644
--- a/include/support.h
+++ b/include/support.h
@@ -56,6 +56,8 @@ struct timezone {
 
 EXPORTFUNC int gettimeofday(struct timeval *tv, struct timezone *tz);
 #endif /* HAVE_GETTIMEOFDAY */
-
+#ifndef HAVE_STRSEP
+EXPORTFUNC char *strsep (char **stringp, const char *delim);
+#endif
 
 #endif /* _SUPPORT_H_ */
diff --git a/lib/nxml/nxml.vcproj b/lib/nxml/nxml.vcproj
index 878ebc37..a2aa8a23 100644
--- a/lib/nxml/nxml.vcproj
+++ b/lib/nxml/nxml.vcproj
@@ -103,7 +103,7 @@
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="../curl/;../include/;."
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
-				RuntimeLibrary="2"
+				RuntimeLibrary="0"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="true"
diff --git a/modules/update/update.c b/modules/update/update.c
index 132d3e49..ad855b6c 100644
--- a/modules/update/update.c
+++ b/modules/update/update.c
@@ -28,10 +28,11 @@
  */
 
 #include "neostats.h"
+#include "services.h"
 #include "namedvars.h"
 #include "mrss.h"
 #include "update.h"
-#include "services.h"
+
 
 
 /** local structures */
diff --git a/modules/update/update.vcproj b/modules/update/update.vcproj
index db6bd5cf..b9f7935f 100644
--- a/modules/update/update.vcproj
+++ b/modules/update/update.vcproj
@@ -3,7 +3,7 @@
 	ProjectType="Visual C++"
 	Version="8.00"
 	Name="update"
-	ProjectGUID="{5E3A1DF8-46AF-485A-BAB2-3DC78C922F8F}"
+	ProjectGUID="{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}"
 	RootNamespace="update"
 	Keyword="Win32Proj"
 	>
@@ -123,8 +123,8 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\include;..\..\lib\curl;..\..\lib\pcre"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;textSERV_EXPORTS"
+				AdditionalIncludeDirectories="..\..\lib\nxml;..\..\include;..\..\lib\curl;..\..\lib\pcre"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;update_EXPORTS"
 				RuntimeLibrary="0"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
@@ -143,10 +143,11 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="neostats.lib"
+				AdditionalDependencies="neostats.lib nxml.lib"
 				OutputFile="../update.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\.."
+				AdditionalLibraryDirectories="..\..;..\..\lib"
+				IgnoreAllDefaultLibraries="false"
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				OptimizeReferences="2"
@@ -353,11 +354,11 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
-				RelativePath=".\help.c"
+				RelativePath=".\update.c"
 				>
 			</File>
 			<File
-				RelativePath=".\main.c"
+				RelativePath=".\update_help.c"
 				>
 			</File>
 		</Filter>
diff --git a/neostats.sln b/neostats.sln
index 573c0f98..6ec514a1 100644
--- a/neostats.sln
+++ b/neostats.sln
@@ -1,5 +1,5 @@
 Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+# Visual C++ Express 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connectserv", "modules\connectserv\connectserv.vcproj", "{E033ECCE-E55E-43BC-89E7-ABE8AA46CE1F}"
 	ProjectSection(ProjectDependencies) = postProject
 		{02AF1A66-8B8D-4BC3-AC09-0C0B339614F3} = {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}
@@ -98,6 +98,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dbm", "dbm", "{F258FB36-416
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inspircd", "modules\protocol\inspircd.vcproj", "{5AEE479F-9B32-417E-8E0F-532FD62822DC}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "update", "modules\update\update.vcproj", "{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{02AF1A66-8B8D-4BC3-AC09-0C0B339614F3} = {02AF1A66-8B8D-4BC3-AC09-0C0B339614F3}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -330,6 +335,14 @@ Global
 		{5AEE479F-9B32-417E-8E0F-532FD62822DC}.Perl-Release|Win32.Build.0 = Perl-Release|Win32
 		{5AEE479F-9B32-417E-8E0F-532FD62822DC}.Release|Win32.ActiveCfg = Release|Win32
 		{5AEE479F-9B32-417E-8E0F-532FD62822DC}.Release|Win32.Build.0 = Release|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Debug|Win32.Build.0 = Debug|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Perl-Debug|Win32.ActiveCfg = Perl-Debug|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Perl-Debug|Win32.Build.0 = Perl-Debug|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Perl-Release|Win32.ActiveCfg = Perl-Release|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Perl-Release|Win32.Build.0 = Perl-Release|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Release|Win32.ActiveCfg = Release|Win32
+		{BCFEBB84-6A6D-4F0A-9258-F37DD7AA95F6}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/tools/NeoStats.qsp b/tools/NeoStats.qsp
index c7b5ac2d..a83c0be1 100644
--- a/tools/NeoStats.qsp
+++ b/tools/NeoStats.qsp
@@ -5,8 +5,8 @@ ComposerVersion=8.5.0.4
 OperatingSystem=WinXP  5.1  2600 (Service Pack 2)
 ProcessorNameString=Intel(R) Xeon(TM) CPU 2.40GHz
 ComputerRAM=1534 MB
-ProjectDrive=C:\  (9.99 GB Free)
-DateTime=01-AUG-2007  21:17:19
+ProjectDrive=TOO  (4.18 GB Free)
+DateTime=03-MAR-2008  18:47:10
 OutputType=EXE
 Language=ENGLISH
 License=PRO
@@ -56,7 +56,7 @@ TopLabel2=0
 BottomLabel=1
 TopLabelText="NeoStats IRC Services"
 TopLabel2Text=""
-BottomLabelText="Copyright � 2007"
+BottomLabelText="Copyright � 2008"
 BackgroundDesign=Light Source (Left)
 TopBackgroundColor=16758613
 BottomBackgroundColor=11613445
@@ -90,9 +90,10 @@ TargetDirectory=<ProgramFilesDir>NeoStats
 CommonDirectory=<CommonFilesDir>NeoStats
 AuxDirectory=<RunTimeDir_1>Modules
 TargetExeName=<Application Folder>\neostats.exe
+RunTimeDir_2=|0||0||0||1|0|0||1|0|1|Include|0|0|0|0|0|0|
 
 [Dialogs]
-SelectedDialogs=*Welcome,*License,Readme,User Information,Setup Type,*Custom,*Destination,Associate,*Shortcuts,*Confirm Setup,*Copy Files,*Complete
+SelectedDialogs=*Welcome,*License,Readme,Setup Type,User Information,*Custom,*Destination,Associate,*Shortcuts,*Confirm Setup,*Copy Files,*Complete
 LicenseTextFile=NeoStats3.0\COPYING
 ReadmeTextFile=
 ReadmeTextFile2=NeoStats3.0\README
@@ -217,7 +218,7 @@ InstallDotNetFxText=
 InstallDotNetFxUrl=0
 InstallDotNetFxUrlText=http://
 DotNetFrameworkReqVer=1.0,1.1,2.0
-TestExeBeforeInstall=0
+TestExeBeforeInstall=1
 TestExeBeforeUnInstall=1
 AutorunCreateInfFile=0
 AutorunTest=0
@@ -248,6 +249,7 @@ UnInstallHelpLink=
 UnInstallInfoAboutURL=
 
 [Registry]
+Reg-000=*|HKEY_LOCAL_MACHINE\SOFTWARE\NeoStats|Path|<ProgramFilesDir>|Create|Remove Key|String|
 
 [IniFile]
 
@@ -281,52 +283,104 @@ Spin2=0
 [Execute]
 ExecuteDllCheckBox=0
 ExecutionDllFileName=
+Exec-000=*||CheckPerl|After Custom|10|Conditional|0|1|Registry Key Found||0|0|0|Ask Yes/No||0|0|0|File Found||1|Display Message||1|Download File (HTTP)||0|Display Message||0|Display Message||1|Run MSI File and Wait||0|Display Message||0|
+Arg-000-1=HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\ActivePerl\1002
+Arg-000-2==
+Arg-000-6==
+Arg-000-10==
+Arg-000-13=You need to install Perl for NeoStats to operate correctly
+Arg-000-16=http://www2.neostats.net/downloads/files/ActivePerl-5.10.0.1002-MSWin32-x86-283697.msi
+Arg-000-17=<TempDir>NeoStats-Perl.msi
+Arg-000-18=TRUE
+Arg-000-25=<TempDir>NeoStats-Perl.msi
+Arg-000-26=Install
 
 [MSI]
 Version=1
 AddMergeModule=0
-Msm2MsiData=|MSM2MSI_NeoStats-Setup.msi|1|1|1|0|
+Msm2MsiData=|MSM2MSI_NeoStats-Setup.msi|1|2|2|0|
 
 [GroupNames]
 Group-000=Main Group
+Group-001=Development Files
 
 [Group-000]
 TypicalCompactData=15
 Description=This is the main group of files
 SizeInKB=0
 Item-000=Fol*<Application Folder>
-Item-001=Fil*NeoStats3.0\neostats.conf
-Item-002=Fil*NeoStats3.0\neostats.exe
+Item-001=Fil*src\win32\neostats.conf[67108864]
+Item-002=Fil*neostats.exe[16777216]
 Item-003=Dir*<Application Folder>\data
-Item-004=Fil*NeoStats3.0\data\tlds.nfo
-Item-005=Fil*NeoStats3.0\data\niconfig.db
-Item-006=Dir*<Application Folder>\logs
-Item-007=Dir*<Application Folder>\modules
-Item-008=Fil*NeoStats3.0\modules\unreal32.dll
-Item-009=Fil*NeoStats3.0\modules\unreal31.dll
-Item-010=Fil*NeoStats3.0\modules\ultimate3.dll
-Item-011=Fil*NeoStats3.0\modules\ultimate2.dll
-Item-012=Fil*NeoStats3.0\modules\textserv.dll
-Item-013=Fil*NeoStats3.0\modules\templateauth.dll
-Item-014=Fil*NeoStats3.0\modules\template.dll
-Item-015=Fil*NeoStats3.0\modules\statserv.dll
-Item-016=Fil*NeoStats3.0\modules\quoteserv.dll
-Item-017=Fil*NeoStats3.0\modules\plexus.dll
-Item-018=Fil*NeoStats3.0\modules\operlog.dll
-Item-019=Fil*NeoStats3.0\modules\nefarious.dll
-Item-020=Fil*NeoStats3.0\modules\limitserv.dll
-Item-021=Fil*NeoStats3.0\modules\ircup10.dll
-Item-022=Fil*NeoStats3.0\modules\ircdauth.dll
-Item-023=Fil*NeoStats3.0\modules\hybrid7.dll
-Item-024=Fil*NeoStats3.0\modules\hybrid6.dll
-Item-025=Fil*NeoStats3.0\modules\hostserv.dll
-Item-026=Fil*NeoStats3.0\modules\gdbm.dll
-Item-027=Fil*NeoStats3.0\modules\extauth.dll
-Item-028=Fil*NeoStats3.0\modules\dccpartyline.dll
-Item-029=Fil*NeoStats3.0\modules\connectserv.dll
-Item-030=Fil*NeoStats3.0\modules\client.dll
-Item-031=Fil*NeoStats3.0\modules\bahamut18.dll
-Item-032=Fil*NeoStats3.0\modules\bahamut14.dll
-Item-033=Fil*NeoStats3.0\modules\asuka.dll
-Item-034=Fil*NeoStats3.0\data\html.tpl
+Item-004=Fil*data\tlds.nfo[16777216]
+Item-005=Fil*data\niconfig.db[16777216]
+Item-006=Fil*modules\statserv\html\index.tpl[16777216]
+Item-007=Fil*modules\statserv\GeoIP.dat[16777216]
+Item-008=Fil*modules\quoteserv\data\discworld[16777216]
+Item-009=Fil*modules\quoteserv\data\redneck[16777216]
+Item-010=Fil*modules\textserv\barmaid.tsdb[16777216]
+Item-011=Fil*modules\textserv\icecream.tsdb[16777216]
+Item-012=Fil*modules\textserv\loveserv.tsdb[16777216]
+Item-013=Fil*modules\textserv\moraleserv.tsdb[16777216]
+Item-014=Fil*modules\textserv\waitress.tsdb[16777216]
+Item-015=Dir*<Application Folder>\logs
+Item-016=Dir*<Application Folder>\modules
+Item-017=Fil*modules\unreal32.dll[16777216]
+Item-018=Fil*modules\unreal31.dll[16777216]
+Item-019=Fil*modules\ultimate3.dll[16777216]
+Item-020=Fil*modules\ultimate2.dll[16777216]
+Item-021=Fil*modules\textserv.dll[16777216]
+Item-022=Fil*modules\templateauth.dll[16777216]
+Item-023=Fil*modules\template.dll[16777216]
+Item-024=Fil*modules\statserv.dll[16777216]
+Item-025=Fil*modules\quoteserv.dll[16777216]
+Item-026=Fil*modules\plexus.dll[16777216]
+Item-027=Fil*modules\operlog.dll[16777216]
+Item-028=Fil*modules\nefarious.dll[16777216]
+Item-029=Fil*modules\limitserv.dll[16777216]
+Item-030=Fil*modules\ircup10.dll[16777216]
+Item-031=Fil*modules\ircdauth.dll[16777216]
+Item-032=Fil*modules\hybrid7.dll[16777216]
+Item-033=Fil*modules\hybrid6.dll[16777216]
+Item-034=Fil*modules\hostserv.dll[16777216]
+Item-035=Fil*modules\gdbm.dll[16777216]
+Item-036=Fil*modules\extauth.dll[16777216]
+Item-037=Fil*modules\dccpartyline.dll[16777216]
+Item-038=Fil*modules\connectserv.dll[16777216]
+Item-039=Fil*modules\client.dll[16777216]
+Item-040=Fil*modules\bahamut18.dll[16777216]
+Item-041=Fil*modules\bahamut14.dll[16777216]
+Item-042=Fil*modules\asuka.dll[16777216]
+Item-043=Fil*modules\inspircd.dll[16777216]
+Item-044=Fil*modules\update.dll[16777216]
+
+[Group-001]
+TypicalCompactData=5
+Description=Files used to develop modules or add-ons for NeoStats
+SizeInKB=0
+Item-000=Dir*<Application Folder>\include
+Item-001=Fil*include\neostats.h[16777216]
+Item-002=Fil*include\configwin32.h[16777216]
+Item-003=Fil*include\list.h[16777216]
+Item-004=Fil*include\hash.h[16777216]
+Item-005=Fil*include\support.h[16777216]
+Item-006=Fil*include\events.h[16777216]
+Item-007=Fil*include\numeric.h[16777216]
+Item-008=Fil*include\adns.h[16777216]
+Item-009=Fil*include\protocol.h[16777216]
+Item-010=Fil*include\perlmod.h[16777216]
+Item-011=Fil*include\confuse.h[16777216]
+Item-012=Fil*include\updates.h[16777216]
+Item-013=Fil*include\MiniMessage.h[16777216]
+Item-014=Fil*include\MiniMessageGateway.h[16777216]
+Item-015=Fil*include\MuscleSupport.h[16777216]
+Item-016=Fil*include\NeoNet.h[16777216]
+Item-017=Fil*include\namedvars.h[16777216]
+Item-018=Fil*include\services.h[16777216]
+Item-019=Dir*<Application Folder>\libs
+Item-020=Fil*neostats.lib[16777216]
+Item-021=Fil*lib\curl.lib[16777216]
+Item-022=Fil*lib\nxml.lib[16777216]
+Item-023=Fil*lib\libevent.lib[16777216]
+Item-024=Fil*lib\pcre.lib[16777216]
 
diff --git a/tools/buildwin32snap.bat b/tools/buildwin32snap.bat
index fbc56661..366477f9 100644
--- a/tools/buildwin32snap.bat
+++ b/tools/buildwin32snap.bat
@@ -1,17 +1,5 @@
 @echo off
 IF EXIST tools\NeoStats-Setup*.exe del tools\NeoStats-Setup*.exe
-IF NOT EXIST NeoStats3.0 mkdir NeoStats3.0
-cd NeoStats3.0
-IF NOT EXIST logs mkdir logs
-IF NOT EXIST data mkdir data
-IF NOT EXIST modules mkdir modules
-@copy ..\NeoStats.exe .
-@copy ..\modules\*.dll modules
-@copy ..\data\*.* data
-@copy ..\README .
-@copy ..\COPYING .
-@copy ..\src\win32\neostats.conf .
-@copy ..\modules\statserv\data\*.tpl data
-cd ..
 "C:\Program Files\Pantaray\QSetup\Composer.exe" tools\NeoStats.qsp /Compile /Exit
 move tools\NeoStats-Setup.exe tools\NeoStats-Setup-3-0-a4-%1.exe
+`
\ No newline at end of file