Win 7 to Win 8 => no system() anymore...
-
Hey!
I have a strange problem again...
I switched from Windows 7 to Windows 8. Now, I would like to start my external Java application, but without success!
UI.messagebox "a" output = system("java -jar Model2GCode.jar") UI.messagebox "b"
"a" and "b" is shown normally in the UI.messagebox. But no command line!
When I started the jar-file manually in the command line, it works...
Do you have an idea, what's different in Windows 8?
I thank you very much for your help!
-
I have a Win8 machine at home. Do you have a complete example to test that works under Win7 but not Win8?
-
That is good to know (there is not yet official Win8 support, but this needs to be tested and considered). I'm curious to know whether this happens to other users who have Windows 8?
I've experienced under different circumstances that the
system()
command didn't work (maybe it is more likely to break). (although it should work 99+%)
A reliable method is also to write the command to a batch file and launch the batch file withUI.openURL("/path/to/file.bat")
UI.openURL doesn't support arguments. So the arguments go into the batch file which Windows recognizes as executable because of its file extension. -
Have you tried
system(
java -jar Model2GCode.jar)
Have you also tried this
pwd=Dir.pwd Dir.chdir(Model2GCodeJarsFolder) system(
java -jar Model2GCode.jar) Dir.chdir(pwd)
to ensure it finds the .jar file ? -
@tig said:
Have you tried
system(
java -jar Model2GCode.jar)
Have you also tried this
pwd=Dir.pwd Dir.chdir(Model2GCodeJarsFolder) system(
java -jar Model2GCode.jar) Dir.chdir(pwd)
to ensure it finds the .jar file ?So, at first: thank you very much for your help!
I tried follow things:
odir=Dir.pwd Dir.chdir(File.dirname(__FILE__)) output = system("java -jar Model2GCode.jar")) Dir.chdir(odir)
odir=Dir.pwd Dir.chdir(File.dirname(__FILE__)) output = system('java -jar Model2GCode.jar')) Dir.chdir(odir)
odir=Dir.pwd Dir.chdir(File.dirname(__FILE__)) output = system('java -jar ' + File.join(File.dirname(__FILE__), 'Model2GCode.jar')) Dir.chdir(odir)
@Thom: Should I send you this jar-File? It would be great, if you can test it on your machine!
One other idea:
- since Win 8, I'm not able to edit the plugin files with my editor, just in admin mode (arg)
- so I think, Win 8 increased the "security levels" => could it be: for the ruby application it is not allowed anymore to start the command line?
Thanks a lot!
-
@aerilius said:
UI.openURL("/path/to/file.bat")
Ahh, I remember - you told me this method some month ago! Thanks for this hint! I will try it at home...
And in the bat file I will write just: java -jar Model2GCode.jar ?
So, if I can write the bat file with ruby, then I can insert very easily the arguments into it...
-
@niccah said:
- since Win 8, I'm not able to edit the plugin files with my editor, just in admin mode (arg)
- so I think, Win 8 increased the "security levels" => could it be: for the ruby application it is not allowed anymore to start the command line?
You're editing your plugins directly from the Plugins folder?
The thing is, Windows doesn't want the user to modify anything with the Program Files folders. It's reserved for application installers only.
I keep my plugins in a Dropbox folder, so they keep in sync between computers. I then add a .rb file in the Plugins folder that adds that folder to the $LOAD_PATH array and then loops over all the rb and rbs files to load them. That way I'm working on my plugins in a location where I have full permissions.
-
@thomthom said:
that adds that folder to the $LOAD_PATH array
I never stop learning! Thanks, I will try it...
Using Win 7, editing the files wasn't a big problem...
-
@thomthom said:
I keep my plugins in a Dropbox folder, so they keep in sync between computers. I then add a .rb file in the Plugins folder that adds that folder to the $LOAD_PATH array and then loops over all the rb and rbs files to load them. That way I'm working on my plugins in a location where I have full permissions.
Could you please post how that file looks in its entirety? I would like to get that to work for me as well.
-
@pixero said:
@thomthom said:
... I then add a .rb file in the Plugins folder that adds that folder to the
$LOAD_PATH
array and then loops over all the rb and rbs files to load them. That way I'm working on my plugins in a location where I have full permissions.Could you please post how that file looks in its entirety? I would like to get that to work for me as well.
@Pixero, and anyone else.. I have already posted such a script, ready-made for you to modify with your custom paths, be it a dropbox or just folders in your "user/documents" path (which you will always have full permissions to.)
In addition, it adds an autoload feature that looks for sub-directories named "
%(#408000)[!_autoload]
", in ALL of the$LOAD_PATH
directories, and if found, will callrequire
on any loadable files it finds.I do this because this way you KNOW what files (in those custom paths,) will be automatically loading.
Here's the link: [Code] !autoload.rb loads "!_autoload" folders
Advertisement