- PVSM.RU - https://www.pvsm.ru -

Подготовка среды и компиляция Shareaza сегодня

Shareaza — свободный файлообменный клиент и менеджер закачек для Windows с поддержкой протоколов Gnutella, Gnutella2, eDonkey2000, BitTorrent, DC++, FTP и HTTP. Умеет работать с magnet-, ED2K-, piolet- и Gnutella-ссылками, а также со стандартными HTTP- и FTP-ссылками. Переведён на 27 языков.

© Wikipedia

Итак я решил делать случайно-последовательную загрузку в клиенте Shareaza.

Посмотрел код на сайте. http://sourceforge.net/p/shareaza/code/9293/tree/trunk/shareaza/DownloadTransfer.cpp#l375 [1] Судя по всему именно здесь и происходит вся магия. Но до модификаций нужно скомпилировать и установить Shareaza. Об этом и пост.

Подготовка.

На диске у меня завалялся документик о том как подготовить среду и скомпилировать. К сожалению он немного устарел так что я его немного модернизировал.

A Quick Guide - How to setup Visual Studio 2008 on WinXP to compile builds of Shareaza

A Quick Guide — How to setup Visual Studio 2008 on WinXP to compile builds of Shareaza

1. Install:

Microsoft Visual Studio 2008
This needs to be a Full Edition preferably Team Edition and not the Express Release.

Microsoft Visual C++ 2008 Feature Pack
This fixes a lot of VS2008 errors so it is a must have.
You can download the pack from
http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en [2]

Microsoft Windows SDK
If you are installing a Full Edition of Visual Studio you should by default get Windows SDK
installed.
In my case Microsoft Windows v6.0A SDK was installed by default with Microsoft.Visual.Studio.Team.System.2008.Team.Suite.

Microsoft DirectX SDK
Must be August 2007 or earlier version, newer versions including current March 2008, are missing a needed file — dxtrans.h
You can download August 2007 from
http://www.microsoft.com/downloads/details.aspx?FamilyID=529f03be-1339-48c4-bd5a-8506e5acf571&displaylang=en [3]
or by using this direct link
http://download.microsoft.com/download/3/3/f/33f1af6e-c61b-4f14-a0de-3e9096ed4b3a/dxsdk_aug2007.exe [4]

2. Download & copy gzip.exe into your windows path eg. C:WINDOWSsystem32
I am using version 1.2.4 which you can download from http://www.gzip.org/ [5].

3. To setup the boost library download boost_1_54_0.zip from
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041 [6].
You will only need to extract the zipped files and not complile the library.
Uncompress boost_1_54_0.zip to a drive/folder on your PC.

4. Add VS2008 Include Dir Listings
You need to make sure that
Visual Studio is pointing to and including boost & DirectX.
Go to Tools -> Options -> Projects and Solutions -> VC++ Directories -> Win 32 — Include Files
Make sure the first two entries in this list point to boost & DirectX. If the enties are not there add them.
ie C:Program Filesboost_1_54_0
ie C:Program FilesMicrosoft DirectX SDK (August 2007)Include

5.Download and install Unicode Inno Setup QuickStart Pack self-installing package from
http://www.jrsoftware.org/isdl.php [7].
Make sure you install the "Unicode Inno Setup QuickStart Pack" not the standard setup/install. The " QuickStart Pack" incudes additional componets that are required that the standard setup does not include. Also make sure you install Inno on your C drive. I generally install my programs on another drive but found when setting up VS2005 last time that the visual studio project file used to build shareaza used a script reference to access Inno. This script assumed that Inno was installed on C drive, so not having Inno installed on C drive caused an error in compiling. To avoid this potential problem I installed Inno on my C drive this time and had no problems.

6. Download and install TortoiseSVN from http://tortoisesvn.net [8].
Use TortoiseSVN "Checkout" with URL repository
https://shareaza.svn.sourceforge.net/svnroot/shareaza/trunk/ [9]
to download current code.

Once all the above is in place you can complile.

Open in VS2008 the following source file vc9Shareaza.sln
This will open the "Solution"
Go into Build ->Configuration Manager and set Shareaza build config
eg Configuration = Debug / Platform = Win32
Then select "Rebuild Solution" to start to compile
At the end of a successful compile you will find a newly compiled installer in setupbuilds folder.

The following is a useful link for keeping up to date with revision numbers and changes
http://cia.vc/stats/project/shareaza/.rss [10].

As a side note, I found setting up with VS2008 was less
problematic than VS2005.

Enjoy ;)

Попытка скомпилировать Shareaza сразу после выполнения инструкции провалилась:
1 Выяснилось что потерян <limits>.
2 Также появились фишки из Windows 7 которых в XP нет.
3 Ну и RazaWebHook64.dll не компилится по умолчанию но скрипт пытается его запихать в инсталлер и не находит.

Немного покомментировав.

Index: setup/scripts/main.iss
===================================================================
--- setup/scripts/main.iss	(revision 9293)
+++ setup/scripts/main.iss	(working copy)
@@ -240,7 +240,7 @@
 #endif
 Source: "{#Compiler}{#PlatformName}{#ConfigurationName}RatDVDReader.dll"; DestDir: "{app}"; Flags: overwritereadonly replacesameversion restartreplace uninsremovereadonly sortfilesbyextension regserver
 Source: "{#Compiler}Win32{#ConfigurationName}RazaWebHook32.dll"; DestDir: "{app}"; Flags: overwritereadonly replacesameversion restartreplace uninsremovereadonly uninsrestartdelete sortfilesbyextension regserver noregerror
-Source: "{#Compiler}x64{#ConfigurationName}RazaWebHook64.dll"; DestDir: "{app}"; Flags: overwritereadonly replacesameversion restartreplace uninsremovereadonly uninsrestartdelete sortfilesbyextension regserver noregerror
+; Source: "{#Compiler}x64{#ConfigurationName}RazaWebHook64.dll"; DestDir: "{app}"; Flags: overwritereadonly replacesameversion restartreplace uninsremovereadonly uninsrestartdelete sortfilesbyextension regserver noregerror
 Source: "{#Compiler}{#PlatformName}{#ConfigurationName}SkinScanSKS.dll"; DestDir: "{app}"; Flags: overwritereadonly replacesameversion restartreplace uninsremovereadonly sortfilesbyextension regserver
 Source: "{#Compiler}{#PlatformName}{#ConfigurationName}SWFPlugin.dll"; DestDir: "{app}"; Flags: overwritereadonly replacesameversion restartreplace uninsremovereadonly sortfilesbyextension regserver
 Source: "{#Compiler}{#PlatformName}{#ConfigurationName}VirusTotal.dll"; DestDir: "{app}"; Flags: overwritereadonly replacesameversion restartreplace uninsremovereadonly sortfilesbyextension regserver
Index: shareaza/LibraryFolders.cpp
===================================================================
--- shareaza/LibraryFolders.cpp	(revision 9293)
+++ shareaza/LibraryFolders.cpp	(working copy)
@@ -776,17 +776,17 @@
 void CLibraryFolders::Maintain()
 {
 	CQuickLock oLock( Library.m_pSection );
-
+/*//
 	CComPtr< IShellLibrary > pIShellLib;
 	if ( ( Windows.dwMajorVersion > 6 || ( Windows.dwMajorVersion == 6 && Windows.dwMinorVersion >= 1 ) ) && Settings.Library.UseWindowsLibrary )
 		pIShellLib.CoCreateInstance( CLSID_ShellLibrary );
-
+//*/
 	for ( POSITION pos = GetFolderIterator() ; pos ; )
 	{
 		CLibraryFolder* pFolder = GetNextFolder( pos );
 		
 		pFolder->Maintain( TRUE );
-
+/*//
 		if ( pIShellLib && theApp.m_pfnSHCreateItemFromParsingName )
 		{
 			CComPtr< IShellItem > psiFolder;
@@ -794,8 +794,9 @@
 			if ( psiFolder )
 				pIShellLib->AddFolder( psiFolder );
 		}
+//*/
 	}
-
+/*//
 	if ( pIShellLib )
 	{
 		pIShellLib->SetIcon( (LPCWSTR)CT2W( Skin.GetImagePath( IDR_LIBRARYFRAME ) ) );
@@ -803,6 +804,7 @@
 		CComPtr< IShellItem > psiLibrary;
 		pIShellLib->SaveInKnownFolder( FOLDERID_UsersLibraries, CLIENT_NAME_T, LSF_OVERRIDEEXISTING, &psiLibrary );
 	}
+//*/
 }
 
 //////////////////////////////////////////////////////////////////////
Index: shareaza/Shareaza.cpp
===================================================================
--- shareaza/Shareaza.cpp	(revision 9293)
+++ shareaza/Shareaza.cpp	(working copy)
@@ -694,7 +694,7 @@
 		//	oTasks.AddTask( _T("shareaza:command:search"), _T(""), LoadString( IDS_SEARCH_TASK ) + _T("..."), theApp.m_strBinaryPath, - IDR_SEARCHFRAME );
 		//	oTasks.AddTask( _T("shareaza:command:download"), _T(""), LoadString( IDS_DOWNLOAD_TASK ) + _T("..."), theApp.m_strBinaryPath, - IDR_DOWNLOADSFRAME );
 	
-		// For VS2008:
+		/*/ For VS2008:
 		CComPtr< ICustomDestinationList > pList;
 		if ( SUCCEEDED( pList.CoCreateInstance( CLSID_DestinationList ) ) )
 		{
@@ -724,6 +724,7 @@
 
 			VERIFY( SUCCEEDED( pList->CommitList() ) );
 		}
+		//*/
 	}
 
 	return CWinApp::Register();
@@ -747,6 +748,7 @@
 {
 	SHAddToRecentDocs( SHARD_PATHW, lpszPathName );
 
+/*/ 
 	if ( Windows.dwMajorVersion > 6 || ( Windows.dwMajorVersion == 6 && Windows.dwMinorVersion >= 1 ) )
 	{
 		if ( m_pfnSHCreateItemFromParsingName )
@@ -759,6 +761,7 @@
 			}
 		}
 	}
+//*/
 }
 
 CDocument* CShareazaApp::OpenDocumentFile(LPCTSTR lpszFileName)
Index: shareaza/StdAfx.h
===================================================================
--- shareaza/StdAfx.h	(revision 9293)
+++ shareaza/StdAfx.h	(working copy)
@@ -173,6 +173,7 @@
 #include <string>
 #include <utility>
 #include <vector>
+#include <limits>
 
 //
 // Boost
Index: shareaza/WndMain.cpp
===================================================================
--- shareaza/WndMain.cpp	(revision 9293)
+++ shareaza/WndMain.cpp	(working copy)
@@ -435,7 +435,7 @@
 
 	// Task Bar
 
-	m_pTaskbar.CoCreateInstance( CLSID_TaskbarList );
+//	m_pTaskbar.CoCreateInstance( CLSID_TaskbarList );
 
 	// Tray
 
@@ -654,7 +654,7 @@
 
 	m_brshDockbar.DeleteObject();
 
-	m_pTaskbar.Release();
+//	m_pTaskbar.Release();
 
 	// Destroy main window
 	CMDIFrameWnd::OnClose();
@@ -1581,7 +1581,7 @@
 		m_bTrayIcon = Shell_NotifyIcon( NIM_MODIFY, &m_pTray );
 	}
 
-	// Task Bar
+	/*/ Task Bar
 	if ( ! m_bTrayHide && m_pTaskbar )
 	{
 		CString sAppBarTip;
@@ -1603,6 +1603,7 @@
 		}
 		m_pTaskbar->SetThumbnailTooltip( hWnd, sAppBarTip );
 	}
+	//*/
 }
 
 // This function runs some basic checks that everything is okay- disks, directories, local network is
Index: shareaza/WndMain.h
===================================================================
--- shareaza/WndMain.h	(revision 9293)
+++ shareaza/WndMain.h	(working copy)
@@ -90,7 +90,7 @@
 	BOOL				m_bTrayIcon;			// Is tray icon available?
 	BOOL				m_bTrayUpdate;			// Is tray data need to be updated?
 	NOTIFYICONDATA		m_pTray;				// Tray icon data
-	CComPtr< ITaskbarList3 > m_pTaskbar;		// Windows task bar
+//	CComPtr< ITaskbarList3 > m_pTaskbar;		// Windows task bar
 	BOOL				m_bTimer;
 	CString				m_sMsgStatus;
 	DWORD				m_nAlpha;				// Main window transparency (0...255)



Удалось скомпилировать и запустить Shareaza.

Вот теперь все готово для того, чтобы внедрять в неё свою идею.

Автор: ivan386

Источник [11]


Сайт-источник PVSM.RU: https://www.pvsm.ru

Путь до страницы источника: https://www.pvsm.ru/c-3/41979

Ссылки в тексте:

[1] http://sourceforge.net/p/shareaza/code/9293/tree/trunk/shareaza/DownloadTransfer.cpp#l375: http://sourceforge.net/p/shareaza/code/9293/tree/trunk/shareaza/DownloadTransfer.cpp#l375

[2] http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en: http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&amp;displaylang=en

[3] http://www.microsoft.com/downloads/details.aspx?FamilyID=529f03be-1339-48c4-bd5a-8506e5acf571&displaylang=en: http://www.microsoft.com/downloads/details.aspx?FamilyID=529f03be-1339-48c4-bd5a-8506e5acf571&amp;displaylang=en

[4] http://download.microsoft.com/download/3/3/f/33f1af6e-c61b-4f14-a0de-3e9096ed4b3a/dxsdk_aug2007.exe: http://download.microsoft.com/download/3/3/f/33f1af6e-c61b-4f14-a0de-3e9096ed4b3a/dxsdk_aug2007.exe

[5] http://www.gzip.org/: http://www.gzip.org/

[6] http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041: http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041

[7] http://www.jrsoftware.org/isdl.php: http://www.jrsoftware.org/isdl.php

[8] http://tortoisesvn.net: http://tortoisesvn.net/

[9] https://shareaza.svn.sourceforge.net/svnroot/shareaza/trunk/: https://shareaza.svn.sourceforge.net/svnroot/shareaza/trunk/

[10] http://cia.vc/stats/project/shareaza/.rss: http://cia.vc/stats/project/shareaza/.rss

[11] Источник: http://habrahabr.ru/post/191748/