Revision 6705

View differences:

trunk/install/launcher/izpack-launcher-1.3/src/launcher.cpp
117 117
  wxFileConfig cfg( in );
118 118
  wxString downloadEnabled;
119 119
  wxString launchJarAsync;
120
  wxString askForCheckingProcess;
120 121

  
121
  cfg.Read( "jar",             &paramsJar, wxEmptyString);
122
  cfg.Read( "jre",             &paramsJre, wxEmptyString);
123
  cfg.Read( "downloadJre",     &paramsJreDownload, wxEmptyString);
124
  cfg.Read( "jai",             &paramsJai, wxEmptyString);
125
  cfg.Read( "downloadJai",     &paramsJaiDownload, wxEmptyString);
126
  cfg.Read( "jai_io",          &paramsJaiIo, wxEmptyString);
127
  cfg.Read( "downloadJai_io",  &paramsJaiIoDownload, wxEmptyString);
128
  cfg.Read( "jre_version",     &paramsJreVersion, wxEmptyString);
129
  cfg.Read( "jre_version_prefered",     &paramsJreVersionPrefered, wxEmptyString);
130
  cfg.Read( "jarParams",       &paramsJarParams, wxEmptyString);
131
  cfg.Read( "downloadEnabled", &downloadEnabled, wxEmptyString);
132
  cfg.Read( "launchJarAsync",  &launchJarAsync, wxEmptyString);
122
  cfg.Read( "jar",                    &paramsJar,                wxEmptyString);
123
  cfg.Read( "jre",                    &paramsJre,                wxEmptyString);
124
  cfg.Read( "downloadJre",            &paramsJreDownload,        wxEmptyString);
125
  cfg.Read( "jai",                    &paramsJai,                wxEmptyString);
126
  cfg.Read( "downloadJai",            &paramsJaiDownload,        wxEmptyString);
127
  cfg.Read( "jai_io",                 &paramsJaiIo,              wxEmptyString);
128
  cfg.Read( "downloadJai_io",         &paramsJaiIoDownload,      wxEmptyString);
129
  cfg.Read( "jre_version",            &paramsJreVersion,         wxEmptyString);
130
  cfg.Read( "jre_version_prefered",   &paramsJreVersionPrefered, wxEmptyString);
131
  cfg.Read( "jarParams",              &paramsJarParams,          wxEmptyString);
132
  cfg.Read( "downloadEnabled",        &downloadEnabled,          wxEmptyString);
133
  cfg.Read( "launchJarAsync",         &launchJarAsync,           wxEmptyString);
134
  cfg.Read( "askForCheckingProcess",  &askForCheckingProcess,    wxEmptyString);
133 135
  
134 136
  //procesamos el parametro booleano 'downloadEnabled'
135 137
  paramsEnabledDownload =string_to_bool(downloadEnabled,false);
138
  //procesamos el parametro booleano 'launchJarAsync'
136 139
  paramsLaunchJarAsync =string_to_bool(launchJarAsync,false);
140
  //procesamos el parametro booleano 'askForCheckingProcess'
141
  paramsAskForCheckingProcess=string_to_bool(askForCheckingProcess,true);
137 142
  
138 143
  if (paramsJar == wxEmptyString )
139 144
  {
......
161 166
    exit(1);
162 167
  }
163 168
}
169
bool LauncherApp::confirmYesNoCancel(const wxString &msg,const int yesDefault = true)
170
{
171
  int response;
172
  long maskDefault;
173
  if (yesDefault) {
174
     maskDefault = wxYES_DEFAULT | wxYES_NO | wxCANCEL | wxICON_QUESTION;
175
  } else {
176
     maskDefault = wxNO_DEFAULT | wxYES_NO | wxCANCEL | wxICON_QUESTION;       
177
  }
178
  wxMessageDialog dlg(0, msg, _(APPLICATION_NAME),  maskDefault);
179
  response = dlg.ShowModal();
180
  if (response != wxID_YES && response != wxID_NO) {
181
    notifyToUser(_("Canceled by user"));
182
    exit(1);
183
  }
184
  return (response == wxID_YES);
185
 
186
}
164 187

  
188

  
189

  
165 190
bool LauncherApp::OnInit()
166 191
{
167 192
  isStatusDialogVisible = false;
......
638 663
}
639 664

  
640 665
void LauncherApp::run(){
641

  
642
  if (!searchJRE())
643
  {
644
    jreInstall();
666
  bool doChecks = true;
667
  
668
  if (paramsAskForCheckingProcess) {
669
     wxString msg = _("Do you want to make checks of the application requisites?");
670
     doChecks = confirmYesNoCancel(msg,true);
645 671
  }
672
     
646 673

  
647
  fixSystemJREConfig();
674
  if (doChecks) {
648 675

  
649
  jaiInstall();
676
      if (!searchJRE())
677
      {
678
        jreInstall();
679
      }
680
    
681
      fixSystemJREConfig();
682
    
683
      jaiInstall();
684
    
685
      jaiIoInstall();
686
  } else {
687
    // No quiere comprobacion, por lo que solicitamos 
688
    wxString msgDir = _("Find de Java Virtual Machine executable file to run");
689
    /*
690
    wxFileDialog(
691
     wxWindow* parent,
692
     const wxString& message = "Choose a file",
693
     const wxString& defaultDir = "", 
694
     const wxString& defaultFile = "", 
695
     const wxString& wildcard = "*.*", 
696
     long style = 0, 
697
     const wxPoint& pos = wxDefaultPosition
698
     )
699
    */
700
    
701
    
702
    wxFileDialog dlg(
703
        0,
704
        msgDir,
705
        wxEmptyString,
706
        wxString("java.exe"),
707
        wxString("Java VM executable file (java.exe)|java.exe"),
708
        wxOPEN | wxFILE_MUST_EXIST,
709
        wxDefaultPosition
710
    );
711
    int response = dlg.ShowModal();  
712
    if (response != wxID_OK) {
713
       notifyToUser(_("Canceled by user"));
714
       exit(1);
715
    }
716
    //caragamos la variable con el eljecutable
717
    javaExecPath = dlg.GetPath();
718
    
719
    //generamos el path para el JavaHome (por si acaso)
720
    wxFileName fileName(javaExecPath);
721
    fileName.SetFullName("");
722
    fileName.AppendDir("..");
723
    fileName.Normalize();
724
    javaHome = fileName.GetPath();
725
  
726
  }
650 727

  
651
  jaiIoInstall();
652

  
653 728
  runJRE();
654 729

  
655 730
  exit(0);    
trunk/install/launcher/izpack-launcher-1.3/src/launcher.h
53 53
  wxString paramsJar;
54 54
  wxString paramsJarParams;  
55 55
  bool paramsLaunchJarAsync;
56
  bool paramsAskForCheckingProcess;
56 57
  wxString paramsJre;
57 58
  wxString paramsJreDownload;
58 59
  wxString paramsJai;
......
95 96
  
96 97
  void confirm(const wxString &msg);
97 98

  
99
  bool confirmYesNoCancel(const wxString &msg,const int yesDefault);
100
  
98 101
  void notifyToUser(const wxString &msg);
99 102
  
100 103
  bool compareVersions(const wxString localVersion, const wxString requireVersion);
trunk/install/launcher/izpack-launcher-1.3/src/launcher.ini
1 1

  
2 2
## Ruta al achivo Jar a lanzar
3 3
jar = gvSIG_1.0_alpha.jar
4

  
5

  
6

  
4 7
## Parametros a incluir al lanzar el Jar
5 8
jarParams = 
9

  
10

  
11

  
6 12
## Lanzar el Jar en ansincrono o no:
7 13
##     * si(se lanza el javaw.exe y finaliza el lanzador):S SI YES Y 1
8
##     * si(el lanzado se espera a que termine la ejecucion del javaw.exe):{distinto de los anterirores}
14
##     * no(el lanzado se espera a que termine la ejecucion del javaw.exe):{distinto de los anterirores}
9 15
launchJarAsync = NO
10 16

  
17

  
18

  
19
## Habilita la pregunta al usuario de si hay que hacer las comprobaciones de JRE etc...
20
##     - por defecto se hace la pregunta
21
##     - Si la respuesta del usario es 'no' se solicita la usuario que indique el ejectuable de la JRE
22
##     * si(se pregunta al usario):S SI YES Y 1
23
##     * no(no se pregunta y se realizan las comprobaciones):{distinto de los anterirores}
24
askForCheckingProcess = SI
25

  
26

  
11 27
## Version de JRE requerida
12 28
jre_version = 1.4.2
29
## Si existen varias JRE de la requerida, cual es la preferida (si esta)
13 30
jre_version_prefered = 1.4.2_06
14 31

  
15 32

  
......
19 36
##		- deshabilitado: {distinto de los anteriores}
20 37
downloadEnabled = 0
21 38

  
39

  
22 40
## Path del instalable del jre (si no existe y estan
23 41
##	habilitadas las descargas, lo dejara aqui)
24 42
jre = j2re/win32/j2re-1_4_2_06-windows-i586-p.exe
25 43
downloadJre = 
26 44

  
45

  
46

  
27 47
## Path del instalable del jai (si no existe y estan
28 48
##	habilitadas las descargas, lo dejara aqui)
29 49
jai = j2re/win32/jai-1_1_2_01-lib-windows-i586-jre.exe
30 50
downloadJai = 
31 51

  
52

  
53

  
32 54
## Path del instalable del jai io (si no existe y estan
33 55
##	habilitadas las descargas, lo dejara aqui)
34 56
jai_io = j2re/win32/jai_imageio-1_0_01-lib-windows-i586-jre.exe

Also available in: Unified diff