|
@@ -106,7 +106,7 @@ discard block |
|
|
block discarded – undo |
|
106
|
106
|
|
|
107
|
107
|
$this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n"); |
|
108
|
108
|
ob_start(); |
|
109
|
|
- $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n"); |
|
|
109
|
+ $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n"); |
|
110
|
110
|
$source = $this->findSourceFile($source_name); |
|
111
|
111
|
|
|
112
|
112
|
if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable |
|
@@ -114,7 +114,7 @@ discard block |
|
|
block discarded – undo |
|
114
|
114
|
} |
|
115
|
115
|
$output = ob_get_clean(); |
|
116
|
116
|
if ($encoding != "NONE") { |
|
117
|
|
- $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output); |
|
|
117
|
+ $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output); |
|
118
|
118
|
if ($outputClean) { |
|
119
|
119
|
$output = $outputClean; |
|
120
|
120
|
} |
|
@@ -158,7 +158,7 @@ discard block |
|
|
block discarded – undo |
|
158
|
158
|
$encoding = "NONE"; |
|
159
|
159
|
} |
|
160
|
160
|
if ($encoding != "NONE") { |
|
161
|
|
- $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string); |
|
|
161
|
+ $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string); |
|
162
|
162
|
} else { |
|
163
|
163
|
$output_c = $source_string; |
|
164
|
164
|
} |
|
@@ -235,7 +235,7 @@ discard block |
|
|
block discarded – undo |
|
235
|
235
|
if (isset(WindowsCommon::LANGS[$this->languageInstance->getLang()])) { |
|
236
|
236
|
$language = WindowsCommon::LANGS[$this->languageInstance->getLang()]; |
|
237
|
237
|
$this->lang = $language['nsis']; |
|
238
|
|
- $this->codePage = 'cp' . $language['cp']; |
|
|
238
|
+ $this->codePage = 'cp'.$language['cp']; |
|
239
|
239
|
} else { |
|
240
|
240
|
$this->lang = 'English'; |
|
241
|
241
|
$this->codePage = 'cp1252'; |
|
@@ -257,8 +257,8 @@ discard block |
|
|
block discarded – undo |
|
257
|
257
|
$out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']); |
|
258
|
258
|
$out .= "<p>"; |
|
259
|
259
|
if ($ssidCount > $configCount) { |
|
260
|
|
- $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " "; |
|
261
|
|
- $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>'; |
|
|
260
|
+ $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." "; |
|
|
261
|
+ $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>'; |
|
262
|
262
|
$out .= "<p>"; |
|
263
|
263
|
} |
|
264
|
264
|
// TODO - change this below |
|
@@ -274,8 +274,8 @@ discard block |
|
|
block discarded – undo |
|
274
|
274
|
$out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range."); |
|
275
|
275
|
if ($ssidCount > 1) { |
|
276
|
276
|
$out .= "<p>"; |
|
277
|
|
- $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " "; |
|
278
|
|
- $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>'; |
|
|
277
|
+ $out .= _("You will be required to enter the same credentials for each of the configured networks:")." "; |
|
|
278
|
+ $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>'; |
|
279
|
279
|
} |
|
280
|
280
|
} |
|
281
|
281
|
return $out; |
|
@@ -380,13 +380,13 @@ discard block |
|
|
block discarded – undo |
|
380
|
380
|
*/ |
|
381
|
381
|
protected function signInstaller() |
|
382
|
382
|
{ |
|
383
|
|
- $fileName = $this->installerBasename . '.exe'; |
|
|
383
|
+ $fileName = $this->installerBasename.'.exe'; |
|
384
|
384
|
if (!$this->sign) { |
|
385
|
385
|
rename("installer.exe", $fileName); |
|
386
|
386
|
return $fileName; |
|
387
|
387
|
} |
|
388
|
388
|
// are actually signing |
|
389
|
|
- $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null"); |
|
|
389
|
+ $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null"); |
|
390
|
390
|
if ($outputFromSigning === FALSE) { |
|
391
|
391
|
$this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n"); |
|
392
|
392
|
} |
|
@@ -400,15 +400,15 @@ discard block |
|
|
block discarded – undo |
|
400
|
400
|
*/ |
|
401
|
401
|
protected function compileNSIS() { |
|
402
|
402
|
if (\config\ConfAssistant::NSIS_VERSION >= 3) { |
|
403
|
|
- $makensis = \config\ConfAssistant::PATHS['makensis'] . " -INPUTCHARSET UTF8"; |
|
|
403
|
+ $makensis = \config\ConfAssistant::PATHS['makensis']." -INPUTCHARSET UTF8"; |
|
404
|
404
|
} else { |
|
405
|
405
|
$makensis = \config\ConfAssistant::PATHS['makensis']; |
|
406
|
406
|
} |
|
407
|
407
|
$lcAll = getenv("LC_ALL"); |
|
408
|
408
|
putenv("LC_ALL=en_US.UTF-8"); |
|
409
|
|
- $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1'; |
|
|
409
|
+ $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1'; |
|
410
|
410
|
system($command); |
|
411
|
|
- putenv("LC_ALL=" . $lcAll); |
|
|
411
|
+ putenv("LC_ALL=".$lcAll); |
|
412
|
412
|
$this->loggerInstance->debug(4, "compileNSIS:$command\n"); |
|
413
|
413
|
} |
|
414
|
414
|
|
|
@@ -425,10 +425,10 @@ discard block |
|
|
block discarded – undo |
|
425
|
425
|
'email' => 'SUPPORT', |
|
426
|
426
|
'url' => 'URL', |
|
427
|
427
|
]; |
|
428
|
|
- $s = "support_" . $type . "_substitute"; |
|
|
428
|
+ $s = "support_".$type."_substitute"; |
|
429
|
429
|
$substitute = $this->translateString($this->$s, $this->codePage); |
|
430
|
|
- $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' . $type][0] : $substitute; |
|
431
|
|
- return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n"; |
|
|
430
|
+ $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute; |
|
|
431
|
+ return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n"; |
|
432
|
432
|
} |
|
433
|
433
|
|
|
434
|
434
|
/** |
|
@@ -438,20 +438,20 @@ discard block |
|
|
block discarded – undo |
|
438
|
438
|
* @return string |
|
439
|
439
|
*/ |
|
440
|
440
|
protected function writeNsisDefines($attr) { |
|
441
|
|
- $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . \config\ConfAssistant::NSIS_VERSION; |
|
|
441
|
+ $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.\config\ConfAssistant::NSIS_VERSION; |
|
442
|
442
|
if ($attr['internal:profile_count'][0] > 1) { |
|
443
|
|
- $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '" |
|
|
443
|
+ $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'" |
|
444
|
444
|
'; |
|
445
|
445
|
} |
|
446
|
|
- $fcontents .= ' |
|
447
|
|
-Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
448
|
|
-!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
449
|
|
-!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '" |
|
|
446
|
+ $fcontents .= ' |
|
|
447
|
+Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
|
448
|
+!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
|
449
|
+!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'" |
|
450
|
450
|
!define INSTALLER_NAME "installer.exe" |
|
451
|
|
-!define LANG "' . $this->lang . '" |
|
452
|
|
-!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']) . '" |
|
|
451
|
+!define LANG "' . $this->lang.'" |
|
|
452
|
+!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']).'" |
|
453
|
453
|
;-------------------------------- |
|
454
|
|
-!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
|
|
454
|
+!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'" |
|
455
|
455
|
'; |
|
456
|
456
|
$fcontents .= $this->getSupport($attr, 'email'); |
|
457
|
457
|
$fcontents .= $this->getSupport($attr, 'url'); |
|
@@ -459,18 +459,18 @@ discard block |
|
|
block discarded – undo |
|
459
|
459
|
$fcontents .= '!define WIRED |
|
460
|
460
|
'; |
|
461
|
461
|
} |
|
462
|
|
- $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '" |
|
|
462
|
+ $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'" |
|
463
|
463
|
'; |
|
464
|
464
|
if (!empty($attr['internal:realm'][0])) { |
|
465
|
|
- $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '" |
|
|
465
|
+ $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'" |
|
466
|
466
|
'; |
|
467
|
467
|
} |
|
468
|
468
|
if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
|
469
|
|
- $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '" |
|
|
469
|
+ $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'" |
|
470
|
470
|
'; |
|
471
|
471
|
} |
|
472
|
472
|
if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
|
473
|
|
- $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '" |
|
|
473
|
+ $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'" |
|
474
|
474
|
'; |
|
475
|
475
|
} |
|
476
|
476
|
$fcontents .= $this->msInfoFile($attr); |
|
@@ -491,7 +491,7 @@ discard block |
|
|
block discarded – undo |
|
491
|
491
|
$out .= '!define EXTERNAL_INFO "'; |
|
492
|
492
|
// $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n"); |
|
493
|
493
|
if ($attr['internal:info_file'][0]['mime'] == 'rtf') { |
|
494
|
|
- $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name']; |
|
|
494
|
+ $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name']; |
|
495
|
495
|
} elseif ($attr['internal:info_file'][0]['mime'] == 'txt') { |
|
496
|
496
|
$infoFile = file_get_contents($attr['internal:info_file'][0]['name']); |
|
497
|
497
|
if ($infoFile === FALSE) { |
|
@@ -500,14 +500,14 @@ discard block |
|
|
block discarded – undo |
|
500
|
500
|
if (\config\ConfAssistant::NSIS_VERSION >= 3) { |
|
501
|
501
|
$infoFileConverted = $infoFile; |
|
502
|
502
|
} else { |
|
503
|
|
- $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile); |
|
|
503
|
+ $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile); |
|
504
|
504
|
} |
|
505
|
505
|
if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) { |
|
506
|
506
|
file_put_contents('info_f.txt', $infoFileConverted); |
|
507
|
507
|
$out = '!define LICENSE_FILE " info_f.txt'; |
|
508
|
508
|
} |
|
509
|
509
|
} else { |
|
510
|
|
- $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name']; |
|
|
510
|
+ $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name']; |
|
511
|
511
|
} |
|
512
|
512
|
|
|
513
|
513
|
$out .= "\"\n"; |