Kaydet (Commit) 40893569 authored tarafından neilm's avatar neilm

Adding package declarations

üst 4701a503
package installer;
import java.awt.*; import java.awt.*;
public class Banner extends Canvas public class Banner extends Canvas
......
package installer;
import java.io.*; import java.io.*;
public class FileUpdater { public class FileUpdater {
...@@ -157,10 +159,17 @@ public class FileUpdater { ...@@ -157,10 +159,17 @@ public class FileUpdater {
//<library:library library:name="Depot" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/share/basic/Depot/script.xlb/" xlink:type="simple" library:link="true" library:readonly="false"/> //<library:library library:name="Depot" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/share/basic/Depot/script.xlb/" xlink:type="simple" library:link="true" library:readonly="false"/>
//<library:library library:name="Standard" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/user/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/> //<library:library library:name="Standard" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/user/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/>
//System.out.println(" <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/script.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" ); //System.out.println(" <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/script.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" );
String opSys = System.getProperty("os.name");
if (opSys.indexOf("Windows") != -1) {
out.write(" <library:library library:name=\"ScriptBindingLibrary\" library:link=\"false\"/>\n" );
}
else {
out.write(" <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/script.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" ); out.write(" <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/script.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" );
} }
} }
} }
}
catch( Exception e ) { catch( Exception e ) {
System.out.println("\n Update Script.xlc Failed!"); System.out.println("\n Update Script.xlc Failed!");
System.err.println(e); System.err.println(e);
...@@ -244,10 +253,16 @@ public class FileUpdater { ...@@ -244,10 +253,16 @@ public class FileUpdater {
//<library:library library:name="Depot" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/share/basic/Depot/script.xlb/" xlink:type="simple" library:link="true" library:readonly="false"/> //<library:library library:name="Depot" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/share/basic/Depot/script.xlb/" xlink:type="simple" library:link="true" library:readonly="false"/>
//<library:library library:name="Standard" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/user/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/> //<library:library library:name="Standard" xlink:href="file:///scriptdev/neil/openoffice1.0.1ScriptFrame/user/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/>
//System.out.println( " <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/dialog.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" ); //System.out.println( " <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/dialog.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" );
String opSys = System.getProperty("os.name");
if (opSys.indexOf("Windows") != -1) {
out.write(" <library:library library:name=\"ScriptBindingLibrary\" library:link=\"false\"/>\n" );
}
else {
out.write(" <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/dialog.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" ); out.write(" <library:library library:name=\"ScriptBindingLibrary\" xlink:href=\"file://"+installPath+"/user/basic/ScriptBindingLibrary/dialog.xlb/\" xlink:type=\"simple\" library:link=\"false\"/>\n" );
} }
} }
} }
}
catch( Exception e ) { catch( Exception e ) {
System.out.println("\n Update Dialog.xlc Failed!"); System.out.println("\n Update Dialog.xlc Failed!");
System.err.println(e); System.err.println(e);
......
package installer;
/* /*
* Welcome.java * Welcome.java
* *
...@@ -58,6 +60,7 @@ public class Final extends javax.swing.JPanel implements ActionListener, Install ...@@ -58,6 +60,7 @@ public class Final extends javax.swing.JPanel implements ActionListener, Install
} }
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
// navNext is "Install"
if (e.getSource() == nav.navNext) if (e.getSource() == nav.navNext)
{ {
JProgressBar progressBar=new JProgressBar(); JProgressBar progressBar=new JProgressBar();
...@@ -85,9 +88,9 @@ public class Final extends javax.swing.JPanel implements ActionListener, Install ...@@ -85,9 +88,9 @@ public class Final extends javax.swing.JPanel implements ActionListener, Install
xud.start(); xud.start();
} }
} }
if (e.getSource() == nav.navCancel)
{ // set to "Exit" at end of installation process
//xud.setSuspend(); if (e.getSource() == nav.navCancel) {
int answer = JOptionPane.showConfirmDialog(wizard, "Are you sure you want to exit?"); int answer = JOptionPane.showConfirmDialog(wizard, "Are you sure you want to exit?");
if (answer == JOptionPane.YES_OPTION) if (answer == JOptionPane.YES_OPTION)
{ {
...@@ -103,12 +106,24 @@ public class Final extends javax.swing.JPanel implements ActionListener, Install ...@@ -103,12 +106,24 @@ public class Final extends javax.swing.JPanel implements ActionListener, Install
public void installationComplete(InstallationEvent ev) { public void installationComplete(InstallationEvent ev) {
//System.out.println("Detected installation complete"); //System.out.println("Detected installation complete");
if( InstUtil.hasNetbeansInstallation() || InstUtil.hasJeditInstallation() ) {
//System.out.println("Detected installation complete (IDE(s) detected)");
nav.removeCancelListener(this); nav.removeCancelListener(this);
nav.setCancelListener(nav); nav.setCancelListener(nav);
nav.navCancel.setText("Exit"); nav.navCancel.setText("Finish");
nav.enableIDE(true);
nav.enableCancel(true); nav.enableCancel(true);
xud = null; xud = null;
} }
else {
//System.out.println("Detected installation complete (No IDE(s) detected)");
nav.removeCancelListener(this);
nav.setCancelListener(nav);
nav.navCancel.setText("Finish");
nav.enableCancel(true);
xud = null;
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel statusPanel; private javax.swing.JPanel statusPanel;
......
package installer;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.zip.*; import java.util.zip.*;
...@@ -114,6 +116,35 @@ public class InstUtil { ...@@ -114,6 +116,35 @@ public class InstUtil {
public static boolean hasNetbeansInstallation() {
File theFile = null;
StringBuffer str = new StringBuffer();
String sep = System.getProperty("file.separator");
str.append(System.getProperty("user.home"));
str.append(sep);
StringBuffer thePath = new StringBuffer(str.toString());
thePath.append(".netbeans");
theFile = new File(thePath.toString());
return theFile.isDirectory();
}
public static boolean hasJeditInstallation() {
File theFile = null;
StringBuffer str = new StringBuffer();
String sep = System.getProperty("file.separator");
str.append(System.getProperty("user.home"));
str.append(sep);
StringBuffer thePath = new StringBuffer(str.toString());
thePath.append(".jedit");
theFile = new File(thePath.toString());
return theFile.isDirectory();
}
public static Properties getNetbeansLocation() throws IOException { public static Properties getNetbeansLocation() throws IOException {
File theFile = null; File theFile = null;
Properties results = new Properties(); Properties results = new Properties();
...@@ -127,25 +158,6 @@ public class InstUtil { ...@@ -127,25 +158,6 @@ public class InstUtil {
String os = System.getProperty("os.name"); String os = System.getProperty("os.name");
if (os.indexOf("Windows") != -1) { if (os.indexOf("Windows") != -1) {
/*String appData = winGetAppData;
if (os.equals("Windows 2000")) {
thePath.append("Application Data");
thePath.append(sep);
theFile = new File(thePath.toString());
} else if (os.indexOf("Windows") != -1) {
thePath.append(sep);
thePath.append("sversion.ini");
theFile = new File(thePath.toString());
if (!theFile.exists())
{
thePath.delete(0, thePath.length());
thePath.append(str);
thePath.append("Application Data");
thePath.append(sep);
thePath.append("sversion.ini");
theFile = new File(thePath.toString());
}
}*/
//theFile = findVersionFile(new File(str.toString())); //theFile = findVersionFile(new File(str.toString()));
thePath.append(".netbeans"); thePath.append(".netbeans");
//theFile = new File(thePath.toString()); //theFile = new File(thePath.toString());
...@@ -157,21 +169,6 @@ public class InstUtil { ...@@ -157,21 +169,6 @@ public class InstUtil {
//theFile = new File(thePath.toString()); //theFile = new File(thePath.toString());
} }
/*
if (theFile == null)
{
throw new IOException("Could not locate the OpenOffice settings file.\nAre you sure StarOffice is installed on your system?");
}
if (!theFile.exists())
{
throw new IOException("Could not locate the OpenOffice settings file.\nAre you sure StarOffice is installed on your system?");
}
*/
//return location;
if ( thePath.toString().indexOf( ".netbeans" ) == -1 ) if ( thePath.toString().indexOf( ".netbeans" ) == -1 )
return null; return null;
else if ( new File( thePath.append( sep+"3.4"+sep ).toString() ).isDirectory() ) { else if ( new File( thePath.append( sep+"3.4"+sep ).toString() ).isDirectory() ) {
...@@ -180,27 +177,64 @@ public class InstUtil { ...@@ -180,27 +177,64 @@ public class InstUtil {
if( netbeansLogFile.exists() ) { if( netbeansLogFile.exists() ) {
String installPath = getNetbeansInstallation( netbeansLogFile ); String installPath = getNetbeansInstallation( netbeansLogFile );
File f = new File(installPath); File f = new File(installPath);
results.put("NetBeans 3.4", f.getPath()); results.put("NetBeans 3.4", f.getPath()+"/");
/* System.out.println( "f.getPath() " + f.getPath()+"/" );
try { }
URI uri = new URI(installPath); else {
File f = new File(uri); System.out.println( "Prompt user for NetBeans installation path" );
}
}
//.sversion: OpenOffice.org 643=file:///scriptdev/neil/ScriptFrameOpenoffice1.0.1
// parts = Installation name. f.getPath = Installation path return results;
results.put("NetBeans 3.4", f.getPath());
//System.out.println("Putting " + parts[0] + " : " + f.getPath());
} }
catch (URISyntaxException eSyntax) {
throw new IOException("Error while reading NetBeans version information");
//results.put(parts[0].trim(), parts[1].trim());
//System.out.println(parts[0].trim() + " : " + parts[1].trim()); public static Properties getJeditLocation() throws IOException {
if( !hasJeditInstallation() ) {
System.out.println( "No Jedit found (line195 InstUtil");
return null;
}
File theFile = null;
Properties results = new Properties();
StringBuffer str = new StringBuffer();
String sep = System.getProperty("file.separator");
str.append(System.getProperty("user.home"));
str.append(sep);
StringBuffer thePath = new StringBuffer(str.toString());
String os = System.getProperty("os.name");
thePath.append(".jedit");
//System.out.println( ".jedit path " + thePath );
/*
if (os.indexOf("Windows") != -1) {
//theFile = findVersionFile(new File(str.toString()));
thePath.append(".jedit");
//theFile = new File(thePath.toString());
} else if (os.indexOf("SunOS") != -1) {
thePath.append(".jedit");
//theFile = new File(thePath.toString());
} else if (os.indexOf("Linux") != -1) {
thePath.append(".jedit");
//theFile = new File(thePath.toString());
} }
*/ */
File jeditLogFile = new File( thePath.toString() + sep + "activity.log" );
if( jeditLogFile.exists() ) {
String[] jeditDetails = getJeditInstallation( jeditLogFile );
System.out.println( "installPath (line 229) " + jeditDetails[0] );
File f = new File(jeditDetails[0]);
results.put("jEdit "+jeditDetails[1], jeditDetails[0]);
System.out.println( "jeditDetails[0] is " + jeditDetails[0]);
} }
else { else {
System.out.println( "Prompt user for NetBeans installation path" ); System.out.println( "Prompt user for Jedit installation path" );
}
} }
...@@ -209,7 +243,9 @@ public class InstUtil { ...@@ -209,7 +243,9 @@ public class InstUtil {
public static String getNetbeansInstallation( File logFile ) {
private static String getNetbeansInstallation( File logFile ) {
String installPath = ""; String installPath = "";
try { try {
BufferedReader reader = new BufferedReader(new FileReader(logFile)); BufferedReader reader = new BufferedReader(new FileReader(logFile));
...@@ -217,7 +253,7 @@ public class InstUtil { ...@@ -217,7 +253,7 @@ public class InstUtil {
for (String s = reader.readLine(); s != null; s = reader.readLine()) { for (String s = reader.readLine(); s != null; s = reader.readLine()) {
s.trim(); s.trim();
if( s.indexOf( "IDE Install" ) != -1 ) { if( s.indexOf( "IDE Install" ) != -1 ) {
int pathStart = s.indexOf( "=" ); int pathStart = s.indexOf( "=" ) + 2;
//System.out.println( "pathStart " + pathStart ); //System.out.println( "pathStart " + pathStart );
installPath = s.substring( pathStart, s.length() ); installPath = s.substring( pathStart, s.length() );
//System.out.println( "installPath 1" + installPath ); //System.out.println( "installPath 1" + installPath );
...@@ -230,7 +266,7 @@ public class InstUtil { ...@@ -230,7 +266,7 @@ public class InstUtil {
//System.out.println( "s is " + s + " and " + s.length() + " long" ); //System.out.println( "s is " + s + " and " + s.length() + " long" );
//installPath = s.substring( pathStart, pathEnd - 1 ); //installPath = s.substring( pathStart, pathEnd - 1 );
installPath.trim(); installPath.trim();
//System.out.println( "installPath 2 " + installPath ); System.out.println( "Netbeans installPath (line267 InstUtil " + installPath );
break; break;
} }
} }
...@@ -246,6 +282,54 @@ public class InstUtil { ...@@ -246,6 +282,54 @@ public class InstUtil {
} }
private static String[] getJeditInstallation( File logFile ) {
String[] jeditDetails = new String[2];
try {
BufferedReader reader = new BufferedReader(new FileReader(logFile));
String installPath = "";
String version = "";
for (String s = reader.readLine(); s != null; s = reader.readLine()) {
s.trim();
if( s.indexOf( "jEdit home directory is" ) != -1 ) {
int pathStart = s.indexOf( "is /" ) + 3;
//System.out.println( "pathStart " + pathStart );
installPath = s.substring( pathStart, s.length() ) +File.separator;
System.out.println( "installPath 1" + installPath );
//int pathEnd = installPath.indexOf( ";");
//System.out.println( "pathEnd " + pathEnd );
//installPath = installPath.substring( 0, pathEnd ) +File.separator;
//System.out.println( "pathStart " + pathStart );
//int pathEnd = s.indexOf( ";");
//System.out.println( "pathEnd " + pathEnd );
//System.out.println( "s is " + s + " and " + s.length() + " long" );
//installPath = s.substring( pathStart, pathEnd - 1 );
installPath.trim();
//System.out.println( "installPath 2 " + installPath );
//break;
jeditDetails[0] = installPath;
}
if( s.indexOf( "jEdit: jEdit version" ) != -1 ) {
int versionStart = s.indexOf( "version" ) + 8;
System.out.println( "versionStart is: " + versionStart );
version = s.substring( versionStart, s.length() );
version.trim();
System.out.println( "jEdit version is: " + version );
jeditDetails[1] = version;
}
}
}
catch( IOException ioe ) {
System.out.println( "Error reading Jedit location information" );
}
//catch( FileNotFoundException fnfe ) {
//System.out.println( "Jedit activity.log FileNotFoundException" );
//}
return jeditDetails;
}
public static File findVersionFile(File start) public static File findVersionFile(File start)
{ {
......
package installer;
public interface InstallListener public interface InstallListener
{ {
public void installationComplete(InstallationEvent e); public void installationComplete(InstallationEvent e);
......
package installer;
/* /*
* InstallWizard.java * InstallWizard.java
* *
...@@ -65,7 +67,7 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener ...@@ -65,7 +67,7 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener
setBackground(new Color(0,0,0)); setBackground(new Color(0,0,0));
locations = new ArrayList(); locations = new ArrayList();
//Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); //Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
Point center = new Point( 300, 300 ); Point center = new Point( 400, 400 );
int windowWidth=200; int windowWidth=200;
int windowHeight=300; int windowHeight=300;
setSize(windowWidth,windowHeight); setSize(windowWidth,windowHeight);
...@@ -113,23 +115,25 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener ...@@ -113,23 +115,25 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener
getContentPane().add(navigation, java.awt.BorderLayout.SOUTH); getContentPane().add(navigation, java.awt.BorderLayout.SOUTH);
screens.setLayout(new java.awt.CardLayout()); screens.setLayout(new java.awt.CardLayout());
screens.add(WELCOME, new Welcome(this)); screens.add(WELCOME, new Welcome(this));
//screens.add("EULA", new EULA());
// ----------------
netbeansVersion = new NetbeansVersion(this);
screens.add(NETBEANSVERSIONS, netbeansVersion);
// ----------------
version = new Version(this); version = new Version(this);
screens.add(VERSIONS, version); screens.add(VERSIONS, version);
_final = new Final(this); _final = new Final(this);
screens.add(FINAL, _final); screens.add(FINAL, _final);
idewelcome = new IdeWelcome(this);
screens.add(IDEWELCOME, idewelcome);
ideversion = new IdeVersion(this);
screens.add(IDEVERSIONS, ideversion);
idefinal = new IdeFinal(this);
screens.add(IDEFINAL, idefinal);
getContentPane().add(screens, java.awt.BorderLayout.CENTER); getContentPane().add(screens, java.awt.BorderLayout.CENTER);
navNext.addActionListener(this); navNext.addActionListener(this);
navNext.addActionListener(netbeansVersion);
navNext.addActionListener(version); navNext.addActionListener(version);
navNext.addActionListener(netbeansVersion);
navNext.addActionListener(_final); navNext.addActionListener(_final);
navNext.addActionListener(ideversion);
navNext.addActionListener(idefinal);
navCancel.addActionListener(this); navCancel.addActionListener(this);
navBack.addActionListener(this); navBack.addActionListener(this);
...@@ -258,14 +262,18 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener ...@@ -258,14 +262,18 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener
private javax.swing.JPanel screens; private javax.swing.JPanel screens;
private Version version; private Version version;
private NetbeansVersion netbeansVersion;
private Final _final; private Final _final;
private IdeVersion ideversion;
private IdeFinal idefinal;
private IdeWelcome idewelcome;
private static ArrayList locations; private static ArrayList locations;
public static String VERSIONS = "VERSIONS"; public static String VERSIONS = "VERSIONS";
public static String WELCOME = "WELCOME"; public static String WELCOME = "WELCOME";
public static String FINAL = "FINAL"; public static String FINAL = "FINAL";
public static String NETBEANSVERSIONS = "NETBEANSVERSIONS"; public static String IDEVERSIONS = "IDEVERSIONS";
public static String IDEWELCOME = "IDEWELCOME";
public static String IDEFINAL = "IDEFINAL";
public static int DEFWIDTH = 480; public static int DEFWIDTH = 480;
public static int DEFHEIGHT = 240; public static int DEFHEIGHT = 240;
......
package installer;
public class InstallationEvent public class InstallationEvent
{ {
private Object source; private Object source;
......
package installer;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
...@@ -49,6 +51,10 @@ public class NavPanel extends JPanel implements ActionListener { ...@@ -49,6 +51,10 @@ public class NavPanel extends JPanel implements ActionListener {
navCancel.setEnabled(bEnable); navCancel.setEnabled(bEnable);
} }
public void enableIDE(boolean bEnable) {
ideDetected = bEnable;
}
public void actionPerformed(ActionEvent ev) { public void actionPerformed(ActionEvent ev) {
if ((ev.getSource() == navNext) && (next.length() != 0)) { if ((ev.getSource() == navNext) && (next.length() != 0)) {
wizard.show(next); wizard.show(next);
...@@ -57,8 +63,14 @@ public class NavPanel extends JPanel implements ActionListener { ...@@ -57,8 +63,14 @@ public class NavPanel extends JPanel implements ActionListener {
wizard.show(prev); wizard.show(prev);
} }
if (ev.getSource() == navCancel) { if (ev.getSource() == navCancel) {
if( ideDetected ) {
wizard.show(InstallWizard.IDEWELCOME);
}
else {
wizard.exitForm(null); wizard.exitForm(null);
} }
enableIDE(false);
}
} }
public void setNextListener(ActionListener listener) { public void setNextListener(ActionListener listener) {
...@@ -97,4 +109,5 @@ public class NavPanel extends JPanel implements ActionListener { ...@@ -97,4 +109,5 @@ public class NavPanel extends JPanel implements ActionListener {
private InstallWizard wizard; private InstallWizard wizard;
private String next; private String next;
private String prev; private String prev;
private boolean ideDetected = false;
} }
package installer;
/* /*
* Navigation.java * Navigation.java
* *
......
package installer;
import java.lang.String; import java.lang.String;
import java.io.*; import java.io.*;
import javax.swing.*; import javax.swing.*;
...@@ -79,7 +81,7 @@ public class Register{ ...@@ -79,7 +81,7 @@ public class Register{
System.out.println( "Windows" ); System.out.println( "Windows" );
//path = "C:\\Progra~1\\OpenOffice.org643"; //path = "C:\\Progra~1\\OpenOffice.org643";
//progpath = path + "\\program\\"; //progpath = path + "\\program\\";
//System.out.println("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.theScriptRuntimeForJava=drafts.com.sun.star.script.framework.ScriptRuntimeForJava\""); System.out.println("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.theScriptRuntimeForJava=drafts.com.sun.star.script.framework.ScriptRuntimeForJava\"");
p=rt.exec("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.theScriptRuntimeForJava=drafts.com.sun.star.script.framework.ScriptRuntimeForJava\""); p=rt.exec("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.theScriptRuntimeForJava=drafts.com.sun.star.script.framework.ScriptRuntimeForJava\"");
} }
exitcode=p.waitFor(); exitcode=p.waitFor();
...@@ -102,7 +104,7 @@ public class Register{ ...@@ -102,7 +104,7 @@ public class Register{
} }
else { else {
//System.out.println( "Windows" ); //System.out.println( "Windows" );
//System.out.println("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.storage.theScriptStorageManager=drafts.com.sun.star.script.framework.storage.ScriptStorageManager\""); System.out.println("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.storage.theScriptStorageManager=drafts.com.sun.star.script.framework.storage.ScriptStorageManager\"");
p=rt.exec("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.storage.theScriptStorageManager=drafts.com.sun.star.script.framework.storage.ScriptStorageManager\""); p=rt.exec("\""+progpath+"regsingleton.exe\" \""+path+File.separator+"user"+File.separator+"uno_packages"+File.separator+"cache"+File.separator+"services.rdb\" \"drafts.com.sun.star.script.framework.storage.theScriptStorageManager=drafts.com.sun.star.script.framework.storage.ScriptStorageManager\"");
} }
exitcode=p.waitFor(); exitcode=p.waitFor();
......
package installer;
/* /*
* Welcome.java * Welcome.java
* *
...@@ -76,11 +78,12 @@ public class Version extends javax.swing.JPanel implements ActionListener, Table ...@@ -76,11 +78,12 @@ public class Version extends javax.swing.JPanel implements ActionListener, Table
//JScrollPane scroll = new JScrollPane(tableVersions); //JScrollPane scroll = new JScrollPane(tableVersions);
//versionPanel.add(scroll); //versionPanel.add(scroll);
versionPanel.add(tableVersions); versionPanel.add(tableVersions);
JTextArea area = new JTextArea("\n Please select the Office version you wish to Update \n "); JTextArea area = new JTextArea("Please select the Office version you wish to Update");
area.setLineWrap(true); area.setLineWrap(true);
area.setEditable(false); area.setEditable(false);
add(area, BorderLayout.NORTH); add(area, BorderLayout.NORTH);
add(versionPanel, BorderLayout.CENTER); add(versionPanel, BorderLayout.CENTER);
//nav = new NavPanel(wizard, true, false, true, InstallWizard.WELCOME, InstallWizard.FINAL);
nav = new NavPanel(wizard, true, false, true, InstallWizard.WELCOME, InstallWizard.FINAL); nav = new NavPanel(wizard, true, false, true, InstallWizard.WELCOME, InstallWizard.FINAL);
nav.setNextListener(this); nav.setNextListener(this);
add(nav, BorderLayout.SOUTH); add(nav, BorderLayout.SOUTH);
......
package installer;
/* /*
* Welcome.java * Welcome.java
* *
......
package installer;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.jar.*; import java.util.jar.*;
...@@ -174,6 +176,8 @@ public class XmlUpdater extends Thread { ...@@ -174,6 +176,8 @@ public class XmlUpdater extends Thread {
else else
System.out.println( "soffice.cfg exists" ); System.out.println( "soffice.cfg exists" );
// Robert Kinsella test 1
//Adding <Office>/user/Scripts/java/ //Adding <Office>/user/Scripts/java/
File scriptsDir = new File( scriptsPath ); File scriptsDir = new File( scriptsPath );
File highlightDir = new File( scriptsPath+File.separator+"Highlight"+File.separator ); File highlightDir = new File( scriptsPath+File.separator+"Highlight"+File.separator );
...@@ -203,6 +207,11 @@ public class XmlUpdater extends Thread { ...@@ -203,6 +207,11 @@ public class XmlUpdater extends Thread {
{ {
onInstallComplete(); onInstallComplete();
return; return;
}
if (!zd.extractEntry("sframework/scripting64401.res",progpath+"resource"+File.separator, statusLabel))
{
onInstallComplete();
return;
} }
if (opSys.indexOf("Windows")!=-1){ if (opSys.indexOf("Windows")!=-1){
if (!zd.extractEntry("windows/regsingleton.exe",progpath, statusLabel)) if (!zd.extractEntry("windows/regsingleton.exe",progpath, statusLabel))
...@@ -227,6 +236,7 @@ public class XmlUpdater extends Thread { ...@@ -227,6 +236,7 @@ public class XmlUpdater extends Thread {
} }
//-------------------------------- //--------------------------------
// Robert Kinsella test 2
// adding (JAVA) script examples // adding (JAVA) script examples
File highlightScript = new File( scriptsPath+File.separator+"Highlight"+File.separator+"HighlightUtil.java" ); File highlightScript = new File( scriptsPath+File.separator+"Highlight"+File.separator+"HighlightUtil.java" );
...@@ -276,6 +286,7 @@ public class XmlUpdater extends Thread { ...@@ -276,6 +286,7 @@ public class XmlUpdater extends Thread {
else { else {
System.out.println( "Spell script already deployed" ); System.out.println( "Spell script already deployed" );
} }
//-------------------------------- //--------------------------------
// Adding binding dialog // Adding binding dialog
......
package installer;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.zip.*; import java.util.zip.*;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment