Skip to content

Commit

Permalink
Merge pull request #552 from andreasb242/windows-build
Browse files Browse the repository at this point in the history
Windows build
  • Loading branch information
andreasb242 committed Dec 16, 2018
2 parents e4cad1a + 4a7f990 commit 22075cc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/control/XournalMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,17 +408,29 @@ string XournalMain::findResourcePath(string searchFile)

// -----------------------------------------------------------------------

// Check if we are in the "build" directory, and therefore the resources
// are installed two folders back
// Check one folder back, for windows portable
path relative4 = executableDir;
relative4 /= "../..";
relative4 /= "..";
relative4 /= searchFile;

if (bf::exists(relative4))
{
return relative4.parent_path().normalize().string();
}

// -----------------------------------------------------------------------

// Check if we are in the "build" directory, and therefore the resources
// are installed two folders back
path relative5 = executableDir;
relative5 /= "../..";
relative5 /= searchFile;

if (bf::exists(relative5))
{
return relative5.parent_path().normalize().string();
}

// Not found
return "";
}
Expand Down
17 changes: 17 additions & 0 deletions windows-setup/build-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,31 @@
cd "${0%/*}"

# delete old setup, if there
echo "clean setup folder"

rm -rf ./setup
mkdir setup
mkdir setup/bin
mkdir setup/lib
mkdir setup/share

echo "copy binaries"

cp ../build/src/xournalpp.exe ./setup/bin
ldd ../build/src/xournalpp.exe | grep '\/mingw.*\.dll' -o | xargs -I{} cp "{}" setup/bin/

echo "copy ui"

cp -r ../ui setup/
cp -r ../po setup/ui/

echo "copy pixbuf libs"
cp -r /mingw64/lib/gdk-pixbuf-2.0 setup/lib

echo "copy pixbuf lib dependencies"
ldd /mingw64/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll | grep '\/mingw.*\.dll' -o | xargs -I{} cp "{}" setup/bin/

echo "copy icons"
cp -r /mingw64/share/icons setup/share/

echo "finished"

0 comments on commit 22075cc

Please sign in to comment.