Revision 7879
trunk/install/launcher/izpack-launcher-1.3/dist/launcher-Win32.ini | ||
---|---|---|
97 | 97 |
|
98 | 98 |
source3= |
99 | 99 |
target3= |
100 |
|
|
101 |
|
|
102 |
; En esta seccion se pueden definir valores |
|
103 |
; que se pueden utilizar en el parametro 'command' |
|
104 |
[Parameters] |
trunk/install/launcher/izpack-launcher-1.3/src/launcher.ini | ||
---|---|---|
11 | 11 |
; * #ARGS# cadena con todos los argumentos con los que se ha llamado al lanzador |
12 | 12 |
; * #ARG1#, #ARG2#, ... #ARG9#: parametro recivido en 'n' lugar |
13 | 13 |
; * #ARG0#: Nombre del ejecutable del lanzador |
14 |
; Tambien admite los valores de la seccion 'Parameters' encerrados entre |
|
15 |
; el caracter almuadilla '#' |
|
14 | 16 |
command = #JAVA# -jar #JAR# |
15 | 17 |
|
16 | 18 |
|
... | ... | |
87 | 89 |
|
88 | 90 |
source3= |
89 | 91 |
target3= |
92 |
|
|
93 |
; En esta seccion se pueden definir valores |
|
94 |
; que se pueden utilizar en el parametro 'command' |
|
95 |
[Parameters] |
trunk/install/launcher/izpack-launcher-1.3/src/launcher.cpp | ||
---|---|---|
179 | 179 |
{ |
180 | 180 |
wxMessageDialog dlg(0, msg, _(APPLICATION_NAME), wxOK | wxICON_ERROR); |
181 | 181 |
dlg.ShowModal(); |
182 |
printf(msg.c_str()); |
|
182 | 183 |
exit(1); |
183 | 184 |
} |
184 | 185 |
|
... | ... | |
875 | 876 |
|
876 | 877 |
// #ARG0# |
877 | 878 |
resultCommand.Replace("#ARG0#",argv[0]); |
879 |
|
|
880 |
// variables de la seccion parameters |
|
881 |
|
|
882 |
//echo(resultCommand); |
|
883 |
|
|
884 |
wxArrayString keys = sectionKeysFromINI("Parameters"); |
|
885 |
if (!keys.IsEmpty()){ |
|
886 |
echo(theArg.Format("No empty: count =%i",keys.GetCount())); |
|
887 |
wxArrayString values = sectionKeysValuesFromINI("Parameters",keys); |
|
888 |
unsigned int i; |
|
889 |
for (i=0;i<keys.GetCount();i++){ |
|
890 |
echo("#"+keys[i]+"#="+values[i]); |
|
891 |
resultCommand.Replace("#"+keys[i]+"#",values[i]); |
|
892 |
} |
|
893 |
|
|
894 |
//echo(resultCommand); |
|
895 |
|
|
896 |
} |
|
897 |
|
|
878 | 898 |
|
899 |
|
|
879 | 900 |
return resultCommand; |
880 | 901 |
} |
881 | 902 |
|
... | ... | |
1072 | 1093 |
return readFromINI("default",key,defaultValue); |
1073 | 1094 |
} |
1074 | 1095 |
|
1096 |
wxArrayString LauncherApp::sectionKeysFromINI(const wxString section){ |
|
1097 |
char* charResult; |
|
1075 | 1098 |
|
1099 |
charResult =myGetPrivateProfileString(section.c_str(),NULL,NULL,cfgName.c_str()); |
|
1100 |
//echo(section +" = "+charResult); |
|
1076 | 1101 |
|
1102 |
wxArrayString rvalue; |
|
1103 |
char* token; |
|
1104 |
|
|
1105 |
for ( |
|
1106 |
token = strtok(charResult,"="); |
|
1107 |
token; |
|
1108 |
token = strtok(NULL,"=") |
|
1109 |
|
|
1110 |
) { |
|
1111 |
rvalue.Add(token); |
|
1112 |
} |
|
1113 |
return rvalue; |
|
1114 |
} |
|
1115 |
|
|
1116 |
|
|
1117 |
wxArrayString LauncherApp::sectionKeysValuesFromINI(const wxString section,wxArrayString keys) { |
|
1118 |
wxArrayString rvalue; |
|
1119 |
unsigned int i; |
|
1120 |
wxString key; |
|
1121 |
wxString value; |
|
1122 |
for (i=0;i < keys.GetCount(); i++){ |
|
1123 |
rvalue.Add(readPathFromINI( section, keys[i], "")); |
|
1124 |
} |
|
1125 |
return rvalue; |
|
1126 |
} |
|
1127 |
|
trunk/install/launcher/izpack-launcher-1.3/src/launcher.h | ||
---|---|---|
141 | 141 |
|
142 | 142 |
wxString LauncherApp::readFromINI(wxString key, const wxString defaultValue); |
143 | 143 |
|
144 |
wxArrayString LauncherApp::sectionKeysFromINI(const wxString section); |
|
144 | 145 |
|
146 |
wxArrayString LauncherApp::sectionKeysValuesFromINI(const wxString section,wxArrayString keys); |
|
145 | 147 |
|
148 |
|
|
149 |
|
|
146 | 150 |
|
147 | 151 |
public: |
148 | 152 |
|
Also available in: Unified diff