-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundle JREs, and other OS compatibility fixes (#24)
Several OS compatibility fixes: - Bundle JREs with the CGSuite distribution, in order to avoid various issues due to JRE version conflicts. - Use the correct user dir on Windows. - Improved logic for instantiating a user folder and startup script.
- Loading branch information
1 parent
f1b40d9
commit 2e03853
Showing
14 changed files
with
131 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ desktop-app/dist/ | |
# CGSuite-related | ||
cgsuite-kernel.log | ||
lib/core/local/ | ||
desktop-app/local/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
desktop-app/Worksheet/src/org/cgsuite/ui/worksheet/WorksheetEnvironment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package org.cgsuite.ui.worksheet; | ||
|
||
import java.io.File; | ||
import javax.swing.filechooser.FileSystemView; | ||
import org.cgsuite.help.HelpIndex; | ||
import org.cgsuite.lang.CgscriptClasspath; | ||
import scala.Symbol; | ||
import scala.collection.mutable.AnyRefMap; | ||
|
||
/** | ||
* | ||
* @author asiegel | ||
*/ | ||
class WorksheetEnvironment { | ||
|
||
final static AnyRefMap<Symbol,Object> WORKSPACE_VAR_MAP = new AnyRefMap<Symbol,Object>(); | ||
|
||
static void initialize() { | ||
|
||
// Forcibly instantiate a CanonicalShortGame so that the interface will seem snappier | ||
// once the user starts using it | ||
new CalculationCapsule(WORKSPACE_VAR_MAP, "{1|1/2}").runAndWait(); | ||
|
||
File homeFolder = FileSystemView.getFileSystemView().getDefaultDirectory(); | ||
File userFolder = new File(homeFolder, "CGSuite"); | ||
|
||
if (!userFolder.exists()) { | ||
userFolder.mkdir(); | ||
} | ||
CgscriptClasspath.declareClasspathRoot(userFolder, true); | ||
|
||
// Force HelpIndex to load, in order to reduce UI sluggishness later | ||
// (This is just a convenient place for this to go that is guaranteed | ||
// to load at startup) | ||
HelpIndex.lookup("C"); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default_userdir="${DEFAULT_USERDIR_ROOT}/dev" | ||
default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev" | ||
default_options="--branding cgsuite" | ||
jdkhome=jre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters