Statistics
| Revision:

svn-gvsig-desktop / trunk / install / launcher / izpack-launcher-1.3 / src / launcher.h @ 7006

History | View | Annotate | Download (3.17 KB)

1
/* 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
#ifdef __WINDOWS__
32
  #include <wx/msw/registry.h>
33
#else
34
  #include <stdlib.h>
35
  #include <map>
36
  #include <list>
37
#endif
38

    
39

    
40

    
41
#include "failuredialog.h"
42
#include "statusdialog.h"
43

    
44
class LauncherApp : public wxApp
45
{
46
private:
47

    
48
  wxString APPLICATION_NAME;
49
  
50
  wxString javaHome;
51
  wxString javaExecPath;
52
// std::map<wxString, wxString> params;
53
  wxString paramsJar;
54
  wxString paramsJarParams;  
55
  bool paramsLaunchJarAsync;
56
  bool paramsAskForCheckingProcess;
57
  wxString paramsJre;
58
  wxString paramsJreDownload;
59
  wxString paramsJai;
60
  wxString paramsJaiDownload;
61
  wxString paramsJaiIo;
62
  wxString paramsJaiIoDownload;
63
  bool paramsEnabledDownload;
64
  StatusDialog* statusDialog;
65
  bool isStatusDialogVisible;
66
  wxTimer* myTimer;
67
 
68
  
69
  wxString paramsJreVersion;
70
  wxString paramsJreVersionPrefered;
71

    
72
  wxString localVersionToUse;
73

    
74

    
75
  wxLocale locale;
76

    
77
  bool completed;
78

    
79
  wxString cfgName;
80

    
81
  void loadParams();
82

    
83
  void error(const wxString &msg);
84

    
85
  bool searchJRE();
86

    
87
  void runJRE();
88

    
89
  void manualLaunch();
90

    
91
  void jreInstall();
92

    
93
  void netDownload();
94

    
95
  void echo(const wxString &msg);
96
  
97
  void confirm(const wxString &msg);
98

    
99
  bool confirmYesNoCancel(const wxString &msg,const int yesDefault);
100
  
101
  void notifyToUser(const wxString &msg);
102
  
103
  bool compareVersions(const wxString localVersion, const wxString requireVersion);
104

    
105
  void jaiInstall();
106

    
107
  bool checkVersion(const wxString msg);
108
  
109
  void jaiIoInstall();
110

    
111
  bool checksJaiIo();
112
  
113
  bool checksJai();
114
  
115
  void fixSystemJREConfig();
116
  
117
  bool downloadFileHttp(const wxString urlOfFile, const wxString filePath, const wxString msg);
118
  
119
  bool checkInstallerFile(const wxString filePath, const wxString urlDownload, const wxString fileDescription);
120
  
121
  void showStatusMsg(const wxString msg);
122
  
123
  void run();
124
  
125
public:
126

    
127
  LauncherApp();
128

    
129
  virtual ~LauncherApp();
130

    
131
  virtual bool OnInit();
132
  
133
  virtual void OnTimer(wxTimerEvent& event);
134

    
135
protected:
136
   DECLARE_EVENT_TABLE()
137

    
138
};
139

    
140
#endif