Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
2f41c401
Commit
2f41c401
authored
Dec 11, 2012
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix FreeRoute launcher Java executable path error on Windows (fixes lp:1087589)
parent
1886082f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
13 deletions
+48
-13
dialog_freeroute_exchange.cpp
pcbnew/dialogs/dialog_freeroute_exchange.cpp
+48
-13
No files found.
pcbnew/dialogs/dialog_freeroute_exchange.cpp
View file @
2f41c401
...
...
@@ -38,17 +38,16 @@
#include <dialog_freeroute_exchange.h>
#ifdef __WINDOWS__
#include <wx/msw/registry.h>
#endif
#define FREEROUTE_URL_KEY wxT( "freeroute_url" )
#define FREEROUTE_RUN_KEY wxT( "freeroute_command" )
/**********************************************************************/
void
PCB_EDIT_FRAME
::
Access_to_External_Tool
(
wxCommandEvent
&
event
)
/**********************************************************************/
/* Run an external tool (currently, only freeroute)
*/
{
DIALOG_FREEROUTE
dialog
(
this
);
dialog
.
ShowModal
();
...
...
@@ -69,7 +68,7 @@ DIALOG_FREEROUTE::DIALOG_FREEROUTE( PCB_EDIT_FRAME* parent ):
/* Specific data initiali
s
ation
/* Specific data initiali
z
ation
*/
void
DIALOG_FREEROUTE
::
MyInit
()
...
...
@@ -125,21 +124,59 @@ void DIALOG_FREEROUTE::OnImportButtonClick( wxCommandEvent& event )
*/
void
DIALOG_FREEROUTE
::
OnLaunchButtonClick
(
wxCommandEvent
&
event
)
{
wxString
FullFileName
=
FindKicadFile
(
wxT
(
"freeroute.jnlp"
)
)
;
wxString
url
;
wxString
command
;
wxFileName
fileName
(
FindKicadFile
(
wxT
(
"freeroute.jnlp"
)
),
wxPATH_UNIX
);
if
(
wxFileExists
(
FullFileName
)
)
if
(
fileName
.
FileExists
(
)
)
{
wxString
javaWebStartCommand
=
wxT
(
"javaws"
);
// Find the Java web start application on Windows.
#ifdef __WINDOWS__
// If you thought the registry was brain dead before, now you have to deal with
// accessing it in either 64 or 32 bit mode depending on the build version of
// Windows and the build version of KiCad.
// This key works for 32 bit Java on 32 bit Windows and 64 bit Java on 64 bit Windows.
wxRegKey
key
(
wxRegKey
::
HKLM
,
wxT
(
"SOFTWARE
\\
JavaSoft
\\
Java Web Start"
),
wxIsPlatform64Bit
()
?
wxRegKey
::
WOW64ViewMode_64
:
wxRegKey
::
WOW64ViewMode_Default
);
// It's possible that 32 bit Java is installed on 64 bit Windows.
if
(
!
key
.
Exists
()
&&
wxIsPlatform64Bit
()
)
key
.
SetName
(
wxRegKey
::
HKLM
,
wxT
(
"SOFTWARE
\\
Wow6432Node
\\
JavaSoft
\\
Java Web Start"
)
);
if
(
!
key
.
Exists
()
)
{
::
wxMessageBox
(
_
(
"It appears that the Java run time environment is not "
"installed on this computer. Java is required to use "
"FreeRoute."
),
_
(
"Pcbnew Error"
),
wxOK
|
wxICON_ERROR
);
return
;
}
key
.
Open
(
wxRegKey
::
Read
);
// Get the current version of java installed to determine the executable path.
wxString
value
;
key
.
QueryValue
(
wxT
(
"CurrentVersion"
),
value
);
key
.
SetName
(
key
.
GetName
()
+
wxT
(
"
\\
"
)
+
value
);
key
.
QueryValue
(
wxT
(
"Home"
),
value
);
javaWebStartCommand
=
value
+
wxFileName
::
GetPathSeparator
()
+
javaWebStartCommand
;
#endif
// Wrap FullFileName in double quotes in case it has C:\Program Files in it.
// The space is interpreted as an argument separator.
command
<<
wxT
(
"javaws"
)
<<
wxChar
(
' '
)
<<
wxChar
(
'"'
)
<<
FullFileName
<<
wxChar
(
'"'
);
command
<<
javaWebStartCommand
<<
wxChar
(
' '
)
<<
wxChar
(
'"'
)
<<
fileName
.
GetFullPath
()
<<
wxChar
(
'"'
);
ProcessExecute
(
command
);
return
;
}
command
=
m_FreerouteURLName
->
GetValue
()
+
wxT
(
"/java/freeroute.jnlp"
);
url
=
m_FreerouteURLName
->
GetValue
()
+
wxT
(
"/java/freeroute.jnlp"
);
wxLaunchDefaultBrowser
(
command
);
wxLaunchDefaultBrowser
(
url
);
}
...
...
@@ -179,5 +216,3 @@ void DIALOG_FREEROUTE::OnTextEditFrUrlUpdated( wxCommandEvent& event )
{
m_FreeRouteSetupChanged
=
true
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment