Fix Latex not working on Windows

kpsewhich could not be found because GTK on windows needs to use the
`gspawn-win32-helper` program to spawn processes.

This commit also improves kpsewhich error reporting.
presentation
Bryan Tan 6 years ago committed by Bryan Tan
parent d3e6bbe758
commit 99766c1a03
  1. 10
      src/Xournalpp.cpp
  2. 4
      src/control/LatexController.cpp
  3. 4
      windows-setup/build-setup.sh

@ -16,7 +16,17 @@
#include "CrashHandler.h"
#include "Stacktrace.h"
#ifdef _WIN32
#include <windows.h>
#endif
auto main(int argc, char* argv[]) -> int {
#ifdef _WIN32
// Show and hide the console here. Otherwise, gspawn-win32-helper will create annoying console popups.
AllocConsole();
ShowWindow(GetConsoleWindow(), SW_HIDE);
#endif
// init crash handler
installCrashHandlers();

@ -80,8 +80,10 @@ auto LatexController::findTexDependencies() -> LatexController::FindDependencySt
g_spawn_sync(nullptr, kpsewhichArgs, nullptr, kpsewhichFlags, nullptr, nullptr, nullptr, nullptr, &kpsewhichStatus,
&kpsewhichErr);
if (kpsewhichErr != nullptr) {
string msg =
FS(_F("Error: {1}\nCould not find kpsewhich in PATH; please install kpsewhich and put it on path.") %
kpsewhichErr->message);
g_error_free(kpsewhichErr);
string msg = _("Could not find kpsewhich in PATH; please install kpsewhich and put it on path.");
return LatexController::FindDependencyStatus(false, msg);
}
if (kpsewhichStatus != 0) {

@ -64,6 +64,10 @@ cp -r /mingw64/share/icons setup/share/
echo "copy glib shared"
cp -r /mingw64/share/glib-2.0 setup/share/
echo "copy gspawn-win64-helper"
cp /mingw64/bin/gspawn-win64-helper.exe setup/bin
cp /mingw64/bin/gspawn-win64-helper-console.exe setup/bin
echo "pack setup"
"/c/Program Files (x86)/NSIS/Bin/makensis.exe" xournalpp.nsi

Loading…
Cancel
Save