root / trunk / install / launcher / izpack-launcher-1.3_linux / src / launcher.h @ 11445
History | View | Annotate | Download (3.22 KB)
1 | 6834 | 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 | |||
39 | class LauncherApp : public wxApp |
||
40 | { |
||
41 | private:
|
||
42 | |||
43 | wxString APPLICATION_NAME; |
||
44 | |||
45 | wxString javaHome; |
||
46 | wxString javaExecPath; |
||
47 | // std::map<wxString, wxString> params;
|
||
48 | wxString paramsJar; |
||
49 | wxString paramsJarParams; |
||
50 | bool paramsLaunchJarAsync;
|
||
51 | wxString paramsJre; |
||
52 | wxString paramsJreDownload; |
||
53 | wxString paramsJreInstallCmd; |
||
54 | wxString paramsJreInstalledJavaFile; |
||
55 | wxString paramsJreInstalledRootDirectory; |
||
56 | bool paramsEnabledDownload;
|
||
57 | StatusDialog* statusDialog; |
||
58 | bool isStatusDialogVisible;
|
||
59 | wxTimer* myTimer; |
||
60 | |||
61 | |||
62 | wxString paramsJreVersion; |
||
63 | wxString paramsJreVersionPrefered; |
||
64 | |||
65 | wxLocale locale; |
||
66 | |||
67 | wxString cfgName; |
||
68 | |||
69 | wxFont font; |
||
70 | |||
71 | void loadParams();
|
||
72 | |||
73 | void error(const wxString &msg); |
||
74 | |||
75 | void runJRE();
|
||
76 | |||
77 | void echo(const wxString &msg); |
||
78 | |||
79 | void confirm(const wxString &msg); |
||
80 | |||
81 | bool confirmYesNoCancel(const wxString &msg,const int yesDefault); |
||
82 | |||
83 | void notifyToUser(const wxString &msg); |
||
84 | void notifyErrorToUser(const wxString &msg); |
||
85 | |||
86 | bool compareVersions(const wxString localVersion, const wxString requireVersion); |
||
87 | |||
88 | bool downloadFileHttp(const wxString urlOfFile, const wxString filePath, const wxString msg); |
||
89 | |||
90 | bool checkInstallerFile(const wxString filePath, const wxString urlDownload, const wxString fileDescription); |
||
91 | |||
92 | void showStatusMsg(const wxString msg); |
||
93 | |||
94 | void run();
|
||
95 | |||
96 | wxString checkJava(const wxString javaFileName) ;
|
||
97 | |||
98 | wxString previousJRE() ; //*
|
||
99 | |||
100 | wxString installJRE() ; |
||
101 | |||
102 | wxString useEnvironJRE() ; //*
|
||
103 | |||
104 | wxString selectJavaExecFileManualy(); |
||
105 | |||
106 | bool checkPreviousJRE(); //* |
||
107 | |||
108 | bool checkEnvironmentJRE();
|
||
109 | |||
110 | wxString getJavaExecFileHome(wxString javaFileName); |
||
111 | |||
112 | wxString getJavaExecFileVersion(wxString javaFileName); |
||
113 | |||
114 | public:
|
||
115 | |||
116 | LauncherApp(); |
||
117 | |||
118 | virtual ~LauncherApp(); |
||
119 | |||
120 | virtual bool OnInit();
|
||
121 | |||
122 | virtual void OnTimer(wxTimerEvent& event);
|
||
123 | |||
124 | protected:
|
||
125 | DECLARE_EVENT_TABLE() |
||
126 | |||
127 | }; |
||
128 | |||
129 | #endif |