sub cleanup {
   $main::lxdebug->enter_sub();
 
-  my $self = shift;
+  my ($self, $application) = @_;
+
+  my $error_code = $?;
 
   chdir("$self->{tmpdir}");
 
   my @err = ();
-  if (-f "$self->{tmpfile}.err") {
+  if ((-1 == $error_code) || (127 == (($error_code) >> 8))) {
+    push @err, $::locale->text('The application "#1" was not found on the system.', $application || 'pdflatex') . ' ' . $::locale->text('Please contact your administrator.');
+
+  } elsif (-f "$self->{tmpfile}.err") {
     open(FH, "$self->{tmpfile}.err");
     @err = <FH>;
     close(FH);
 
            "> $form->{tmpfile}.err");
     if ($?) {
       $ENV{HOME} = $old_home;
-      $self->{"error"} = $form->cleanup();
-      $self->cleanup();
+      $self->{"error"} = $form->cleanup($latex);
       return 0;
     }
   }
 
   if ($?) {
     $self->{"error"} = "dvips : $!";
-    $self->cleanup();
+    $self->cleanup('dvips');
     return 0;
   }
   $form->{tmpfile} =~ s/dvi$/ps/;
     system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
            "> $form->{tmpfile}.err");
     if ($?) {
-      $ENV{HOME} = $old_home;
-      $self->{"error"} = $form->cleanup();
-      $self->cleanup();
+      $ENV{HOME}     = $old_home;
+      $self->{error} = $form->cleanup($latex);
       return 0;
     }
   }
 
   'Add Group'                   => 'Warengruppe erfassen',
   'Add Language'                => 'Sprache hinzufügen',
   'Add Lead'                    => 'Kundenquelle erfassen',
-  'Add License'                 => 'Lizenz erfassen',
   'Add Part'                    => 'Ware erfassen',
   'Add Payment Terms'           => 'Zahlungskonditionen hinzufügen',
   'Add Price Factor'            => 'Preisfaktor erfassen',
   'Leave host and port field empty unless you want to make a remote connection.' => 'Für lokale Verbindungen "Rechner" und "Port" freilassen.',
   'Left'                        => 'Links',
   'Liability'                   => 'Passiva/Mittelherkunft',
-  'Licenses'                    => 'Lizenzen',
   'Limit part selection'        => 'Artikelauswahl eingrenzen',
   'Line Total'                  => 'Zeilensumme',
   'Line and column'             => 'Zeile und Spalte',
   'Please Check the bank information for each customer:' => 'Bitte überprüfen Sie die Bankinformationen der Kunden:',
   'Please Check the bank information for each vendor:' => 'Bitte überprüfen Sie die Kontoinformationen der Lieferanten:',
   'Please ask your administrator to create warehouses and bins.' => 'Bitten Sie Ihren Administrator, dass er Lager und Lagerplätze anlegt.',
+  'Please contact your administrator.' => 'Bitte wenden Sie sich an Ihren Administrator.',
   'Please enter a profile name.' => 'Bitte geben Sie einen Profilnamen an.',
   'Please enter the login for the new user.' => 'Bitte geben Sie das Login für den neuen Benutzer ein.',
   'Please enter the name of the database that will be used as the template for the new database:' => 'Bitte geben Sie den Namen der Datenbank an, die als Vorlage für die neue Datenbank benutzt wird:',
   'The access rights have been saved.' => 'Die Zugriffsrechte wurden gespeichert.',
   'The account 3804 already exists, the update will be skipped.' => 'Das Konto 3804 existiert schon, das Update wird übersprungen.',
   'The account 3804 will not be added automatically.' => 'Das Konto 3804 wird nicht automatisch hinzugefügt.',
+  'The application "#1" was not found on the system.' => 'Die Anwendung "#1" wurde auf dem System nicht gefunden.',
   'The assembly has been created.' => 'Das Erzeugnis wurde hergestellt.',
   'The assistant could not find anything wrong with #1. Maybe the problem has been solved in the meantime.' => 'Der Korrekturassistent konnte kein Problem bei #1 feststellen. Eventuell wurde das Problem in der Zwischenzeit bereits behoben.',
   'The authentication configuration file "config/lx_office.conf" does not exist. This Lx-Office installation has probably not been updated correctly yet. Please contact your administrator.' => 'Die Konfigurationsdatei für die Authentifizierung "config/lx_office.conf" wurde nicht gefunden. Diese Lx-Office-Installation wurde vermutlich noch nicht vollständig aktualisiert oder eingerichtet. Bitte wenden Sie sich an Ihren Administrator.',