OLD | NEW |
| (Empty) |
1 // Copyright 2008-2009 Google Inc. | |
2 // | |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 // ======================================================================== | |
15 | |
16 #ifndef OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_COMPATIBILITY_TEST_H_ | |
17 #define OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_COMPATIBILITY_TEST_H_ | |
18 | |
19 #include <Windows.h> | |
20 #include <tchar.h> | |
21 #include "base/scoped_ptr.h" | |
22 #include "omaha/common/scope_guard.h" | |
23 #include "omaha/common/apply_tag.h" | |
24 #include "omaha/common/constants.h" | |
25 #include "omaha/common/debug.h" | |
26 #include "omaha/common/error.h" | |
27 #include "omaha/common/file.h" | |
28 #include "omaha/common/logging.h" | |
29 #include "omaha/common/path.h" | |
30 #include "omaha/common/reg_key.h" | |
31 #include "omaha/common/utils.h" | |
32 #include "omaha/tools/omahacompatibility/console_writer.h" | |
33 #include "omaha/tools/omahacompatibility/HttpServer/http_server.h" | |
34 #include "omaha/tools/omahacompatibility/HttpServer/update_check_handler.h" | |
35 #include "omaha/tools/omahacompatibility/HttpServer/download_handler.h" | |
36 | |
37 namespace omaha { | |
38 | |
39 // This is the main class the starts the HttpServer and stamps GoogleUpdate | |
40 // appropriately and runs the installer. | |
41 class CompatibilityTest { | |
42 public: | |
43 CompatibilityTest() : thread_id_(0) {} | |
44 int Main(bool test_omaha); | |
45 void set_config_file(const CString& config_file) { | |
46 config_file_ = config_file; | |
47 } | |
48 void set_googleupdate_setup_path(const CString& path) { | |
49 googleupdate_setup_path_ = path; | |
50 } | |
51 HRESULT RunHttpServerInternal(); | |
52 | |
53 private: | |
54 static DWORD WINAPI StartStartHttpServerInternal(void* omaha); | |
55 | |
56 // Returns true of omaha is installer for user or machine. | |
57 bool IsOmahaInstalled(); | |
58 | |
59 // Starts running the HttpServer. | |
60 HRESULT StartHttpServer(); | |
61 | |
62 // Overrides the url, pingurl, aucheckperiod, overinstall values. | |
63 static HRESULT SetupRegistry(bool needs_admin); | |
64 | |
65 // Restores the values of the registry. | |
66 static HRESULT RestoreRegistry(); | |
67 | |
68 // Builds a unique path to run the installer from. | |
69 HRESULT BuildTaggedGoogleUpdatePath(); | |
70 | |
71 // Stamps googleupdate with the correct values and runs the it. | |
72 HRESULT StartGoogleUpdate(); | |
73 | |
74 // Signals omaha to update the application. | |
75 HRESULT StartApplicationUpdate(); | |
76 | |
77 scoped_thread thread_; | |
78 DWORD thread_id_; | |
79 CString config_file_; | |
80 CString googleupdate_setup_path_; | |
81 ConfigResponses config_responses_; | |
82 CString tagged_google_update_path_; | |
83 scoped_ptr<ConsoleWriter> console_writer_; | |
84 }; | |
85 | |
86 } // namespace omaha | |
87 | |
88 #endif // OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_COMPATIBILITY_TEST_H_ | |
OLD | NEW |