1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 /* BIG FAT WARNING: Do not use any functions which require the C-Runtime library
\r
22 in this custom action dll! The runtimes might not be installed yet!
\r
26 #include "shlwapi.h"
\r
27 #include "shellapi.h"
\r
28 #pragma comment(lib, "shlwapi")
\r
29 #pragma comment(lib, "shell32")
\r
32 #define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow64")
\r
34 #define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow")
\r
38 BOOL APIENTRY DllMain( HANDLE hModule,
\r
39 DWORD ul_reason_for_call,
\r
46 UINT __stdcall TerminateCache(MSIHANDLE hModule)
\r
48 HWND hWnd = FindWindow(TSVN_CACHE_WINDOW_NAME, TSVN_CACHE_WINDOW_NAME);
\r
51 PostMessage(hWnd, WM_CLOSE, NULL, NULL);
\r
52 for (int i=0; i<10; ++i)
\r
55 if (!IsWindow(hWnd))
\r
58 return ERROR_SUCCESS;
\r
61 // Don't return ERROR_FUNCTION_FAILED, because even if the cache is still
\r
62 // running, the installer will overwrite the file, and we require a
\r
63 // reboot anyway after upgrading.
\r
64 return ERROR_SUCCESS;
\r
66 // cache wasn't even running
\r
67 return ERROR_SUCCESS;
\r
70 UINT __stdcall OpenDonatePage(MSIHANDLE hModule)
\r
72 ShellExecute(NULL, _T("open"), _T("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GJGTG75GV5PL6&lc=C2&item_name=TortoiseGit¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"), NULL,NULL, SW_SHOW);
\r
73 return ERROR_SUCCESS;
\r
76 UINT __stdcall MsgBox(MSIHANDLE hModule)
\r
78 MessageBox(NULL, _T("CustomAction \"MsgBox\" running"), _T("Installer"), MB_ICONINFORMATION);
\r
79 return ERROR_SUCCESS;
\r