root / trunk / install / launcher / izpack-launcher-1.3_windows / src / launcher.h @ 11445
History | View | Annotate | Download (4.84 KB)
1 | 8474 | jmvivo | /* Copyright (c) 2004 Julien Ponge - All rights reserved.
|
---|---|---|---|
2 | *
|
||
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
4 | * of this software and associated documentation files (the "Software"), to
|
||
5 | * deal in the Software without restriction, including without limitation the
|
||
6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||
7 | * sell copies of the Software, and to permit persons to whom the Software is
|
||
8 | * furnished to do so, subject to the following conditions:
|
||
9 | *
|
||
10 | * The above copyright notice and this permission notice shall be included in
|
||
11 | * all copies or substantial portions of the Software.
|
||
12 | *
|
||
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||
19 | * IN THE SOFTWARE.
|
||
20 | */
|
||
21 | |||
22 | #ifndef LAUNCHER_H
|
||
23 | #define LAUNCHER_H
|
||
24 | |||
25 | #include <wx/wx.h> |
||
26 | #include <wx/config.h> |
||
27 | #include <wx/confbase.h> |
||
28 | #include <wx/fileconf.h> |
||
29 | #include <wx/wfstream.h> |
||
30 | |||
31 | |||
32 | #include <stdlib.h> |
||
33 | #include <map> |
||
34 | #include <list> |
||
35 | |||
36 | #include "selectiondialog.h" |
||
37 | #include "statusdialog.h" |
||
38 | #include "myIniReader.h" |
||
39 | |||
40 | class LauncherApp : public wxApp |
||
41 | { |
||
42 | private:
|
||
43 | |||
44 | wxString APPLICATION_NAME; |
||
45 | wxString paramsApplicationName; |
||
46 | |||
47 | wxString javaHome; |
||
48 | wxString javaExePath; |
||
49 | // std::map<wxString, wxString> params;
|
||
50 | wxString paramsJar; |
||
51 | wxString paramsCommand; |
||
52 | bool paramsLaunchJarAsync;
|
||
53 | wxString paramsProvidedJre; |
||
54 | wxString paramsProvidedJreDownload; |
||
55 | wxString paramsProvidedJreInstallCmd; |
||
56 | wxString paramsProvidedJreInstalledJavaHome; |
||
57 | wxString paramsProvidedJreInstalledRootDirectory; |
||
58 | wxString paramsJre; |
||
59 | wxString paramsJreDownload; |
||
60 | wxString paramsJai; |
||
61 | wxString paramsJaiDownload; |
||
62 | wxString paramsJaiIo; |
||
63 | wxString paramsJaiIoDownload; |
||
64 | |||
65 | |||
66 | bool paramsEnabledDownload;
|
||
67 | bool paramsDoChecks;
|
||
68 | wxString paramsJreHome; |
||
69 | StatusDialog* statusDialog; |
||
70 | bool isStatusDialogVisible;
|
||
71 | wxTimer* myTimer; |
||
72 | |||
73 | |||
74 | wxArrayString variables; |
||
75 | wxArrayString variablesValues; |
||
76 | |||
77 | wxString paramsLaunchMode; |
||
78 | |||
79 | |||
80 | wxString paramsJreVersion; |
||
81 | wxString paramsJreVersionPrefered; |
||
82 | |||
83 | wxLocale locale; |
||
84 | |||
85 | wxString cfgName; |
||
86 | |||
87 | |||
88 | void loadParams();
|
||
89 | |||
90 | void error(const wxString &msg); |
||
91 | |||
92 | void runJRE();
|
||
93 | |||
94 | void echo(const wxString &msg); |
||
95 | |||
96 | void confirm(const wxString &msg); |
||
97 | |||
98 | bool confirmYesNoCancel(const wxString &msg,const int yesDefault); |
||
99 | |||
100 | void notifyToUser(const wxString &msg); |
||
101 | void notifyErrorToUser(const wxString &msg); |
||
102 | |||
103 | bool compareVersions(const wxString localVersion, const wxString requireVersion); |
||
104 | |||
105 | bool downloadFileHttp(const wxString urlOfFile, const wxString filePath, const wxString msg); |
||
106 | |||
107 | bool checkInstallerFile(const wxString filePath, const wxString urlDownload, const wxString fileDescription); |
||
108 | |||
109 | void showStatusMsg(const wxString msg); |
||
110 | |||
111 | void run();
|
||
112 | |||
113 | wxString checkJava(const wxString javaFileName) ;
|
||
114 | |||
115 | wxString previousJRE() ; //*
|
||
116 | |||
117 | wxString installJRE() ; |
||
118 | |||
119 | wxString installProvidedJRE() ; |
||
120 | |||
121 | wxString useEnvironJRE() ; //*
|
||
122 | |||
123 | wxString selectJavaExeFileManualy(); |
||
124 | |||
125 | bool checkPreviousJRE(); //* |
||
126 | |||
127 | bool checkEnvironmentJRE();
|
||
128 | |||
129 | wxString getJavaExeFileHome(wxString javaFileName); |
||
130 | |||
131 | wxString getJavaExeFileVersion(wxString javaFileName); |
||
132 | |||
133 | |||
134 | |||
135 | wxString readPathFromINI(wxString section, wxString key, const wxString defaultValue);
|
||
136 | |||
137 | wxString readPathFromINI(wxString key, const wxString defaultValue);
|
||
138 | |||
139 | wxString readFromINI(wxString section, wxString key, const wxString defaultValue);
|
||
140 | |||
141 | wxString readFromINI(wxString key, const wxString defaultValue);
|
||
142 | |||
143 | wxArrayString sectionKeysFromINI(const wxString section);
|
||
144 | |||
145 | wxArrayString sectionKeysValuesFromINI(const wxString section,wxArrayString keys);
|
||
146 | |||
147 | |||
148 | bool copyRequiredFiles();
|
||
149 | |||
150 | bool copyFile(const wxString urlOfFile, const wxString filePath, const wxString msg); |
||
151 | |||
152 | |||
153 | void showStatusWindow();
|
||
154 | |||
155 | void showSelectionDialog();
|
||
156 | |||
157 | wxString parseCommand(); |
||
158 | |||
159 | wxString parseString(const wxString theString);
|
||
160 | |||
161 | wxString calculateJavaExePath(const wxString aJavaHome);
|
||
162 | |||
163 | wxString searchJRE(); |
||
164 | |||
165 | void jreInstall();
|
||
166 | |||
167 | wxString getJavaHomeFromVersion(const wxString aVersion);
|
||
168 | |||
169 | void fixSystemJREConfig(const wxString aVersionToUse); |
||
170 | |||
171 | bool checksJai(const wxString aJavaHome); |
||
172 | |||
173 | void jaiInstall(const wxString aJavaHome, const wxString aVersionToUse); |
||
174 | |||
175 | bool checksJaiIo(const wxString aJavaHome); |
||
176 | |||
177 | void jaiIoInstall(const wxString aJavaHome, const wxString aVersionToUse); |
||
178 | |||
179 | void setJavaExePath(const wxString aJavaExe); |
||
180 | |||
181 | public:
|
||
182 | |||
183 | LauncherApp(); |
||
184 | |||
185 | virtual ~LauncherApp(); |
||
186 | |||
187 | virtual bool OnInit();
|
||
188 | |||
189 | virtual void OnTimer(wxTimerEvent& event);
|
||
190 | |||
191 | protected:
|
||
192 | DECLARE_EVENT_TABLE() |
||
193 | |||
194 | }; |
||
195 | |||
196 | #endif |