This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 32292
Collapse All | Expand All

(-)src/org/netbeans/installer/actions/DetectAction.java (-17 / +65 lines)
Lines 128-134 Link Here
128
                readDir(netbeansDir);
128
                readDir(netbeansDir);
129
            }
129
            }
130
            initial_size = detectedData.size();
130
            initial_size = detectedData.size();
131
            detectOlderThan3_4();
131
            detectOlderThanThis();
132
            detectUnpacked3_5();
132
            detectUnpacked3_4();
133
            detectUnpacked3_4();
133
            if(detectedData.size() > 0){
134
            if(detectedData.size() > 0){
134
                setDetected(true);
135
                setDetected(true);
Lines 175-190 Link Here
175
        }
176
        }
176
    }
177
    }
177
    
178
    
178
    
179
    private void detectOlderThanThis(){
179
    private void detectOlderThan3_4(){
180
        osName = System.getProperty("os.name"); //NOI18N
180
        osName = System.getProperty("os.name"); //NOI18N
181
        if(osName.indexOf("Windows") != -1){
181
        if(osName.indexOf("Windows") != -1){
182
            detectWin(" \"HKEY_CURRENT_USER\\Software\\netbeans.org\\NetBeans IDE\\3.3\"","3.3");   //NOI18N
182
            detectWin(" \"HKEY_CURRENT_USER\\Software\\netbeans.org\\NetBeans IDE\\3.3\"","3.3");   //NOI18N
183
            detectWin(" \"HKEY_CURRENT_USER\\Software\\netbeans.org\\NetBeans IDE\\3.2\"","3.2");   //NOI18N
183
            detectWin(" \"HKEY_CURRENT_USER\\Software\\netbeans.org\\NetBeans IDE\\3.2\"","3.2");   //NOI18N
184
            //for Forte and $1$                        
185
            detectSierraOrion();    //S1S4 upd1,FFJ40              
186
            detectPilsen();         //FFJ30          
184
        }else
187
        }else
185
            detectUnix();
188
            detectUnix();  //needs change because of FFJ and S1S!!!
189
    }
190
        
191
    private void detectSierraOrion(){
192
        //both use the same userdir
193
        String userdir = getWin32RegValue("\"HKEY_CURRENT_USER\\Software\\Sun Microsystems, Inc.\\Forte For Java\\CE\\4.0\"","UserDir"); //NOI18N
194
        if(userdir == null) //nor sierra nor orion detected
195
            return;
196
        File sysDir = new File(userdir.trim()+fileSeparator+"system"); //NOI18N
197
        if(!sysDir.exists())
198
            return;        
199
        String installdir = getWin32RegValue("\"HKEY_LOCAL_MACHINE\\SOFTWARE\\Sun Microsystems\\Forte(tm) for Java(tm), ce\\4\"","path"); //NOI18N
200
        if(installdir != null)
201
            detectedData.addElement(new String[]{"Sun One Studio 4 upd1","","",userdir.trim(),""});//NOI18N
202
        else
203
            detectedData.addElement(new String[]{"Forte For Java 4.0","","",userdir.trim(),""});//NOI18N
204
        
186
    }
205
    }
187
    
206
    
207
    private void detectPilsen(){
208
        String userdir = getWin32RegValue("\"HKEY_CURRENT_USER\\Software\\Sun Microsystems, Inc.\\Forte For Java\\3.0\"","UserDir"); //NOI18N
209
        if(userdir == null) //nor sierra nor orion detected
210
            return;
211
        File sysDir = new File(userdir.trim()+fileSeparator+"system"); //NOI18N
212
        if(!sysDir.exists())
213
            return;
214
        detectedData.addElement(new String[]{"Forte For Java 3.0","","",userdir.trim(),""});//NOI18N
215
    }
216
        
217
    
188
    /**
218
    /**
189
     * Detects 3.4 version only unpacked on system
219
     * Detects 3.4 version only unpacked on system
190
     *
220
     *
Lines 201-206 Link Here
201
        }
231
        }
202
        
232
        
203
    }
233
    }
234
    
235
    /**
236
     * Detects 3.5 version only unpacked on system
237
     */
238
    private void detectUnpacked3_5(){
239
        String ud = netbeansDir + fileSeparator+"3.5";   //NOI18N        
240
        File udF = new File(ud);
241
        File udSys = new File(ud+fileSeparator+"system"); //NOI18N        
242
        File insF = new File(ud+fileSeparator+"install.properties"); //NOI18N
243
        if(udF.exists() && udSys.exists()&& (!insF.exists())){
244
            detectedData.addElement(new String[]{"NetBeans IDE 3.5","","",ud,""}); //NOI18N
245
        }
246
        
247
    }
204
    /**
248
    /**
205
     * Detects version older than 3.4 installed on Win platform(only v3.2.x and 3.3.x)
249
     * Detects version older than 3.4 installed on Win platform(only v3.2.x and 3.3.x)
206
     *
250
     *
Lines 337-360 Link Here
337
    private void detectUnix(){
381
    private void detectUnix(){
338
        debug("detect unix");   //NOI18N
382
        debug("detect unix");   //NOI18N
339
        
383
        
384
        
340
        String ud32 =userHome + fileSeparator+"nbuser32";   //NOI18N
385
        String ud32 =userHome + fileSeparator+"nbuser32";   //NOI18N
341
        String ud33 =userHome + fileSeparator+"nbuser33";   //NOI18N
386
        String ud33 =userHome + fileSeparator+"nbuser33";   //NOI18N
342
        File f32 = new File(ud32);
387
        String udFFJ40 = userHome + fileSeparator+"ffjuser40";      //NOI18N   
343
        File f33 = new File(ud33);
388
        String udFFJ30 = userHome +fileSeparator+"ffjuser30";       //NOI18N
344
        File f32Sys = new File(ud32+fileSeparator+"system");
389
        File f32Sys = new File(ud32+fileSeparator+"system");        //NOI18N
345
        File f33Sys = new File(ud33+fileSeparator+"system");
390
        File f33Sys = new File(ud33+fileSeparator+"system");        //NOI18N        
346
        if(f32.exists() && f32Sys.exists()){
391
        File fFFJ40Sys = new File(udFFJ40+fileSeparator+"system");  //NOI18N
392
        File fFFJ30Sys = new File(udFFJ30+fileSeparator+"system");  //NOI18N
393
        if(f32Sys.exists()){
347
            detectedData.addElement(new String[]{"NetBeans IDE v3.2.x","","",ud32,""}); //NOI18N
394
            detectedData.addElement(new String[]{"NetBeans IDE v3.2.x","","",ud32,""}); //NOI18N
348
        }
395
        }
349
        if(f33.exists() && f33Sys.exists()){
396
        if(f33Sys.exists()){
350
            detectedData.addElement(new String[]{"NetBeans IDE v3.3x","","",ud33,""});  //NOI18N
397
            detectedData.addElement(new String[]{"NetBeans IDE v3.3.x","","",ud33,""});  //NOI18N
398
        }                
399
        if(fFFJ40Sys.exists()){
400
            detectedData.addElement(new String[]{"Forte For Java v4.0/S1S4 upd1","","",udFFJ40,""});  //NOI18N
351
        }
401
        }
352
     /*   if((initial_size == 0) &&(detectedData.size() > initial_size)){
402
        if(fFFJ30Sys.exists()){
353
            //were detected only older versions(3.3.x,3.2.x),skip upgrade panel - unable to detect
403
            detectedData.addElement(new String[]{"Forte For Java v3.0","","",udFFJ30,""});  //NOI18N
354
            //install_dir
404
        }       
355
            System.setProperty("showUpgradeInstall","no");                           //NOI18N
405
  
356
            System.setProperty("upgrade_nb","no");                                  //NOI18N
357
        }*/
358
    }
406
    }
359
    
407
    
360
    /**
408
    /**

Return to bug 32292