4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2012 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * Defines the entry point for the DLL application.
26 * @file XCSoarSetup.cpp
27 * @see http://www.codeguru.com/Cpp/W-P/ce/networking/article.php/c9269/
33 /* cegcc doesn't provide ce_setup.h; the following enum values are
36 codeINSTALL_INIT_CONTINUE
= 0,
37 codeINSTALL_INIT_CANCEL
41 codeINSTALL_EXIT_DONE
= 0,
42 codeINSTALL_EXIT_UNINSTALL
46 codeUNINSTALL_INIT_CONTINUE
= 0,
47 codeUNINSTALL_INIT_CANCEL
51 codeUNINSTALL_EXIT_DONE
= 0
54 /* disable C++ name mangling for exported functions */
56 DECLSPEC_EXPORT codeINSTALL_INIT
57 Install_Init(HWND hwndparent
, BOOL ffirstcall
, BOOL fpreviouslyinstalled
,
58 LPCTSTR pszinstalldir
);
60 DECLSPEC_EXPORT codeINSTALL_EXIT
61 Install_Exit(HWND hwndparent
, LPCTSTR pszinstalldir
,
62 WORD cfaileddirs
, WORD cfailedfiles
, WORD cfailedregkeys
,
63 WORD cfailedregvals
, WORD cfailedshortcuts
);
65 DECLSPEC_EXPORT codeUNINSTALL_INIT
66 Uninstall_Init(HWND hwndparent
, LPCTSTR pszinstalldir
);
68 DECLSPEC_EXPORT codeUNINSTALL_EXIT
69 Uninstall_Exit(HWND hwndparent
);
71 DECLSPEC_EXPORT APIENTRY BOOL
72 DllMain(HANDLE hModule
, DWORD ul_reason_for_call
, LPVOID lpReserved
);
76 #if (WIN32_PLATFORM_PSPC == 1)
77 #include <..\support\ActiveSync\inc\ce_setup.h>
84 * Handles tasks done at start of installation
87 Install_Init(HWND hwndparent
, BOOL ffirstcall
, BOOL fpreviouslyinstalled
,
88 LPCTSTR pszinstalldir
)
92 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE
,
93 TEXT("\\Software\\Microsoft\\Today\\Items\\XCSoar"),
94 0, KEY_ALL_ACCESS
, &hKey
) == ERROR_SUCCESS
) {
95 RegDeleteValue(hKey
, TEXT("DLL"));
96 SendMessage(HWND_BROADCAST
, WM_WININICHANGE
, 0xF2, 0);
100 return codeINSTALL_INIT_CONTINUE
;
104 * Handles tasks done at end of installation
107 Install_Exit(HWND hwndparent
, LPCTSTR pszinstalldir
, WORD cfaileddirs
,
108 WORD cfailedfiles
, WORD cfailedregkeys
, WORD cfailedregvals
,
109 WORD cfailedshortcuts
)
111 SendMessage(HWND_BROADCAST
, WM_WININICHANGE
, 0xF2, 0);
112 return codeINSTALL_EXIT_DONE
;
116 * Handles tasks done at beginning of uninstallation
119 Uninstall_Init(HWND hwndparent
, LPCTSTR pszinstalldir
)
123 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE
,
124 TEXT("\\Software\\Microsoft\\Today\\Items\\XCSoar"),
125 0, KEY_ALL_ACCESS
, &hKey
) == ERROR_SUCCESS
) {
126 RegDeleteValue(hKey
, TEXT("DLL"));
128 SendMessage(HWND_BROADCAST
, WM_WININICHANGE
, 0xF2, 0);
131 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE
,
132 TEXT("\\Software\\Microsoft\\Today\\Items"),
133 0, KEY_ALL_ACCESS
, &hKey
) == ERROR_SUCCESS
) {
134 RegDeleteKey(hKey
, TEXT("XCSoar"));
138 return codeUNINSTALL_INIT_CONTINUE
;
142 * Handles tasks done at end of uninstallation
145 Uninstall_Exit(HWND hwndparent
)
147 return codeUNINSTALL_EXIT_DONE
;
151 DllMain(HANDLE hModule
, DWORD ul_reason_for_call
, LPVOID lpReserved
)