Index: src/org/netbeans/installer/actions/DetectAction.java =================================================================== RCS file: /cvs/installer/src/org/netbeans/installer/actions/DetectAction.java,v retrieving revision 1.7 diff -u -b -B -r1.7 DetectAction.java --- src/org/netbeans/installer/actions/DetectAction.java 12 Sep 2002 09:53:56 -0000 1.7 +++ src/org/netbeans/installer/actions/DetectAction.java 26 Mar 2003 14:56:07 -0000 @@ -128,7 +128,8 @@ readDir(netbeansDir); } initial_size = detectedData.size(); - detectOlderThan3_4(); + detectOlderThanThis(); + detectUnpacked3_5(); detectUnpacked3_4(); if(detectedData.size() > 0){ setDetected(true); @@ -175,16 +176,45 @@ } } - - private void detectOlderThan3_4(){ + private void detectOlderThanThis(){ osName = System.getProperty("os.name"); //NOI18N if(osName.indexOf("Windows") != -1){ detectWin(" \"HKEY_CURRENT_USER\\Software\\netbeans.org\\NetBeans IDE\\3.3\"","3.3"); //NOI18N detectWin(" \"HKEY_CURRENT_USER\\Software\\netbeans.org\\NetBeans IDE\\3.2\"","3.2"); //NOI18N + //for Forte and $1$ + detectSierraOrion(); //S1S4 upd1,FFJ40 + detectPilsen(); //FFJ30 }else - detectUnix(); + detectUnix(); //needs change because of FFJ and S1S!!! + } + + private void detectSierraOrion(){ + //both use the same userdir + String userdir = getWin32RegValue("\"HKEY_CURRENT_USER\\Software\\Sun Microsystems, Inc.\\Forte For Java\\CE\\4.0\"","UserDir"); //NOI18N + if(userdir == null) //nor sierra nor orion detected + return; + File sysDir = new File(userdir.trim()+fileSeparator+"system"); //NOI18N + if(!sysDir.exists()) + return; + String installdir = getWin32RegValue("\"HKEY_LOCAL_MACHINE\\SOFTWARE\\Sun Microsystems\\Forte(tm) for Java(tm), ce\\4\"","path"); //NOI18N + if(installdir != null) + detectedData.addElement(new String[]{"Sun One Studio 4 upd1","","",userdir.trim(),""});//NOI18N + else + detectedData.addElement(new String[]{"Forte For Java 4.0","","",userdir.trim(),""});//NOI18N + } + private void detectPilsen(){ + String userdir = getWin32RegValue("\"HKEY_CURRENT_USER\\Software\\Sun Microsystems, Inc.\\Forte For Java\\3.0\"","UserDir"); //NOI18N + if(userdir == null) //nor sierra nor orion detected + return; + File sysDir = new File(userdir.trim()+fileSeparator+"system"); //NOI18N + if(!sysDir.exists()) + return; + detectedData.addElement(new String[]{"Forte For Java 3.0","","",userdir.trim(),""});//NOI18N + } + + /** * Detects 3.4 version only unpacked on system * @@ -201,6 +231,20 @@ } } + + /** + * Detects 3.5 version only unpacked on system + */ + private void detectUnpacked3_5(){ + String ud = netbeansDir + fileSeparator+"3.5"; //NOI18N + File udF = new File(ud); + File udSys = new File(ud+fileSeparator+"system"); //NOI18N + File insF = new File(ud+fileSeparator+"install.properties"); //NOI18N + if(udF.exists() && udSys.exists()&& (!insF.exists())){ + detectedData.addElement(new String[]{"NetBeans IDE 3.5","","",ud,""}); //NOI18N + } + + } /** * Detects version older than 3.4 installed on Win platform(only v3.2.x and 3.3.x) * @@ -337,24 +381,28 @@ private void detectUnix(){ debug("detect unix"); //NOI18N + String ud32 =userHome + fileSeparator+"nbuser32"; //NOI18N String ud33 =userHome + fileSeparator+"nbuser33"; //NOI18N - File f32 = new File(ud32); - File f33 = new File(ud33); - File f32Sys = new File(ud32+fileSeparator+"system"); - File f33Sys = new File(ud33+fileSeparator+"system"); - if(f32.exists() && f32Sys.exists()){ + String udFFJ40 = userHome + fileSeparator+"ffjuser40"; //NOI18N + String udFFJ30 = userHome +fileSeparator+"ffjuser30"; //NOI18N + File f32Sys = new File(ud32+fileSeparator+"system"); //NOI18N + File f33Sys = new File(ud33+fileSeparator+"system"); //NOI18N + File fFFJ40Sys = new File(udFFJ40+fileSeparator+"system"); //NOI18N + File fFFJ30Sys = new File(udFFJ30+fileSeparator+"system"); //NOI18N + if(f32Sys.exists()){ detectedData.addElement(new String[]{"NetBeans IDE v3.2.x","","",ud32,""}); //NOI18N } - if(f33.exists() && f33Sys.exists()){ - detectedData.addElement(new String[]{"NetBeans IDE v3.3x","","",ud33,""}); //NOI18N + if(f33Sys.exists()){ + detectedData.addElement(new String[]{"NetBeans IDE v3.3.x","","",ud33,""}); //NOI18N + } + if(fFFJ40Sys.exists()){ + detectedData.addElement(new String[]{"Forte For Java v4.0/S1S4 upd1","","",udFFJ40,""}); //NOI18N } - /* if((initial_size == 0) &&(detectedData.size() > initial_size)){ - //were detected only older versions(3.3.x,3.2.x),skip upgrade panel - unable to detect - //install_dir - System.setProperty("showUpgradeInstall","no"); //NOI18N - System.setProperty("upgrade_nb","no"); //NOI18N - }*/ + if(fFFJ30Sys.exists()){ + detectedData.addElement(new String[]{"Forte For Java v3.0","","",udFFJ30,""}); //NOI18N + } + } /**