diff --git a/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/Setup.java b/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/Setup.java index 824f1ae2..e1af3e92 100644 --- a/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/Setup.java +++ b/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/Setup.java @@ -15,6 +15,7 @@ public class Setup { new FilePermissionsInitializer(), new Mysql57Initializer(), new NixBefore57Initializer(), + new NixBefore8Initializer(), new Mysql8Initializer()); diff --git a/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/fileset/Win8FileSetEmitter.java b/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/fileset/Win8FileSetEmitter.java index 829b43cd..1465e637 100644 --- a/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/fileset/Win8FileSetEmitter.java +++ b/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/fileset/Win8FileSetEmitter.java @@ -22,6 +22,8 @@ public FileSet emit() { .addEntry(Library, "bin/mysql.exe") .addEntry(Library, "bin/mysqladmin.exe") .addEntry(Library, "share/english/errmsg.sys") + .addEntry(Library, "bin/libeay32.dll") + .addEntry(Library, "bin/ssleay32.dll") // .addEntry(Library, "share/fill_help_tables.sql") // .addEntry(Library, "share/mysql_sys_schema.sql") // .addEntry(Library, "share/mysql_system_tables.sql") diff --git a/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/setup/NixBefore8Initializer.java b/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/setup/NixBefore8Initializer.java new file mode 100644 index 00000000..09fd2e5b --- /dev/null +++ b/wix-embedded-mysql/src/main/java/com/wix/mysql/distribution/setup/NixBefore8Initializer.java @@ -0,0 +1,40 @@ +package com.wix.mysql.distribution.setup; + +import com.wix.mysql.config.MysqldConfig; +import com.wix.mysql.distribution.Version; +import de.flapdoodle.embed.process.config.IRuntimeConfig; +import de.flapdoodle.embed.process.distribution.Platform; +import de.flapdoodle.embed.process.extract.IExtractedFileSet; +import org.apache.commons.io.filefilter.RegexFileFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class NixBefore8Initializer implements Initializer { + + private final static Logger logger = LoggerFactory.getLogger(NixBefore8Initializer.class); + private static final String SEP = File.separator; + + @Override + public boolean matches(Version version) { + return Platform.detect().isUnixLike() && + version.getMajorVersion().equals("8.0"); + } + + @Override + public void apply(IExtractedFileSet files, IRuntimeConfig runtimeConfig, MysqldConfig config) throws IOException { + File baseDir = files.baseDir(); + File libDir = new File(baseDir + SEP + "lib"); + FileFilter filter = new RegexFileFilter("^[a-z]+\\.so(\\.[0-9]+)+"); + File[] soFiles = libDir.listFiles(filter); + for (File file : soFiles) { + Files.createSymbolicLink(Paths.get(baseDir + SEP + "bin" + SEP + file.getName()), Paths.get(file.getPath())); + logger.debug("Symlink " + file.getName()); + } + } +}