[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tortoisesvn-dev
Subject:    Scripting TortoiseSVN - COM interface?
From:       Kevin Puetz <puetzk () puetzk ! org>
Date:       2006-05-15 14:42:55
Message-ID: FC5153FC-2EE7-4981-8AF5-381770C16C69 () puetzk ! org
[Download RAW message or body]

I've been looking again lately at ways to let external scripts take  
advantage of the TortoiseSVN's dialogs/progress dialogs/etc (and  
apparently I'm not alone, given the "Hijacking TortoiseProc" thread  
recently). Since it's difficult for TortoiseProc to return any output  
in it's current cmdline form (and in any case parsing cmdline output  
is a rather inconvenient way to interact), I've been looking into  
adding a COM automation interface. The attached patches are by no  
means useful yet, but they do work and show what kind of impact on  
the "core code" adding COM interfaces requires - not much, really.

TortoisProc-ATL.diff - the boilerplate to use ATL at all.
TortoiseProc-COM-Interface.diff - adds a skeletal COM interface/ 
implementation that can bring up the About or Log dialog.

With both of the above built-in, and after registering the result  
(with TortoiseProc.exe /register), one can make calls like the  
following in VBScript, or (with with the obvious syntax differences)  
any other language that supports COM - python, perl, C++,  
matlab, .NET, etc.

Set turtle = CreateObject("TortoiseProc.TortoiseSVN")
call turtle.About()
call turtle.Log("http://tortoisesvn.tigris.org/svn/tortoisesvn/ 
trunk/",0,,,True)

Obviously, there's nothing in the interface yet that isn't already  
available via the command-line, and not much of that; this is just a  
strawman to start the discussion about even having a TortoiseSVN  
"API". If we're favorable on that, then we need to work out what it  
looks like :-)

I'm specifically wanting to expose the ability to use the log dialog  
to select from a (potentially discontinuous) set of revisions, so  
that I could create a TortoiseSVN GUI wrapper around svnmerge.py  
avail/block/merge.
  "Hijacking TortoiseProc" wanted to use the repo-browser to pick URLS.
Others probably also have desires to throw in - if you do throw 'em  
in and I'll try to keep them in mind as I draw up an API outline...


["TortoiseProc-ATL.diff" (TortoiseProc-ATL.diff)]


Property changes on: TortoiseProc
___________________________________________________________________
Name: svn:ignore
   - *.user

   + *.user
TortoiseProc_i.h
TortoiseProc_i.c


Index: src/TortoiseProc/TortoiseProc.vcproj
===================================================================
--- src/TortoiseProc/TortoiseProc.vcproj	(revision 6479)
+++ src/TortoiseProc/TortoiseProc.vcproj	(working copy)
@@ -25,7 +25,7 @@
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
  UseOfMFC="2"
-			UseOfATL="0"
+			UseOfATL="1"
 			CharacterSet="1"
 			>
 			<Tool
@@ -74,6 +74,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				RegisterOutput="true"
 				AdditionalDependencies="delayimp.lib wininet.lib shfolder.lib shell32.lib \
comctl32.lib mswsock.lib ws2_32.lib rpcrt4.lib shlwapi.lib Version.lib gdiplus.lib \
../../obj\ResizableLib\Debug\ResizableLib.lib \
../../ext/berkeley-db\db4.3-win32\lib\libdb43d.lib \
../../ext/Subversion\debug_win32\libsvn_repos.lib \
../../ext/Subversion\debug_win32\libsvn_diff.lib \
../../ext/Subversion\debug_win32\libsvn_fs.lib \
../../ext/Subversion\debug_win32\libsvn_fs_base.lib \
../../ext/Subversion\debug_win32\libsvn_fs_fs.lib \
../../ext/Subversion\debug_win32\libsvn_ra_dav.lib \
../../ext/Subversion\debug_win32\libsvn_ra_local.lib \
../../ext/Subversion\debug_win32\libsvn_ra.lib \
../../ext/Subversion\debug_win32\libsvn_ra_svn.lib \
../../ext/neon\debug_win32\libneon.lib ../../ext/Subversion\debug_win32\libsvn_wc.lib \
../../ext/Subversion\debug_win32\libsvn_subr.lib \
../../ext/Subversion\debug_win32\libsvn_client.lib \
../../ext/Subversion\debug_win32\libsvn_delta.lib \
../../ext/apr\debug_win32\libapr_tsvn.lib \
../../ext/apr-util\debug_win32\libaprutil_tsvn.lib \
../../ext/apr-iconv\debug_win32\libapriconv_tsvn.lib \
../../ext/apr-util\xml\expat\lib\debug_win32\xml.lib \
../../ext/svn-win32-libintl/lib/intl3_svn.lib"  LinkIncremental="2"
 				IgnoreDefaultLibraryNames="shell32;msvcrt.lib"
@@ -204,6 +205,7 @@
 			ConfigurationType="1"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
  UseOfMFC="2"
+			UseOfATL="1"
 			CharacterSet="1"
 			WholeProgramOptimization="1"
 			>
@@ -256,6 +258,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				RegisterOutput="true"
 				AdditionalDependencies="delayimp.lib wininet.lib shfolder.lib shell32.lib \
comctl32.lib mswsock.lib ws2_32.lib rpcrt4.lib shlwapi.lib Version.lib gdiplus.lib \
../../obj/ResizableLib/Release/ResizableLib.Lib \
../../ext/berkeley-db\db4.3-win32\lib\libdb43.lib \
../../ext/Subversion\release_win32\libsvn_repos.lib \
../../ext/Subversion\release_win32\libsvn_diff.lib \
../../ext/Subversion\release_win32\libsvn_fs.lib \
../../ext/Subversion\release_win32\libsvn_fs_base.lib \
../../ext/Subversion\release_win32\libsvn_fs_fs.lib \
../../ext/Subversion\release_win32\libsvn_ra_dav.lib \
../../ext/Subversion\release_win32\libsvn_ra_local.lib \
../../ext/Subversion\release_win32\libsvn_ra.lib \
../../ext/Subversion\release_win32\libsvn_ra_svn.lib \
../../ext/neon\release_win32\libneon.lib \
../../ext/Subversion\release_win32\libsvn_wc.lib \
../../ext/Subversion\release_win32\libsvn_subr.lib \
../../ext/Subversion\release_win32\libsvn_client.lib \
../../ext/Subversion\release_win32\libsvn_delta.lib \
../../ext/apr\release_win32\libapr_tsvn.lib \
../../ext/apr-util\release_win32\libaprutil_tsvn.lib \
../../ext/apr-iconv\release_win32\libapriconv_tsvn.lib \
../../ext/apr-util\xml\expat\lib\release_win32\xml.lib \
../../ext/svn-win32-libintl/lib/intl3_svn.lib"  LinkIncremental="1"
 				IgnoreDefaultLibraryNames="libcd.lib;libc;shell32;"
@@ -396,6 +399,38 @@
 			Name="Utils"
 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;h;hpp;hxx;hm;inl;inc"
 			>
+			<File
+				RelativePath=".\TortoiseProc.idl"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCMIDLTool"
+						PreprocessorDefinitions="_DEBUG"
+						MkTypLibCompatible="false"
+						TargetEnvironment="1"
+						GenerateStublessProxies="true"
+						TypeLibraryName="$(IntDir)/$(ProjectName).tlb"
+						HeaderFileName="$(ProjectName)_i.h"
+						InterfaceIdentifierFileName="$(ProjectName)_i.c"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCMIDLTool"
+						PreprocessorDefinitions="NDEBUG"
+						MkTypLibCompatible="false"
+						TargetEnvironment="1"
+						GenerateStublessProxies="true"
+						TypeLibraryName="$(IntDir)/$(ProjectName).tlb"
+						HeaderFileName="TortoiseProc_i.h"
+						InterfaceIdentifierFileName="TortoiseProc_i.c"
+					/>
+				</FileConfiguration>
+			</File>
 			<Filter
 				Name="General"
 				>
@@ -2386,6 +2421,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\TortoiseProc.rgs"
+				>
+			</File>
+			<File
 				RelativePath="..\Resources\TortoiseProcENG.rc"
 				>
 			</File>
Index: src/TortoiseProc/TortoiseProcps.mk
===================================================================
--- src/TortoiseProc/TortoiseProcps.mk	(revision 0)
+++ src/TortoiseProc/TortoiseProcps.mk	(revision 0)
@@ -0,0 +1,15 @@
+
+TortoiseProcps.dll: dlldata.obj TortoiseProc_p.obj TortoiseProc_i.obj
+	link /dll /out:TortoiseProcps.dll /def:TortoiseProcps.def /entry:DllMain \
dlldata.obj TortoiseProc_p.obj TortoiseProc_i.obj \ +		kernel32.lib rpcndr.lib \
rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \ +.c.obj:
+	cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \
+		$<
+
+clean:
+	@del TortoiseProcps.dll
+	@del TortoiseProcps.lib
+	@del TortoiseProcps.exp
+	@del dlldata.obj
+	@del TortoiseProc_p.obj
+	@del TortoiseProc_i.obj
Index: src/resource.h
===================================================================
--- src/TortoiseProc/resource.h	(revision 6479)
+++ src/TortoiseProc/resource.h	(working copy)
@@ -95,6 +95,7 @@
 #define IDI_GRAPHLINESTACKED            232
 #define IDI_GRAPHPIE                    233
 #define IDI_SWITCHLEFTRIGHT             234
+#define IDR_TORTOISEPROC                235
 #define IDS_CHSTAT_FILECOL              1000
 #define IDS_CHSTAT_WCCOL                1001
 #define IDS_CHSTAT_REPOCOL              1002
@@ -887,7 +888,7 @@
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        235
+#define _APS_NEXT_RESOURCE_VALUE        236
 #define _APS_NEXT_COMMAND_VALUE         32805
 #define _APS_NEXT_CONTROL_VALUE         1312
 #define _APS_NEXT_SYMED_VALUE           195
Index: src/TortoiseProc/TortoiseProcps.def
===================================================================
--- src/TortoiseProc/TortoiseProcps.def	(revision 0)
+++ src/TortoiseProc/TortoiseProcps.def	(revision 0)
@@ -0,0 +1,9 @@
+
+LIBRARY      "TortoiseProcPS"
+
+EXPORTS
+	DllGetClassObject       @1	PRIVATE
+	DllCanUnloadNow         @2	PRIVATE
+	GetProxyDllInfo         @3	PRIVATE
+	DllRegisterServer		@4	PRIVATE
+	DllUnregisterServer		@5	PRIVATE
Index: src/TortoiseProc/TortoiseProc.h
===================================================================
--- src/TortoiseProc/TortoiseProc.h	(revision 6479)
+++ src/TortoiseProc/TortoiseProc.h	(working copy)
@@ -27,6 +27,7 @@
 
 
 #include "..\\TortoiseShell\\resource.h"
+#include "TortoiseProc_i.h"
 //#include "UnicodeUtils.h"
 
 class CTSVNPath;
@@ -85,6 +86,7 @@
 	DECLARE_MESSAGE_MAP()
 private:
 	HANDLE	m_mutex;
+	BOOL ExitInstance(void);
 };
 
 extern CTortoiseProcApp theApp;
Index: src/TortoiseProc/TortoiseProc.rgs
===================================================================
--- src/TortoiseProc/TortoiseProc.rgs	(revision 0)
+++ src/TortoiseProc/TortoiseProc.rgs	(revision 0)
@@ -0,0 +1,11 @@
+HKCR
+{
+	NoRemove AppID
+	{
+		'%APPID%' = s 'TortoiseProc'
+				'TortoiseProc.EXE'
+				{
+			val AppID = s '%APPID%'
+		}
+	}
+}
Index: src/TortoiseProc/stdafx.h
===================================================================
--- src/TortoiseProc/stdafx.h	(revision 6479)
+++ src/TortoiseProc/stdafx.h	(working copy)
@@ -3,6 +3,7 @@
 // but are changed infrequently
 
 #pragma once
+#define _ATL_APARTMENT_THREADED 
 #define XMESSAGEBOX_APPREGPATH "Software\\TortoiseSVN\\"
 
 // Modify the following defines if you have to target a platform prior to the ones \
specified below. @@ -40,6 +41,10 @@
 #include <afxtempl.h>
 #include <afxmt.h>
 
+// ATL includes
+#include <atlbase.h>
+#include <atlcom.h>
+
 #ifndef LVS_EX_DOUBLEBUFFER
 #define LVS_EX_DOUBLEBUFFER     0x00010000
 #endif
Index: src/TortoiseProc/TortoiseProc.idl
===================================================================
--- src/TortoiseProc/TortoiseProc.idl	(revision 0)
+++ src/TortoiseProc/TortoiseProc.idl	(revision 0)
@@ -0,0 +1,18 @@
+// TortoiseProc.idl : IDL source for TortoiseProc
+//
+
+// This file will be processed by the MIDL tool to
+// produce the type library (TortoiseProc.tlb) and marshalling code.
+
+import "oaidl.idl";
+import "ocidl.idl";
+
+[
+	uuid(FF10A6D6-9C0C-4947-8F3B-770766A561F6),
+	version(1.0),
+	helpstring("TortoiseProc 1.0 Type Library")
+]
+library TortoiseProcLib
+{
+	importlib("stdole2.tlb");
+};
Index: src/TortoiseProc/TortoiseProc.cpp
===================================================================
--- src/TortoiseProc/TortoiseProc.cpp	(revision 6479)
+++ src/TortoiseProc/TortoiseProc.cpp	(working copy)
@@ -67,6 +67,8 @@
 #include "SVNAdminDir.h"
 
 #include "..\version.h"
+#include <initguid.h>
+#include "TortoiseProc_i.c"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -85,6 +87,16 @@
 // This is a fake filename which we use to fill-in the create-patch file-open dialog
 #define PATCH_TO_CLIPBOARD_PSEUDO_FILENAME		_T(".TSVNPatchToClipboard")
 
+
+class CTortoiseProcModule :
+	public CAtlMfcModule
+{
+public:
+	DECLARE_LIBID(LIBID_TortoiseProcLib);
+	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_TORTOISEPROC, \
"{C1B1FB15-5C56-4443-A5FF-5E7CA1818C02}");}; +
+CTortoiseProcModule _AtlModule;
+
 BEGIN_MESSAGE_MAP(CTortoiseProcApp, CWinApp)
 	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
 END_MESSAGE_MAP()
@@ -335,6 +347,35 @@
     InitCommonControlsEx(&used);
 	AfxOleInit();
 	AfxEnableControlContainer();
+	// Parse command line for standard shell commands, DDE, file open
+	CCommandLineInfo cmdInfo;
+	ParseCommandLine(cmdInfo);
+	#if !defined(_WIN32_WCE) || defined(_CE_DCOM)
+	// Register class factories via CoRegisterClassObject().
+	if (FAILED(_AtlModule.RegisterClassObjects(CLSCTX_LOCAL_SERVER, \
REGCLS_MULTIPLEUSE))) +		return FALSE;
+	#endif // !defined(_WIN32_WCE) || defined(_CE_DCOM)
+	// App was launched with /Embedding or /Automation switch.
+	// Run app as automation server.
+	if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
+	{
+		// Don't show the main window
+		return TRUE;
+	}
+	// App was launched with /Unregserver or /Unregister switch.
+	if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppUnregister)
+	{
+		_AtlModule.UpdateRegistryAppId(FALSE);
+		_AtlModule.UnregisterServer(TRUE);
+		return FALSE;
+	}
+	// App was launched with /Register or /Regserver switch.
+	if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppRegister)
+	{
+		_AtlModule.UpdateRegistryAppId(TRUE);
+		_AtlModule.RegisterServer(TRUE);
+		return FALSE;
+	}
 	AfxInitRichEdit2();
 	CWinApp::InitInstance();
 	SetRegistryKey(_T("TortoiseSVN"));
@@ -2229,3 +2270,11 @@
 	regVersion = _T(STRPRODUCTVER);	
 }
 
+
+BOOL CTortoiseProcApp::ExitInstance(void)
+{
+#if !defined(_WIN32_WCE) || defined(_CE_DCOM)
+	_AtlModule.RevokeClassObjects();
+#endif
+	return CWinApp::ExitInstance();
+}
Index: src/Resources/TortoiseProcENG.rc
===================================================================
--- src/Resources/TortoiseProcENG.rc	(revision 6479)
+++ src/Resources/TortoiseProcENG.rc	(working copy)
@@ -1555,7 +1555,13 @@
     "A",            ID_VIEW_SHOWALLREVISIONS, VIRTKEY, CONTROL, NOINVERT
 END
 
+/////////////////////////////////////////////////////////////////////////////
+//
+// REGISTRY
+//
 
+IDR_TORTOISEPROC        REGISTRY                "..\\TortoiseProc\\TortoiseProc.rgs"
+
 /////////////////////////////////////////////////////////////////////////////
 //
 // String Table


["TortoiseProc-COM-Interface.diff" (TortoiseProc-COM-Interface.diff)]

Index: src/Resources/TortoiseProcENG.rc
===================================================================
--- src.orig/Resources/TortoiseProcENG.rc
+++ src/Resources/TortoiseProcENG.rc
@@ -1562,6 +1562,7 @@ END
 //
 
 IDR_TORTOISEPROC        REGISTRY                "..\\TortoiseProc\\TortoiseProc.rgs"
+IDR_TORTOISESVN         REGISTRY                "..\\TortoiseProc\\TortoiseSVN.rgs"
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -2519,6 +2520,12 @@ BEGIN
     "\0"
 END
 
+4 TEXTINCLUDE DISCARDABLE
+BEGIN
+	"1 TYPELIB ""..\\TortoiseProc\\TortoiseProc.tlb""\r\n"
+	"\0"
+END
+
 #endif    // APSTUDIO_INVOKED
 
 #endif    // German (Switzerland) resources
@@ -2544,5 +2551,12 @@ LANGUAGE 9, 1
 #endif
 
 /////////////////////////////////////////////////////////////////////////////
+//
+// TYPELIB
+//
+
+1 TYPELIB "..\\TortoiseProc\\TortoiseProc.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
 #endif    // not APSTUDIO_INVOKED
 
Index: src/TortoiseProc/CTortoiseSVN.cpp
===================================================================
--- /dev/null
+++ src/TortoiseProc/CTortoiseSVN.cpp
@@ -0,0 +1,50 @@
+
+// CTortoiseSVN.h : Implementation of CTortoiseSVN
+
+#include "stdafx.h"
+#include "CTortoiseSVN.h"
+
+#include "AboutDlg.h"
+#include "LogDlg.h"
+#include "Utils.h"
+
+// CTortoiseSVN
+
+STDMETHODIMP CTortoiseSVN::InterfaceSupportsErrorInfo(REFIID riid)
+{
+	static const IID* arr[] = 
+	{
+		&IID_ITortoiseSVN
+	};
+
+	for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
+	{
+		if (InlineIsEqualGUID(*arr[i],riid))
+			return S_OK;
+	}
+	return S_FALSE;
+}
+
+STDMETHODIMP CTortoiseSVN::About()
+{
+	CAboutDlg dlg;
+	dlg.DoModal();
+	return S_OK;
+}
+
+STDMETHODIMP CTortoiseSVN::Log(BSTR path, long revpeg, long revstart, long revend, \
BOOL strict) +{
+	SVNRev pegrev(revpeg == 0 ? SVNRev() : revpeg);
+	if (revstart == 0)
+	{
+		revstart = SVNRev::REV_HEAD;
+	}
+	if (revend == 0)
+	{
+		revend = 1;
+	}
+	CLogDlg dlg;
+	dlg.SetParams(CTSVNPath(CUtils::GetLongPathname(path)), pegrev, revstart, revend, \
100, strict); +	dlg.DoModal();
+	return S_OK;
+}
Index: src/TortoiseProc/CTortoiseSVN.h
===================================================================
--- /dev/null
+++ src/TortoiseProc/CTortoiseSVN.h
@@ -0,0 +1,52 @@
+
+// CTortoiseSVN.h : Declaration of the CTortoiseSVN class
+
+#pragma once
+#include "resource.h"       // main symbols
+
+#include "TortoiseProc_i.h"
+
+// TortoiseSVN
+
+class ATL_NO_VTABLE CTortoiseSVN :
+	public CComObjectRootEx<CComSingleThreadModel>,
+	public CComCoClass<CTortoiseSVN, &CLSID_TortoiseSVN>,
+	public ISupportErrorInfo,
+	public IDispatchImpl<ITortoiseSVN, &IID_ITortoiseSVN, &LIBID_TortoiseProcLib, 1, 0>
+{
+public:
+	CTortoiseSVN()
+	{
+	}
+
+DECLARE_REGISTRY_RESOURCEID(IDR_TORTOISESVN)
+
+BEGIN_COM_MAP(CTortoiseSVN)
+	COM_INTERFACE_ENTRY(ITortoiseSVN)
+	COM_INTERFACE_ENTRY(IDispatch)
+	COM_INTERFACE_ENTRY(ISupportErrorInfo)
+END_COM_MAP()
+
+// ISupportsErrorInfo
+	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
+	STDMETHOD(Log)(BSTR path, long revpeg, long revstart, long revend , BOOL strict);
+
+// ITortoiseSVN
+	STDMETHOD(About)();
+
+	DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+	HRESULT FinalConstruct()
+	{
+		return S_OK;
+	}
+
+	void FinalRelease()
+	{
+	}
+
+public:
+
+};
+
+OBJECT_ENTRY_AUTO(__uuidof(TortoiseSVN), CTortoiseSVN)
Index: src/TortoiseProc/TortoiseProc.idl
===================================================================
--- src.orig/TortoiseProc/TortoiseProc.idl
+++ src/TortoiseProc/TortoiseProc.idl
@@ -15,4 +15,30 @@ import "ocidl.idl";
 library TortoiseProcLib
 {
 	importlib("stdole2.tlb");
+
+	[
+		object,
+		uuid(11DB2E64-70B4-4876-95A5-76ED97489EA1),
+		dual,
+		oleautomation,
+		nonextensible,
+		helpstring("TortoiseSVN Interface"),
+		pointer_default(unique)
+	]
+	interface ITortoiseSVN : IDispatch
+	{
+		[id(1),helpstring("Shows the About-dialog. This is also shown if no command is \
given.")] +			HRESULT About();
+		[id(2),helpstring("Opens the log dialog. The path specifies the file or folder for \
which the log should be shown.")] +			HRESULT Log(BSTR path,[optional, \
defaultvalue(0)] long revpeg, [optional, defaultvalue(0)] long revstart, [optional, \
defaultvalue(0)] long revend, [optional, defaultvalue(0)] bool strict); +	};
+
+	[
+		uuid(54110F0B-F297-4ED9-884B-C4EAFF93EA5B),
+		helpstring("TortoiseSVN Class")
+	]
+	coclass TortoiseSVN
+	{
+		[default] interface ITortoiseSVN;
+	};
 };
Index: src/TortoiseProc/TortoiseProc.vcproj
===================================================================
--- src.orig/TortoiseProc/TortoiseProc.vcproj
+++ src/TortoiseProc/TortoiseProc.vcproj
@@ -400,6 +400,14 @@
 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;h;hpp;hxx;hm;inl;inc"
 			>
 			<File
+				RelativePath=".\CTortoiseSVN.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\CTortoiseSVN.h"
+				>
+			</File>
+			<File
 				RelativePath=".\TortoiseProc.idl"
 				>
 				<FileConfiguration
@@ -411,7 +419,7 @@
 						MkTypLibCompatible="false"
 						TargetEnvironment="1"
 						GenerateStublessProxies="true"
-						TypeLibraryName="$(IntDir)/$(ProjectName).tlb"
+						TypeLibraryName="$(ProjectName).tlb"
 						HeaderFileName="$(ProjectName)_i.h"
 						InterfaceIdentifierFileName="$(ProjectName)_i.c"
 					/>
@@ -425,7 +433,7 @@
 						MkTypLibCompatible="false"
 						TargetEnvironment="1"
 						GenerateStublessProxies="true"
-						TypeLibraryName="$(IntDir)/$(ProjectName).tlb"
+						TypeLibraryName="$(ProjectName).tlb"
 						HeaderFileName="TortoiseProc_i.h"
 						InterfaceIdentifierFileName="TortoiseProc_i.c"
 					/>
@@ -2433,6 +2441,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\TortoiseSVN.rgs"
+				>
+			</File>
+			<File
 				RelativePath="..\Resources\tortoisesvn_logoflipped.bmp"
 				>
 			</File>
@@ -2481,6 +2493,10 @@
 			RelativePath="stdafx.h"
 			>
 		</File>
+		<File
+			RelativePath="TortoiseProc.tlb"
+			>
+		</File>
 	</Files>
 	<Globals>
 		<Global
Index: src/TortoiseProc/TortoiseProc.cpp
===================================================================
--- src.orig/TortoiseProc/TortoiseProc.cpp
+++ src/TortoiseProc/TortoiseProc.cpp
@@ -355,13 +355,6 @@ BOOL CTortoiseProcApp::InitInstance()
 	if (FAILED(_AtlModule.RegisterClassObjects(CLSCTX_LOCAL_SERVER, \
REGCLS_MULTIPLEUSE)))  return FALSE;
 	#endif // !defined(_WIN32_WCE) || defined(_CE_DCOM)
-	// App was launched with /Embedding or /Automation switch.
-	// Run app as automation server.
-	if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
-	{
-		// Don't show the main window
-		return TRUE;
-	}
 	// App was launched with /Unregserver or /Unregister switch.
 	if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppUnregister)
 	{
@@ -385,6 +378,14 @@ BOOL CTortoiseProcApp::InitInstance()
 	if (CRegDWORD(_T("Software\\TortoiseSVN\\Debug"), FALSE)==TRUE)
 		AfxMessageBox(AfxGetApp()->m_lpCmdLine, MB_OK | MB_ICONINFORMATION);
 
+	// App was launched with /Embedding or /Automation switch.
+	// Run app as automation server.
+	if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
+	{
+		// Don't show the main window
+		return TRUE;
+	}
+
 	if (!parser.HasKey(_T("command")))
 	{
 		CAboutDlg dlg;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic