Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Assets/Editor/BuildScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ public static void BuildWindows64Development()
Build(BuildTarget.StandaloneWindows64, true);
}

public static void BuildOSX32Release()
{
Build(BuildTarget.StandaloneOSXIntel, false);
}

public static void BuildOSX32Development()
{
Build(BuildTarget.StandaloneOSXIntel, true);
}

public static void BuildOSX64Release()
{
Build(BuildTarget.StandaloneOSXIntel64, false);
Expand Down
43 changes: 24 additions & 19 deletions Assets/PatchKit Patcher/Editor/CustomBuilding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
using UnityEditor.SceneManagement;
using System.Linq;
using System.Diagnostics;
using System.IO;
using System;

namespace PatchKit.Unity
{
public class CustomBuildScripts
public class CustomBuildScripts
{
[MenuItem("Tools/Build/Windows x86")]
public static void BuildWindows86 ()
Expand Down Expand Up @@ -37,44 +39,47 @@ public static void BuildLinux ()
Build(BuildTarget.StandaloneLinuxUniversal);
}

[MenuItem("Tools/Build/OSX")]
public static void BuildOsx ()
{
Build(BuildTarget.StandaloneOSXIntel);
}

[MenuItem("Tools/Build/OSX x64")]
public static void BuildOsx64 ()
{
Build(BuildTarget.StandaloneOSXIntel64);
}

[MenuItem("Tools/Build/OSX Universal")]
public static void BuildOsxUniversal ()
{
Build(BuildTarget.StandaloneOSXUniversal);
}

private static string PatcherExecutableName(BuildTarget target)
{
switch (target)
{
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
return "Patcher.exe";

case BuildTarget.StandaloneLinux:
case BuildTarget.StandaloneLinux64:
case BuildTarget.StandaloneLinuxUniversal:
return "Patcher";

case BuildTarget.StandaloneOSXIntel:
case BuildTarget.StandaloneOSXIntel64:
case BuildTarget.StandaloneOSXUniversal:
return "Patcher.app";
default:
throw new NotSupportedException();
}
}

public static string PatcherDataDirectory(BuildTarget target, string executablePath)
{
switch (target)
{
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
case BuildTarget.StandaloneLinux:
case BuildTarget.StandaloneLinux64:
case BuildTarget.StandaloneLinuxUniversal:
string buildDir = Path.GetDirectoryName(executablePath);
string patcherName = Path.GetFileNameWithoutExtension (executablePath);

return Path.Combine(buildDir, patcherName + "_Data");
case BuildTarget.StandaloneOSXIntel64:
return Path.Combine(executablePath, "Contents");
default:
return "";
throw new NotSupportedException();
}
}

Expand Down Expand Up @@ -133,7 +138,7 @@ private static void Build(BuildTarget target)
}
}

BuildOptions buildOptions = BuildOptions.ForceEnableAssertions
BuildOptions buildOptions = BuildOptions.ForceEnableAssertions
| BuildOptions.ShowBuiltPlayer;

string path = EditorUtility.SaveFolderPanel("Choose where to build the Patcher", "", "");
Expand Down
36 changes: 18 additions & 18 deletions Assets/PatchKit Patcher/Editor/PatcherManifestCreator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using JetBrains.Annotations;
using Newtonsoft.Json;
using UnityEditor;
Expand All @@ -13,25 +14,24 @@ public static class PatcherManifestCreator
[PostProcessBuild, UsedImplicitly]
private static void PostProcessBuild(BuildTarget buildTarget, string buildPath)
{
Manifest manifest = new Manifest();
Manifest manifest;

if (buildTarget == BuildTarget.StandaloneWindows || buildTarget == BuildTarget.StandaloneWindows64)
switch (buildTarget)
{
manifest = WindowsManifest(buildPath);
}

if (buildTarget == BuildTarget.StandaloneOSXUniversal ||
buildTarget == BuildTarget.StandaloneOSXIntel ||
buildTarget == BuildTarget.StandaloneOSXIntel64)
{
manifest = OsxManifest(buildPath);
}

if (buildTarget == BuildTarget.StandaloneLinux ||
buildTarget == BuildTarget.StandaloneLinux64 ||
buildTarget == BuildTarget.StandaloneLinuxUniversal)
{
manifest = LinuxManifest(buildPath);
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
manifest = WindowsManifest(buildPath);
break;
case BuildTarget.StandaloneOSXIntel64:
manifest = OsxManifest(buildPath);
break;
case BuildTarget.StandaloneLinux:
case BuildTarget.StandaloneLinux64:
case BuildTarget.StandaloneLinuxUniversal:
manifest = LinuxManifest(buildPath);
break;
default:
throw new NotSupportedException();
}

string manifestPath = Path.Combine(Path.GetDirectoryName(buildPath), "patcher.manifest");
Expand Down
2 changes: 1 addition & 1 deletion Assets/PatchKit Patcher/Editor/ScreenSizeCorrection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class ScreenSizeCorrection
public static void SaveScreenSize(BuildTarget buildTarget, string buildPath)
{
string content = string.Format("{0} {1}", PlayerSettings.defaultScreenWidth, PlayerSettings.defaultScreenHeight);
string filename = Path.Combine(Path.GetDirectoryName(buildPath), BorderlessWindow.ScreenSizeFilename);
string filename = Path.Combine(CustomBuildScripts.PatcherDataDirectory(buildTarget, buildPath), BorderlessWindow.ScreenSizeFilename);

File.WriteAllText(filename, content);
}
Expand Down
9 changes: 5 additions & 4 deletions Assets/PatchKit Patcher/Scripts/UI/BorderlessWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,16 @@ private void Awake()

private void EnforceCorrectScreenSize()
{
_logger.LogDebug("Reading correct screen size from " + ScreenSizeFilename);
string screenSizeFilePath = Path.Combine(Application.dataPath, ScreenSizeFilename);
_logger.LogDebug("Reading correct screen size from " + screenSizeFilePath);

if (!File.Exists(ScreenSizeFilename))
if (!File.Exists(screenSizeFilePath))
{
_logger.LogWarning(ScreenSizeFilename + " file does not exist.");
_logger.LogWarning(screenSizeFilePath + " file does not exist.");
return;
}

var screenResolutionText = File.ReadAllText(ScreenSizeFilename).Split(' ');
var screenResolutionText = File.ReadAllText(screenSizeFilePath).Split(' ');

try
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/PatchKit Patcher/Scripts/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public static class Version
{
public const int Major = 3;
public const int Minor = 10;
public const int Release = 2;
public const int Release = 3;

public static string Value
{
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.10.3]
### Fixed
- Fix issue with locating screensize file

## [3.10.2]
### Fixed
- An edge case which caused the download to never terminate
Expand Down