Statistics
| Revision:

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

History | View | Annotate | Download (3.42 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 paramsCommand;  
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
  bool paramsDoChecks;
65
  wxString paramsJreHome;
66
  StatusDialog* statusDialog;
67
  bool isStatusDialogVisible;
68
  wxTimer* myTimer;
69
 
70
  
71
  wxString paramsJreVersion;
72
  wxString paramsJreVersionPrefered;
73

    
74
  wxString localVersionToUse;
75

    
76

    
77
  wxLocale locale;
78

    
79
  bool completed;
80

    
81
  wxString cfgName;
82

    
83
  void loadParams();
84

    
85
  void error(const wxString &msg);
86

    
87
  bool searchJRE();
88

    
89
  void runJRE();
90

    
91
  void manualLaunch();
92

    
93
  void jreInstall();
94

    
95
  void netDownload();
96

    
97
  void echo(const wxString &msg);
98
  
99
  void confirm(const wxString &msg);
100

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

    
107
  void jaiInstall();
108

    
109
  bool checkVersion(const wxString msg);
110
  
111
  void jaiIoInstall();
112

    
113
  bool checksJaiIo();
114
  
115
  bool checksJai();
116
  
117
  void fixSystemJREConfig();
118
  
119
  bool downloadFileHttp(const wxString urlOfFile, const wxString filePath, const wxString msg);
120

    
121
  bool copyFile(const wxString urlOfFile, const wxString filePath, const wxString msg);
122
  
123
  bool checkInstallerFile(const wxString filePath, const wxString urlDownload, const wxString fileDescription);
124
  
125
  void showStatusMsg(const wxString msg);
126
  
127
  void run();
128
  
129
  void calculateJavaExePath(const wxString aJavaHome);
130

    
131
  wxString parseCommand();
132

    
133
  bool copyRequiredFiles();
134
  
135
public:
136

    
137
  LauncherApp();
138

    
139
  virtual ~LauncherApp();
140

    
141
  virtual bool OnInit();
142
  
143
  virtual void OnTimer(wxTimerEvent& event);
144

    
145
protected:
146
   DECLARE_EVENT_TABLE()
147

    
148
};
149

    
150
#endif