diff options
Diffstat (limited to 'rbutil/bootloaders.cpp')
-rwxr-xr-x | rbutil/bootloaders.cpp | 549 |
1 files changed, 0 insertions, 549 deletions
diff --git a/rbutil/bootloaders.cpp b/rbutil/bootloaders.cpp deleted file mode 100755 index 4ac4828307..0000000000 --- a/rbutil/bootloaders.cpp +++ /dev/null | |||
@@ -1,549 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * Module: rbutil | ||
9 | * File: bootloaders.cpp | ||
10 | * | ||
11 | * Copyright (C) 2007 Dominik Wenger | ||
12 | * | ||
13 | * All files in this archive are subject to the GNU General Public License. | ||
14 | * See the file COPYING in the source tree root for full license agreement. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #include "bootloaders.h" | ||
22 | |||
23 | |||
24 | |||
25 | int verbose =0; | ||
26 | // reserves memory for ipodpatcher | ||
27 | bool initIpodpatcher() | ||
28 | { | ||
29 | if (ipod_alloc_buffer(§orbuf,BUFFER_SIZE) < 0) return true; | ||
30 | else return false; | ||
31 | } | ||
32 | // uses ipodpatcher for add and rem of bootloader | ||
33 | bool ipodpatcher(int mode,wxString bootloadername) | ||
34 | { | ||
35 | wxString src,dest,buf; | ||
36 | |||
37 | struct ipod_t ipod; | ||
38 | |||
39 | int n = ipod_scan(&ipod); | ||
40 | if (n == 0) | ||
41 | { | ||
42 | ERR_DIALOG(wxT("[ERR] No ipods found."), wxT("Scanning for Ipods")); | ||
43 | return false; | ||
44 | } | ||
45 | if (n > 1) | ||
46 | { | ||
47 | ERR_DIALOG(wxT("[ERR] to many ipods found."), wxT("Scanning for Ipods")); | ||
48 | return false; | ||
49 | } | ||
50 | |||
51 | // downloading files | ||
52 | if(mode == BOOTLOADER_ADD) | ||
53 | { | ||
54 | src = gv->bootloader_url + wxT("/ipod/") | ||
55 | + bootloadername + wxT(".ipod"); | ||
56 | dest = gv->stdpaths->GetUserDataDir() | ||
57 | + wxT("" PATH_SEP "download" PATH_SEP) + bootloadername; | ||
58 | if ( DownloadURL(src, dest) ) | ||
59 | { | ||
60 | wxRemoveFile(dest); | ||
61 | ERR_DIALOG(wxT("Unable to download ") + src, wxT("Install")); | ||
62 | return false; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | if (ipod_open(&ipod, 0) < 0) | ||
67 | { | ||
68 | ERR_DIALOG(wxT("[ERR] could not open ipod"), wxT("open Ipod")); | ||
69 | return false; | ||
70 | } | ||
71 | |||
72 | if (read_partinfo(&ipod,0) < 0) | ||
73 | { | ||
74 | ERR_DIALOG(wxT("[ERR] could not read partitiontable"), wxT("reading partitiontable")); | ||
75 | return false; | ||
76 | } | ||
77 | |||
78 | if (ipod.pinfo[0].start==0) | ||
79 | { | ||
80 | ERR_DIALOG(wxT("[ERR] No partition 0 on disk"), wxT("reading partitiontable")); | ||
81 | int i; | ||
82 | double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size; | ||
83 | |||
84 | buf.Printf(wxT("[INFO] Part Start Sector End Sector Size (MB) Type\n")); | ||
85 | ERR_DIALOG(buf, wxT("reading partitiontable")); | ||
86 | for ( i = 0; i < 4; i++ ) { | ||
87 | if (ipod.pinfo[i].start != 0) { | ||
88 | buf.Printf(wxT("[INFO] %d %10ld %10ld %10.1f %s (0x%02x)\n"), | ||
89 | i, | ||
90 | ipod.pinfo[i].start, | ||
91 | ipod.pinfo[i].start+ipod.pinfo[i].size-1, | ||
92 | ipod.pinfo[i].size/sectors_per_MB, | ||
93 | get_parttype(ipod.pinfo[i].type), | ||
94 | ipod.pinfo[i].type); | ||
95 | ERR_DIALOG(buf, wxT("reading partitiontable")); | ||
96 | } | ||
97 | } | ||
98 | return false; | ||
99 | } | ||
100 | |||
101 | read_directory(&ipod); | ||
102 | |||
103 | if (ipod.nimages <= 0) | ||
104 | { | ||
105 | ERR_DIALOG(wxT("[ERR] Failed to read firmware directory"), wxT("reading directory")); | ||
106 | return false; | ||
107 | } | ||
108 | if (getmodel(&ipod,(ipod.ipod_directory[0].vers>>8)) < 0) | ||
109 | { | ||
110 | buf.Printf(wxT("[ERR] Unknown version number in firmware (%08x)\n"), | ||
111 | ipod.ipod_directory[0].vers ); | ||
112 | ERR_DIALOG(buf, wxT("reading directory")); | ||
113 | return false; | ||
114 | } | ||
115 | |||
116 | if (ipod.macpod) | ||
117 | { | ||
118 | WARN_DIALOG(wxT("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),wxT("MacPod")); | ||
119 | } | ||
120 | |||
121 | |||
122 | if(mode == BOOTLOADER_ADD) | ||
123 | { | ||
124 | if (ipod_reopen_rw(&ipod) < 0) { | ||
125 | ERR_DIALOG(wxT("[ERR] Could not open Ipod in RW mode"), wxT("Bootloader add")); | ||
126 | return false; | ||
127 | } | ||
128 | |||
129 | if (add_bootloader(&ipod, (char*)dest.c_str(), FILETYPE_DOT_IPOD)==0) { | ||
130 | |||
131 | } else { | ||
132 | ERR_DIALOG(wxT("[ERR] failed to add Bootloader"), wxT("Bootloader add")); | ||
133 | return false; | ||
134 | } | ||
135 | } | ||
136 | else if(mode == BOOTLOADER_REM) | ||
137 | { | ||
138 | if (ipod_reopen_rw(&ipod) < 0) { | ||
139 | ERR_DIALOG(wxT("[ERR] Could not open Ipod in RW mode"), wxT("Bootloader add")); | ||
140 | return false; | ||
141 | } | ||
142 | |||
143 | if (ipod.ipod_directory[0].entryOffset==0) { | ||
144 | ERR_DIALOG(wxT("[ERR] No bootloader detected.\n"), wxT("Bootloader del")); | ||
145 | return false; | ||
146 | } else { | ||
147 | if (delete_bootloader(&ipod)==0) { | ||
148 | |||
149 | } else { | ||
150 | ERR_DIALOG(wxT("[ERR] --delete-bootloader failed.\n"), wxT("Bootloader del")); | ||
151 | return false; | ||
152 | } | ||
153 | } | ||
154 | } | ||
155 | |||
156 | ipod_close(&ipod); | ||
157 | return true; | ||
158 | } | ||
159 | |||
160 | // reserves memory for sansapatcher | ||
161 | bool initSansaPatcher() | ||
162 | { | ||
163 | if (sansa_alloc_buffer(§orbuf,BUFFER_SIZE) < 0) return true; | ||
164 | else return false; | ||
165 | } | ||
166 | |||
167 | |||
168 | // sansainstallation | ||
169 | bool sansapatcher(int mode,wxString bootloadername) | ||
170 | { | ||
171 | wxString src,dest,buf; | ||
172 | |||
173 | struct sansa_t sansa; | ||
174 | |||
175 | int n = sansa_scan(&sansa); | ||
176 | if (n == 0) | ||
177 | { | ||
178 | ERR_DIALOG(wxT("[ERR] No Sansa found."), wxT("Scanning for Sansa")); | ||
179 | return false; | ||
180 | } | ||
181 | if (n > 1) | ||
182 | { | ||
183 | ERR_DIALOG(wxT("[ERR] to many Sansa found."), wxT("Scanning for Sansa")); | ||
184 | return false; | ||
185 | } | ||
186 | |||
187 | // downloading files | ||
188 | if(mode == BOOTLOADER_ADD) | ||
189 | { | ||
190 | src = gv->bootloader_url + wxT("/sandisk-sansa/e200/") | ||
191 | + bootloadername; | ||
192 | dest = gv->stdpaths->GetUserDataDir() | ||
193 | + wxT("" PATH_SEP "download" PATH_SEP) + bootloadername; | ||
194 | if ( DownloadURL(src, dest) ) | ||
195 | { | ||
196 | wxRemoveFile(dest); | ||
197 | ERR_DIALOG(wxT("Unable to download ") + src, wxT("Download")); | ||
198 | return false; | ||
199 | } | ||
200 | } | ||
201 | |||
202 | if (sansa_open(&sansa, 0) < 0) | ||
203 | { | ||
204 | ERR_DIALOG(wxT("[ERR] could not open sansa"), wxT("open Sansa")); | ||
205 | return false; | ||
206 | } | ||
207 | |||
208 | if (sansa_read_partinfo(&sansa,0) < 0) | ||
209 | { | ||
210 | ERR_DIALOG(wxT("[ERR] could not read partitiontable"), wxT("reading partitiontable")); | ||
211 | return false; | ||
212 | } | ||
213 | |||
214 | int i = is_e200(&sansa); | ||
215 | if (i < 0) { | ||
216 | ERR_DIALOG(wxT("[ERR] Disk is not an E200 (%d), aborting.\n"), wxT("Checking Disk")); | ||
217 | return false; | ||
218 | } | ||
219 | |||
220 | if (sansa.hasoldbootloader) | ||
221 | { | ||
222 | ERR_DIALOG(wxT("[ERR] ************************************************************************\n" | ||
223 | "[ERR] *** OLD ROCKBOX INSTALLATION DETECTED, ABORTING.\n" | ||
224 | "[ERR] *** You must reinstall the original Sansa firmware before running\n" | ||
225 | "[ERR] *** sansapatcher for the first time.\n" | ||
226 | "[ERR] *** See http://www.rockbox.org/twiki/bin/view/Main/SansaE200Install\n" | ||
227 | "[ERR] ************************************************************************\n"),wxT("Checking Disk")); | ||
228 | return false; | ||
229 | } | ||
230 | |||
231 | if(mode == BOOTLOADER_ADD) | ||
232 | { | ||
233 | if (sansa_reopen_rw(&sansa) < 0) { | ||
234 | ERR_DIALOG(wxT("[ERR] Could not open Sansa in RW mode"), wxT("Bootloader add")); | ||
235 | return false; | ||
236 | } | ||
237 | |||
238 | if (sansa_add_bootloader(&sansa, (char*)dest.c_str(), FILETYPE_MI4)==0) { | ||
239 | |||
240 | } else { | ||
241 | ERR_DIALOG(wxT("[ERR] failed to add Bootloader"), wxT("Bootloader add")); | ||
242 | } | ||
243 | |||
244 | } | ||
245 | else if(mode == BOOTLOADER_REM) | ||
246 | { | ||
247 | if (sansa_reopen_rw(&sansa) < 0) { | ||
248 | ERR_DIALOG(wxT("[ERR] Could not open Sansa in RW mode"), wxT("Bootloader Remove")); | ||
249 | } | ||
250 | |||
251 | if (sansa_delete_bootloader(&sansa)==0) { | ||
252 | |||
253 | } else { | ||
254 | ERR_DIALOG(wxT("[ERR] failed to remove Bootloader"), wxT("Bootloader remove")); | ||
255 | } | ||
256 | } | ||
257 | |||
258 | sansa_close(&sansa); | ||
259 | return true; | ||
260 | } | ||
261 | |||
262 | // gigabeatinstallation | ||
263 | bool gigabeatf(int mode,wxString bootloadername,wxString deviceDir) | ||
264 | { | ||
265 | wxString path1,path2; | ||
266 | wxString err; | ||
267 | wxString src,dest; | ||
268 | |||
269 | path1 = deviceDir | ||
270 | + wxT("" PATH_SEP "GBSYSTEM" PATH_SEP "FWIMG" PATH_SEP "FWIMG01.DAT"); | ||
271 | |||
272 | if(mode == BOOTLOADER_ADD) | ||
273 | { | ||
274 | //Files downloaden | ||
275 | src = gv->bootloader_url + wxT("/gigabeat/") + bootloadername; | ||
276 | dest = gv->stdpaths->GetUserDataDir() | ||
277 | + wxT("" PATH_SEP "download" PATH_SEP) + bootloadername; | ||
278 | if( DownloadURL(src, dest) ) | ||
279 | { | ||
280 | wxRemoveFile(dest); | ||
281 | ERR_DIALOG(wxT("Unable to download ") + src, wxT("Install")); | ||
282 | return false; | ||
283 | } | ||
284 | |||
285 | |||
286 | if(!wxFileExists(path1)) | ||
287 | { | ||
288 | ERR_DIALOG(wxT("[ERR] Coud not find ")+path1, wxT("Bootloader add")); | ||
289 | return false; | ||
290 | } | ||
291 | path2 = path1; | ||
292 | path2.Append(wxT(".ORIG")); | ||
293 | if(!wxFileExists(path2)) | ||
294 | { | ||
295 | if(!wxRenameFile(path1,path2,false)) | ||
296 | { | ||
297 | ERR_DIALOG(wxT("[ERR] Coud not rename ") + path1 + wxT(" to ") | ||
298 | + path2, wxT("Bootloader add")); | ||
299 | return false; | ||
300 | } | ||
301 | } | ||
302 | |||
303 | |||
304 | if(!wxCopyFile(dest,path1)) | ||
305 | { | ||
306 | ERR_DIALOG(wxT("[ERR] Coud not copy ") + dest + wxT(" to ") | ||
307 | + path2, wxT("Bootloader add")); | ||
308 | return false; | ||
309 | } | ||
310 | } | ||
311 | else if(mode == BOOTLOADER_REM) | ||
312 | { | ||
313 | path2 = path1; | ||
314 | path2.Append(wxT(".ORIG")); | ||
315 | if(!wxFileExists(path2)) | ||
316 | { | ||
317 | ERR_DIALOG(wxT("[ERR] Coud not find ") + path1, | ||
318 | wxT("Bootloader del")); | ||
319 | return false; | ||
320 | } | ||
321 | if(!wxRenameFile(path2,path1,true)) | ||
322 | { | ||
323 | ERR_DIALOG(wxT("[ERR] Coud not rename ") + path1 + wxT(" to ") | ||
324 | + path2, wxT("Bootloader del")); | ||
325 | return false; | ||
326 | } | ||
327 | } | ||
328 | return true; | ||
329 | } | ||
330 | |||
331 | // iaudio bootloader install | ||
332 | bool iaudiox5(int mode,wxString bootloadername,wxString deviceDir) | ||
333 | { | ||
334 | wxString path1,path2; | ||
335 | wxString err; | ||
336 | wxString src,dest; | ||
337 | |||
338 | path1 = deviceDir + wxT("" PATH_SEP "FIRMWARE" PATH_SEP) | ||
339 | + bootloadername; | ||
340 | |||
341 | if(mode == BOOTLOADER_ADD) | ||
342 | { | ||
343 | //Files downloaden | ||
344 | src = gv->bootloader_url + wxT("/iaudio/") + bootloadername; | ||
345 | dest = gv->stdpaths->GetUserDataDir() | ||
346 | + wxT("" PATH_SEP "download" PATH_SEP) + bootloadername; | ||
347 | if( DownloadURL(src, dest) ) | ||
348 | { | ||
349 | wxRemoveFile(dest); | ||
350 | ERR_DIALOG(wxT("Unable to download ") + src, wxT("Install")); | ||
351 | return false; | ||
352 | } | ||
353 | |||
354 | // copy file | ||
355 | if(!wxCopyFile(dest,path1)) | ||
356 | { | ||
357 | ERR_DIALOG(wxT("[ERR] Coud not copy ")+dest+wxT(" to ")+path2, | ||
358 | wxT("Bootloader add")); | ||
359 | return false; | ||
360 | } | ||
361 | |||
362 | return true; // install ready | ||
363 | } | ||
364 | else | ||
365 | return false; //no uninstallation possible | ||
366 | } | ||
367 | |||
368 | // H10 install | ||
369 | bool h10(int mode,wxString bootloadername,wxString deviceDir) | ||
370 | { | ||
371 | wxString err,src,dest,path1,path2; | ||
372 | |||
373 | int pos = bootloadername.Find('/'); | ||
374 | if(pos == wxNOT_FOUND) pos = 0; | ||
375 | wxString firmwarename = bootloadername.SubString(pos,bootloadername.Length()); | ||
376 | //wxString firmDir = gv->curbootloader.SubString(0,pos); | ||
377 | |||
378 | if(mode == BOOTLOADER_ADD) | ||
379 | { | ||
380 | //Files downloaden | ||
381 | src = gv->bootloader_url + wxT("/iriver/") + bootloadername; | ||
382 | dest = gv->stdpaths->GetUserDataDir() | ||
383 | + wxT("" PATH_SEP "download" PATH_SEP) + firmwarename; | ||
384 | if( DownloadURL(src, dest) ) | ||
385 | { | ||
386 | wxRemoveFile(dest); | ||
387 | ERR_DIALOG(wxT("Unable to download ") + src, wxT("Install")); | ||
388 | return false; | ||
389 | } | ||
390 | |||
391 | path1 = deviceDir + wxT("SYSTEM" PATH_SEP) + firmwarename; | ||
392 | path2 = deviceDir + wxT("SYSTEM" PATH_SEP "Original.mi4"); | ||
393 | |||
394 | if(!wxFileExists(path1)) //Firmware dosent exists on player | ||
395 | { | ||
396 | path1 = deviceDir + wxT("SYSTEM" PATH_SEP "H10EMP.mi4"); //attempt other firmwarename | ||
397 | if(!wxFileExists(path1)) //Firmware dosent exists on player | ||
398 | { | ||
399 | ERR_DIALOG(wxT("[ERR] File ") + path1 + wxT(" does not Exist"), | ||
400 | wxT("Bootloader add")); | ||
401 | return false; | ||
402 | } | ||
403 | } | ||
404 | if(!wxFileExists(path2)) //there is already a original firmware | ||
405 | { | ||
406 | if(!wxRenameFile(path1,path2,false)) //rename Firmware to Original | ||
407 | { | ||
408 | ERR_DIALOG(wxT("[ERR] Coud not rename ") + path1 + wxT(" to ") | ||
409 | + path2, wxT("Bootloader add")); | ||
410 | return false; | ||
411 | } | ||
412 | } | ||
413 | |||
414 | if(!wxCopyFile(dest,path1)) // copy file | ||
415 | { | ||
416 | ERR_DIALOG(wxT("[ERR] Coud not copy ") + dest + wxT(" to ") + path1, | ||
417 | wxT("Bootloader add")); | ||
418 | return false; | ||
419 | } | ||
420 | |||
421 | return true; //install ready | ||
422 | |||
423 | } | ||
424 | else if(mode == BOOTLOADER_REM) | ||
425 | { | ||
426 | path1 = deviceDir + wxT("SYSTEM" PATH_SEP) + firmwarename; | ||
427 | path2 = gv->curdestdir + wxT("SYSTEM" PATH_SEP "Original.mi4"); | ||
428 | if(!wxFileExists(path1)) //Firmware dosent exists on player | ||
429 | { | ||
430 | path1 = deviceDir + wxT("" PATH_SEP "SYSTEM" PATH_SEP "H10EMP.mi4"); //attempt other firmwarename | ||
431 | if(!wxFileExists(path1)) //Firmware dosent exists on player | ||
432 | { | ||
433 | ERR_DIALOG(wxT("[ERR] File ") + path1 + wxT(" does not Exist"), | ||
434 | wxT("Bootloader rem")); | ||
435 | return false; | ||
436 | } | ||
437 | } | ||
438 | |||
439 | if(!wxFileExists(path2)) //Original Firmware dosent exists on player | ||
440 | { | ||
441 | ERR_DIALOG(wxT("[ERR] File ") + path2 + wxT(" does not Exist"), | ||
442 | wxT("Bootloader rem")); | ||
443 | return false; | ||
444 | } | ||
445 | |||
446 | if(!wxRenameFile(path2,path1,true)) //rename Firmware to Original | ||
447 | { | ||
448 | ERR_DIALOG(wxT("[ERR] Coud not rename ") + path2 + wxT(" to ") | ||
449 | + path1, wxT("Bootloader add")); | ||
450 | return false; | ||
451 | } | ||
452 | |||
453 | } | ||
454 | // shouldn't get here | ||
455 | return false; | ||
456 | } | ||
457 | |||
458 | // FWPatcher | ||
459 | bool fwpatcher(int mode,wxString bootloadername,wxString deviceDir,wxString firmware) | ||
460 | { | ||
461 | if(mode == BOOTLOADER_ADD) | ||
462 | { | ||
463 | char md5sum_str[32]; | ||
464 | wxString src,dest,err; | ||
465 | int series,table_entry; | ||
466 | |||
467 | if (!FileMD5(firmware, md5sum_str)) { | ||
468 | ERR_DIALOG(wxT("Could not open firmware"), wxT("Open Firmware")); | ||
469 | return false; | ||
470 | } | ||
471 | else { | ||
472 | /* Check firmware against md5sums in h120sums and h100sums */ | ||
473 | series = 0; | ||
474 | table_entry = intable(md5sum_str, &h120pairs[0], | ||
475 | sizeof(h120pairs)/sizeof(struct sumpairs)); | ||
476 | if (table_entry >= 0) { | ||
477 | series = 120; | ||
478 | } | ||
479 | else { | ||
480 | table_entry = intable(md5sum_str, &h100pairs[0], | ||
481 | sizeof(h100pairs)/sizeof(struct sumpairs)); | ||
482 | if (table_entry >= 0) { | ||
483 | series = 100; | ||
484 | } | ||
485 | else { | ||
486 | table_entry = | ||
487 | intable(md5sum_str, &h300pairs[0], | ||
488 | sizeof(h300pairs)/sizeof(struct sumpairs)); | ||
489 | if (table_entry >= 0) | ||
490 | series = 300; | ||
491 | } | ||
492 | } | ||
493 | if (series == 0) { | ||
494 | ERR_DIALOG(wxT("Could not detect firmware type"), wxT("Detect Player out of Firmware")); | ||
495 | return false; | ||
496 | } | ||
497 | else | ||
498 | { | ||
499 | //Download bootloader | ||
500 | src = gv->bootloader_url + wxT("/iriver/") | ||
501 | + bootloadername; | ||
502 | dest = gv->stdpaths->GetUserDataDir() | ||
503 | + wxT("" PATH_SEP "download" PATH_SEP) | ||
504 | + bootloadername; | ||
505 | if( DownloadURL(src, dest) ) | ||
506 | { | ||
507 | wxRemoveFile(dest); | ||
508 | ERR_DIALOG(wxT("Unable to download ") + src, | ||
509 | wxT("Install")); | ||
510 | return false; | ||
511 | } | ||
512 | |||
513 | if(!PatchFirmware(firmware,dest,series, table_entry)) // Patch firmware | ||
514 | { | ||
515 | ERR_DIALOG(wxT("Patching Firmware failed"), | ||
516 | wxT("Patching Firmware")); | ||
517 | return false; | ||
518 | } | ||
519 | } | ||
520 | |||
521 | // Load patched Firmware to player | ||
522 | src = gv->stdpaths->GetUserDataDir() | ||
523 | + wxT("" PATH_SEP "download" PATH_SEP "new.hex"); | ||
524 | |||
525 | if(gv->curplat == wxT("h100")) | ||
526 | dest = deviceDir + wxT("" PATH_SEP "ihp_100.hex"); | ||
527 | else if(gv->curplat == wxT("h120")) | ||
528 | dest = deviceDir + wxT("" PATH_SEP "ihp_120.hex"); | ||
529 | else if(gv->curplat == wxT("h300")) | ||
530 | dest = deviceDir + wxT("" PATH_SEP "H300.hex"); | ||
531 | |||
532 | if(!wxRenameFile(src,dest)) | ||
533 | { | ||
534 | ERR_DIALOG(wxT("Copying Firmware to Device failed"), | ||
535 | wxT("Copying Firmware")); | ||
536 | return false; | ||
537 | } | ||
538 | else | ||
539 | { | ||
540 | return true; | ||
541 | } | ||
542 | } | ||
543 | |||
544 | } | ||
545 | else | ||
546 | { | ||
547 | return false; //no uninstall possible | ||
548 | } | ||
549 | } | ||