diff --git a/assets/js/game-client.js b/assets/js/game-client.js
index 048e2c7..e518709 100644
--- a/assets/js/game-client.js
+++ b/assets/js/game-client.js
@@ -61,7 +61,7 @@ function launchGame() {
object.setAttribute("height", "661");
var embed = document.createElement("embed");
- embed.setAttribute("type", "application/vnd.unity");
+ embed.setAttribute("type", "application/vnd.ffuwp");
embed.setAttribute(
"pluginspage",
"http://www.unity3d.com/unity-web-player-2.x"
diff --git a/build/OpenFusionClient.exe.manifest b/build/OpenFusionClient.exe.manifest
new file mode 100644
index 0000000..6c51b03
--- /dev/null
+++ b/build/OpenFusionClient.exe.manifest
@@ -0,0 +1,8 @@
+
+
+
+ UTF-8
+ true
+
+
+
diff --git a/build/utils/LICENSE.WEBPLAYER.md b/build/WebPlayer/LICENSE.WEBPLAYER.md
similarity index 100%
rename from build/utils/LICENSE.WEBPLAYER.md
rename to build/WebPlayer/LICENSE.WEBPLAYER.md
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/UnityWebPluginAX.ocx b/build/WebPlayer/loader/UnityWebPluginAX.ocx
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/UnityWebPluginAX.ocx
rename to build/WebPlayer/loader/UnityWebPluginAX.ocx
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/info.plist b/build/WebPlayer/loader/info.plist
similarity index 91%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/info.plist
rename to build/WebPlayer/loader/info.plist
index f4ef11f..3fb3dc5 100644
--- a/build/utils/WebPlayer/mono/fusion-2.x.x/info.plist
+++ b/build/WebPlayer/loader/info.plist
@@ -1,9 +1,9 @@
-
-
-
- CFBundleVersion
- 2.5.5b4
- UnityBuildNumber
- 50
-
+
+
+
+ CFBundleVersion
+ 2.5.5b4
+ UnityBuildNumber
+ 50
+
\ No newline at end of file
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/npUnity3D32.dll b/build/WebPlayer/loader/npUnity3D32_patchv2.dll
similarity index 99%
rename from build/utils/WebPlayer/player/fusion-2.x.x/npUnity3D32.dll
rename to build/WebPlayer/loader/npUnity3D32_patchv2.dll
index 5a5c0c9..91a4e96 100644
Binary files a/build/utils/WebPlayer/player/fusion-2.x.x/npUnity3D32.dll and b/build/WebPlayer/loader/npUnity3D32_patchv2.dll differ
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/Data/etc/mono/2.0/machine.config b/build/WebPlayer/mono/fusion-2.x.x/Data/etc/mono/2.0/machine.config
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/Data/etc/mono/2.0/machine.config
rename to build/WebPlayer/mono/fusion-2.x.x/Data/etc/mono/2.0/machine.config
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/Boo.Lang.dll b/build/WebPlayer/mono/fusion-2.x.x/Data/lib/Boo.Lang.dll
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/Boo.Lang.dll
rename to build/WebPlayer/mono/fusion-2.x.x/Data/lib/Boo.Lang.dll
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityDomainLoad.exe b/build/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityDomainLoad.exe
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityDomainLoad.exe
rename to build/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityDomainLoad.exe
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityEngine.dll b/build/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityEngine.dll
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityEngine.dll
rename to build/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityEngine.dll
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityScript.Lang.dll b/build/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityScript.Lang.dll
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityScript.Lang.dll
rename to build/WebPlayer/mono/fusion-2.x.x/Data/lib/UnityScript.Lang.dll
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/mscorlib.dll b/build/WebPlayer/mono/fusion-2.x.x/Data/lib/mscorlib.dll
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/Data/lib/mscorlib.dll
rename to build/WebPlayer/mono/fusion-2.x.x/Data/lib/mscorlib.dll
diff --git a/build/utils/WebPlayer/loader/info.plist b/build/WebPlayer/mono/fusion-2.x.x/info.plist
similarity index 61%
rename from build/utils/WebPlayer/loader/info.plist
rename to build/WebPlayer/mono/fusion-2.x.x/info.plist
index 0c579b7..3fb3dc5 100644
--- a/build/utils/WebPlayer/loader/info.plist
+++ b/build/WebPlayer/mono/fusion-2.x.x/info.plist
@@ -1,9 +1,9 @@
-
-
-
- CFBundleVersion
- 3.5.2f2
- UnityBuildNumber
- 4c6ee796dacc
-
+
+
+
+ CFBundleVersion
+ 2.5.5b4
+ UnityBuildNumber
+ 50
+
\ No newline at end of file
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/mono-1-vc.dll b/build/WebPlayer/mono/fusion-2.x.x/mono-1-vc.dll
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/mono-1-vc.dll
rename to build/WebPlayer/mono/fusion-2.x.x/mono-1-vc.dll
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/Data/lib/Boo.Lang.dll b/build/WebPlayer/player/fusion-2.x.x/Data/lib/Boo.Lang.dll
similarity index 100%
rename from build/utils/WebPlayer/player/fusion-2.x.x/Data/lib/Boo.Lang.dll
rename to build/WebPlayer/player/fusion-2.x.x/Data/lib/Boo.Lang.dll
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/Data/lib/UnityEngine.dll b/build/WebPlayer/player/fusion-2.x.x/Data/lib/UnityEngine.dll
similarity index 100%
rename from build/utils/WebPlayer/player/fusion-2.x.x/Data/lib/UnityEngine.dll
rename to build/WebPlayer/player/fusion-2.x.x/Data/lib/UnityEngine.dll
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/Data/lib/UnityScript.Lang.dll b/build/WebPlayer/player/fusion-2.x.x/Data/lib/UnityScript.Lang.dll
similarity index 100%
rename from build/utils/WebPlayer/player/fusion-2.x.x/Data/lib/UnityScript.Lang.dll
rename to build/WebPlayer/player/fusion-2.x.x/Data/lib/UnityScript.Lang.dll
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/Data/unity default resources b/build/WebPlayer/player/fusion-2.x.x/Data/unity default resources
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/Data/unity default resources
rename to build/WebPlayer/player/fusion-2.x.x/Data/unity default resources
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/info.plist b/build/WebPlayer/player/fusion-2.x.x/info.plist
similarity index 93%
rename from build/utils/WebPlayer/player/fusion-2.x.x/info.plist
rename to build/WebPlayer/player/fusion-2.x.x/info.plist
index 3c32860..6cf5fae 100644
--- a/build/utils/WebPlayer/player/fusion-2.x.x/info.plist
+++ b/build/WebPlayer/player/fusion-2.x.x/info.plist
@@ -1,13 +1,13 @@
-
-
-
- CFBundleVersion
- 2.5.5b4
- UnityBuildNumber
- 50
- monoVersion
- fusion-2.x.x
- monoMinimumRevision
- 2.0.0f6
-
+
+
+
+ CFBundleVersion
+ 2.5.5b4
+ UnityBuildNumber
+ 50
+ monoVersion
+ fusion-2.x.x
+ monoMinimumRevision
+ 2.0.0f6
+
\ No newline at end of file
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/webplayer_win.dll b/build/WebPlayer/player/fusion-2.x.x/webplayer_win.dll
similarity index 100%
rename from build/utils/WebPlayer/player/fusion-2.x.x/webplayer_win.dll
rename to build/WebPlayer/player/fusion-2.x.x/webplayer_win.dll
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/wrap_oal.dll b/build/WebPlayer/player/fusion-2.x.x/wrap_oal.dll
similarity index 100%
rename from build/utils/WebPlayer/mono/fusion-2.x.x/wrap_oal.dll
rename to build/WebPlayer/player/fusion-2.x.x/wrap_oal.dll
diff --git a/build/utils/UnityWebPlayer.exe b/build/utils/UnityWebPlayer.exe
deleted file mode 100644
index dbeb6fe..0000000
Binary files a/build/utils/UnityWebPlayer.exe and /dev/null differ
diff --git a/build/utils/WebPlayer/UnityWebPlayerUpdate.exe b/build/utils/WebPlayer/UnityWebPlayerUpdate.exe
deleted file mode 100644
index 59b50b3..0000000
Binary files a/build/utils/WebPlayer/UnityWebPlayerUpdate.exe and /dev/null differ
diff --git a/build/utils/WebPlayer/loader/UnityWebPluginAX.ocx b/build/utils/WebPlayer/loader/UnityWebPluginAX.ocx
deleted file mode 100644
index 16d2c32..0000000
Binary files a/build/utils/WebPlayer/loader/UnityWebPluginAX.ocx and /dev/null differ
diff --git a/build/utils/WebPlayer/loader/_UnityWebPluginAX.ocx b/build/utils/WebPlayer/loader/_UnityWebPluginAX.ocx
deleted file mode 100644
index 16d2c32..0000000
Binary files a/build/utils/WebPlayer/loader/_UnityWebPluginAX.ocx and /dev/null differ
diff --git a/build/utils/WebPlayer/loader/npUnity3D32.dll b/build/utils/WebPlayer/loader/npUnity3D32.dll
deleted file mode 100644
index e910ef8..0000000
Binary files a/build/utils/WebPlayer/loader/npUnity3D32.dll and /dev/null differ
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/UnityWebPlayerUpdate.exe b/build/utils/WebPlayer/mono/fusion-2.x.x/UnityWebPlayerUpdate.exe
deleted file mode 100644
index ca02553..0000000
Binary files a/build/utils/WebPlayer/mono/fusion-2.x.x/UnityWebPlayerUpdate.exe and /dev/null differ
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/npUnity3D32.dll b/build/utils/WebPlayer/mono/fusion-2.x.x/npUnity3D32.dll
deleted file mode 100644
index 5a5c0c9..0000000
Binary files a/build/utils/WebPlayer/mono/fusion-2.x.x/npUnity3D32.dll and /dev/null differ
diff --git a/build/utils/WebPlayer/mono/fusion-2.x.x/webplayer_win.dll b/build/utils/WebPlayer/mono/fusion-2.x.x/webplayer_win.dll
deleted file mode 100644
index b66a1c3..0000000
Binary files a/build/utils/WebPlayer/mono/fusion-2.x.x/webplayer_win.dll and /dev/null differ
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/Data/unity default resources b/build/utils/WebPlayer/player/fusion-2.x.x/Data/unity default resources
deleted file mode 100644
index 637a77f..0000000
Binary files a/build/utils/WebPlayer/player/fusion-2.x.x/Data/unity default resources and /dev/null differ
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/UnityWebPlayerUpdate.exe b/build/utils/WebPlayer/player/fusion-2.x.x/UnityWebPlayerUpdate.exe
deleted file mode 100644
index ca02553..0000000
Binary files a/build/utils/WebPlayer/player/fusion-2.x.x/UnityWebPlayerUpdate.exe and /dev/null differ
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/UnityWebPluginAX.ocx b/build/utils/WebPlayer/player/fusion-2.x.x/UnityWebPluginAX.ocx
deleted file mode 100644
index bd980e6..0000000
Binary files a/build/utils/WebPlayer/player/fusion-2.x.x/UnityWebPluginAX.ocx and /dev/null differ
diff --git a/build/utils/WebPlayer/player/fusion-2.x.x/wrap_oal.dll b/build/utils/WebPlayer/player/fusion-2.x.x/wrap_oal.dll
deleted file mode 100644
index 838e91e..0000000
Binary files a/build/utils/WebPlayer/player/fusion-2.x.x/wrap_oal.dll and /dev/null differ
diff --git a/index.html b/index.html
index 659050b..ece80d9 100644
--- a/index.html
+++ b/index.html
@@ -2,6 +2,10 @@
+
OpenFusion: Server Selector
diff --git a/index.js b/index.js
index 23e05fa..d52d7e5 100644
--- a/index.js
+++ b/index.js
@@ -6,60 +6,18 @@ var dialog = require("dialog");
var BrowserWindow = require("browser-window");
var mainWindow = null;
-
app.commandLine.appendSwitch("enable-npapi");
+app.commandLine.appendSwitch("no-proxy-server");
-function verifyMD5Hash(file, hash) {
- if (fs.existsSync(file)) {
- var buffer = fs.readFileSync(file);
- var computedHash = require("crypto")
- .createHash("md5")
- .update(buffer)
- .digest("hex");
- if (hash == computedHash) {
- return true;
- }
- }
- return false;
+var userData = app.getPath("userData");
+var unityHomeDir = __dirname + "\\..\\..\\WebPlayer";
+// if running in non-packaged / development mode, this dir will be slightly different
+if (process.env.npm_node_execpath) {
+ unityHomeDir = app.getAppPath() + "\\build\\WebPlayer";
}
-function verifyUnity() {
- var loaderPath =
- app.getPath("appData") +
- "\\..\\LocalLow\\Unity\\WebPlayer\\loader\\npUnity3D32.dll";
- var playerPath =
- app.getPath("appData") +
- "\\..\\LocalLow\\Unity\\WebPlayer\\player\\fusion-2.x.x\\webplayer_win.dll";
-
- return (
- verifyMD5Hash(loaderPath, "dbbac62d8379d2d870479b04b8157b99") &&
- verifyMD5Hash(playerPath, "e5028405b4483de9e5e5fe9cd5f1e98f")
- );
-}
-
-function installUnity(callback) {
- var utilsDir = __dirname + "\\..\\..\\utils";
-
- // if running in non-packaged / development mode, this dir will be slightly different
- if (process.env.npm_node_execpath) {
- utilsDir = app.getAppPath() + "\\build\\utils";
- }
-
- // run the installer silently
- var child = require("child_process").spawn(
- utilsDir + "\\UnityWebPlayer.exe",
- ["/quiet", "/S"]
- );
- child.on("exit", function () {
- // overwrite 3.5.2 loader/player with FF's custom version
- var dest = app.getPath("appData") + "\\..\\LocalLow\\Unity\\WebPlayer";
- fs.copySync(utilsDir + "\\WebPlayer", dest, { clobber: true });
- // avoids error reporter popping up when closing Electron
- fs.removeSync(dest + "\\UnityBugReporter.exe");
- console.log("Unity Web Player installed successfully.");
- callback();
- });
-}
+process.env["UNITY_HOME_DIR"] = unityHomeDir;
+process.env["UNITY_DISABLE_PLUGIN_UPDATES"] = "yes";
function initialSetup(firstTime) {
// Display a small window to inform the user that the app is working
@@ -70,46 +28,41 @@ function initialSetup(firstTime) {
center: true,
frame: false,
});
- setupWindow.loadUrl("file://" + __dirname + "/initial-setup.html");
- installUnity(function () {
- if (!firstTime) {
- // migration from pre-1.4
- // Back everything up, just in case
- fs.copySync(
- app.getPath("userData") + "\\config.json",
- app.getPath("userData") + "\\config.json.bak"
- );
- fs.copySync(
- app.getPath("userData") + "\\servers.json",
- app.getPath("userData") + "\\servers.json.bak"
- );
- fs.copySync(
- app.getPath("userData") + "\\versions.json",
- app.getPath("userData") + "\\versions.json.bak"
- );
- } else {
- // first-time setup
- // Copy default servers
- fs.copySync(
- __dirname + "\\defaults\\servers.json",
- app.getPath("userData") + "\\servers.json"
- );
- }
-
- // Copy default versions and config
+ if (!firstTime) {
+ // migration from pre-1.4
+ // Back everything up, just in case
+ setupWindow.loadUrl("file://" + __dirname + "/initial-setup.html");
+ fs.copySync(userData + "\\config.json", userData + "\\config.json.bak");
fs.copySync(
- __dirname + "\\defaults\\versions.json",
- app.getPath("userData") + "\\versions.json"
+ userData + "\\servers.json",
+ userData + "\\servers.json.bak"
);
fs.copySync(
- __dirname + "\\defaults\\config.json",
- app.getPath("userData") + "\\config.json"
+ userData + "\\versions.json",
+ userData + "\\versions.json.bak"
);
+ } else {
+ // first-time setup
+ // Copy default servers
+ fs.copySync(
+ __dirname + "\\defaults\\servers.json",
+ userData + "\\servers.json"
+ );
+ }
- console.log("JSON files copied.");
- setupWindow.destroy();
- showMainWindow();
- });
+ // Copy default versions and config
+ fs.copySync(
+ __dirname + "\\defaults\\versions.json",
+ userData + "\\versions.json"
+ );
+ fs.copySync(
+ __dirname + "\\defaults\\config.json",
+ userData + "\\config.json"
+ );
+
+ console.log("JSON files copied.");
+ setupWindow.destroy();
+ showMainWindow();
}
ipc.on("exit", function (id) {
@@ -131,18 +84,20 @@ app.on("ready", function () {
dialog.showErrorBox("Error!", errorMessage);
return;
}
-
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1280,
height: 720,
show: false,
- "web-preferences": { plugins: true },
+ "web-preferences": {
+ plugins: true,
+ "extra-plugin-dirs": [unityHomeDir + "\\loader"],
+ },
});
mainWindow.setMinimumSize(640, 480);
// Check for first run
- var configPath = app.getPath("userData") + "\\config.json";
+ var configPath = userData + "\\config.json";
try {
if (!fs.existsSync(configPath)) {
console.log("Config file not found. Running initial setup.");
@@ -153,11 +108,7 @@ app.on("ready", function () {
console.log("Pre-1.4 config detected. Running migration.");
initialSetup(false);
} else {
- if (verifyUnity()) {
- showMainWindow();
- } else {
- installUnity(showMainWindow);
- }
+ showMainWindow();
}
}
} catch (ex) {
diff --git a/package.json b/package.json
index 4bcd8ff..fe33e74 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "OpenFusionClient",
- "version": "1.4.1",
+ "version": "1.4.2",
"description": "OpenFusionClient",
"main": "index.js",
"scripts": {
@@ -63,8 +63,12 @@
"extraFiles": [
"LICENSE.md",
{
- "from": "build/utils",
- "to": "utils"
+ "from": "build/OpenFusionClient.exe.manifest",
+ "to": "OpenFusionClient.exe.manifest"
+ },
+ {
+ "from": "build/WebPlayer",
+ "to": "WebPlayer"
}
],
"afterPack": "./build/after-pack.js"