2
* Created on Apr 16, 2004
3
* Created by Paul Gardner
4
* Copyright (C) 2004, 2005, 2006 Aelitis, All Rights Reserved.
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
* AELITIS, SAS au capital de 46,603.30 euros
19
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
23
package org.gudy.azureus2.platform.win32.access.impl;
30
import java.net.InetAddress;
32
import org.gudy.azureus2.platform.PlatformManagerPingCallback;
43
AEWin32Access access = AEWin32Manager.getAccessor();
45
String app_data = access.getUserAppData();
47
System.out.println( "AppData = " + app_data );
49
String az_home = access.getApplicationInstallDir("azureus");
51
File az_exe = new File( az_home + File.separator + "Azureus.exe" ).getAbsoluteFile();
53
if ( az_exe.exists()){
55
//<Nolar> WriteRegStr HKCR ".torrent" "" "BitTorrent"
56
//<Nolar> WriteRegStr HKCR "BitTorrent" "" "Bittorrent File"
57
//<Nolar> WriteRegStr HKCR "BitTorrent\shell" "" "open"
58
//<Nolar> WriteRegStr HKCR "BitTorrent\DefaultIcon" "" $INSTDIR\Azureus.exe,1
59
//<Nolar> WriteRegStr HKCR "BitTorrent\shell\open\command" "" '"$INSTDIR\Azureus.exe" "%1"'
60
//<Nolar> WriteRegStr HKCR "BitTorrent\Content Type" "" "application/x-bittorrent"
62
System.out.println( "current = " +
63
access.readStringValue(
64
AEWin32Access.HKEY_CLASSES_ROOT,
65
"BitTorrent\\shell\\open\\command",
68
access.deleteKey( AEWin32Access.HKEY_CLASSES_ROOT,
71
access.deleteKey( AEWin32Access.HKEY_CLASSES_ROOT,
75
access.writeStringValue( AEWin32Access.HKEY_CLASSES_ROOT,
80
access.writeStringValue(
81
AEWin32Access.HKEY_CLASSES_ROOT,
86
access.writeStringValue(
87
AEWin32Access.HKEY_CLASSES_ROOT,
92
access.writeStringValue(
93
AEWin32Access.HKEY_CLASSES_ROOT,
94
"BitTorrent\\DefaultIcon",
96
az_exe.toString() + ",1" );
98
access.writeStringValue(
99
AEWin32Access.HKEY_CLASSES_ROOT,
100
"BitTorrent\\shell\\open\\command",
102
"\"" + az_exe.toString() + "\" \"%1\"" );
104
access.writeStringValue(
105
AEWin32Access.HKEY_CLASSES_ROOT,
106
"BitTorrent\\Content Type" ,
108
"application/x-bittorrent" );
112
System.out.println( "can't find Azureus.exe");
116
//AEWin32AccessInterface.copyPermission( "C:\\temp\\fred", "C:\\temp\\bill" );
119
AEWin32AccessImpl.getSingleton( false ).traceRoute(
120
InetAddress.getByName( "192.168.1.143" ),
121
InetAddress.getByName( "www.google.com"),
122
new PlatformManagerPingCallback()
130
System.out.println( distance + ": " + address + " - " + millis );
136
// AEWin32AccessInterface.ping( "www.google.com" );
138
}catch( Throwable e ){
2
* Created on Apr 16, 2004
3
* Created by Paul Gardner
4
* Copyright (C) 2004, 2005, 2006 Aelitis, All Rights Reserved.
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
* AELITIS, SAS au capital de 46,603.30 euros
19
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
23
package org.gudy.azureus2.platform.win32.access.impl;
30
import java.net.InetAddress;
32
import org.gudy.azureus2.platform.PlatformManagerPingCallback;
43
AEWin32Access access = AEWin32Manager.getAccessor();
45
String app_data = access.getUserAppData();
47
System.out.println( "AppData = " + app_data );
49
String az_home = access.getApplicationInstallDir("azureus");
51
File az_exe = new File( az_home + File.separator + "Azureus.exe" ).getAbsoluteFile();
53
if ( az_exe.exists()){
55
//<Nolar> WriteRegStr HKCR ".torrent" "" "BitTorrent"
56
//<Nolar> WriteRegStr HKCR "BitTorrent" "" "Bittorrent File"
57
//<Nolar> WriteRegStr HKCR "BitTorrent\shell" "" "open"
58
//<Nolar> WriteRegStr HKCR "BitTorrent\DefaultIcon" "" $INSTDIR\Azureus.exe,1
59
//<Nolar> WriteRegStr HKCR "BitTorrent\shell\open\command" "" '"$INSTDIR\Azureus.exe" "%1"'
60
//<Nolar> WriteRegStr HKCR "BitTorrent\Content Type" "" "application/x-bittorrent"
62
System.out.println( "current = " +
63
access.readStringValue(
64
AEWin32Access.HKEY_CLASSES_ROOT,
65
"BitTorrent\\shell\\open\\command",
68
access.deleteKey( AEWin32Access.HKEY_CLASSES_ROOT,
71
access.deleteKey( AEWin32Access.HKEY_CLASSES_ROOT,
75
access.writeStringValue( AEWin32Access.HKEY_CLASSES_ROOT,
80
access.writeStringValue(
81
AEWin32Access.HKEY_CLASSES_ROOT,
86
access.writeStringValue(
87
AEWin32Access.HKEY_CLASSES_ROOT,
92
access.writeStringValue(
93
AEWin32Access.HKEY_CLASSES_ROOT,
94
"BitTorrent\\DefaultIcon",
96
az_exe.toString() + ",1" );
98
access.writeStringValue(
99
AEWin32Access.HKEY_CLASSES_ROOT,
100
"BitTorrent\\shell\\open\\command",
102
"\"" + az_exe.toString() + "\" \"%1\"" );
104
access.writeStringValue(
105
AEWin32Access.HKEY_CLASSES_ROOT,
106
"BitTorrent\\Content Type" ,
108
"application/x-bittorrent" );
112
System.out.println( "can't find Azureus.exe");
116
//AEWin32AccessInterface.copyPermission( "C:\\temp\\fred", "C:\\temp\\bill" );
119
AEWin32AccessImpl.getSingleton( false ).traceRoute(
120
InetAddress.getByName( "192.168.1.143" ),
121
InetAddress.getByName( "www.google.com"),
122
new PlatformManagerPingCallback()
130
System.out.println( distance + ": " + address + " - " + millis );
136
// AEWin32AccessInterface.ping( "www.google.com" );
138
}catch( Throwable e ){