Skip to content

Commit

Permalink
Merge remote-tracking branch 'MitchellBurton/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hymerman committed Oct 26, 2015
2 parents 1e8e08e + b6cc84e commit 98ae8a4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 15 additions & 4 deletions agent/src/unityRunner/agent/UnityRunnerConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static String getUnityLogPath(Platform platform) {
* @param locations list of locations
*/
private static void addLocation(String location, List<String> locations) {
if (isSet(location)) {
if (isSet(location) && !locations.contains(location)) {
locations.add(location);
}
}
Expand All @@ -201,13 +201,24 @@ static List<String> getPossibleUnityLocations(Platform platform) {

switch (platform) {
case Windows:
// on Windows we have potentially two locations for 32 and 64 bit apps
addLocation(System.getenv("ProgramFiles"), locations);
addLocation(System.getenv("%programfiles% (x86)"), locations);
//On Windows we have potentially two locations for 32 and 64 bit apps.
//But because we can have 32 or 64 bit Java on 32 or 64 bit Windows
//we need to check three environment variables.
//See: http://stackoverflow.com/a/27720921

String x64Location = System.getenv("ProgramFiles");
String x86Location = System.getenv("ProgramFiles(X86)");
String x64onx86 = System.getenv("ProgramW6432");

addLocation(x64Location, locations);
addLocation(x86Location, locations);
addLocation(x64onx86, locations);
break;

case Mac:
// on Mac there is only one location for apps.
addLocation("/Applications", locations);
break;
}

return locations;
Expand Down
4 changes: 2 additions & 2 deletions unityrunner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

<path id="library.classpath">
<pathelement location="${basedir}/lib/commons-io-2.4.jar"/>
<pathelement location="${basedir}/lib/commons-configuration-1.9.jar"/>
<pathelement location="${basedir}/lib/commons-configuration-1.10.jar"/>
<pathelement location="${basedir}/lib/commons-lang-2.6.jar"/>
<pathelement location="${basedir}/lib/commons-logging-1.1.1.jar"/>
<pathelement location="${basedir}/lib/jna-3.4.0.jar"/>
Expand Down Expand Up @@ -400,4 +400,4 @@
<target name="build.modules" depends="init, clean, compile.module.unityrunner-common, compile.module.unityrunner-agent, compile.module.unityrunner-server" description="build all modules"/>

<target name="all" depends="build.modules" description="build all"/>
</project>
</project>

0 comments on commit 98ae8a4

Please sign in to comment.