aik099/PhpStormProtocol

Remove "//E:JScript"

Closed this issue · 11 comments

O my PC win10 x64 it only worked when I removed the "//E:JScript" part from the .reg file.

@="wscript \"C:\\Program Files\\PhpStorm Protocol (Win)\\run_editor.js\" \"%1\" //E:JScript"

O my PC win10 x64 it only worked when I removed the "//E:JScript" part from the .reg file.

@="wscript \"C:\\Program Files\\PhpStorm Protocol (Win)\\run_editor.js\" \"%1\" //E:JScript"

What was your error before the removal? The "//E:JScript" part is for forcing the use of standard .js engine in case user has reassigned .js files handler in windows and shouldn't cause errors itself.

The //E: argument of wscript command specifies scripting engine (the JScript in this case).

According to https://en.wikipedia.org/wiki/Windows_Script_Host#Available_scripting_engines this is a valid value.

@jsvini , please try running below command (same as in "run_editor.reg" file, but with escaping removed) and post a result:

wscript "C:\Program Files\PhpStorm Protocol (Win)\run_editor.js" "%1" //E:JScript

@aik099 that line worked for me. I also had to update the run_editor.js with the current version of phpstorm and everything worked like a charm. Thanks!
image

@amacsmith , could you please send a PR with proposed changes and an explanation of them. I can't commit the picture you've posted.

Sorry, let me explain, I had to update the settings.folder_name to my installed version/name of PhpStorm. It may be useful to scan through the Programs folder look for the JetBrains folder and find a folder name that starts with PhpStorm x.y.z. and capture that as the folder name or else I feel people will need to edit this file to get it working if they don't have the same version installed as what is in the repo.
image
image

@amacsmith , that part of the installing instructions on Windows in the README.md already. Thanks for pointing that out anyway.

Yep that is why I mention. However, it seems as though it may be getting over looked quite a bit. Hence, why it might be a good idea to search the directory for the PhpStorm folder by the prefix 'PhpStorm' and update that settings object accordingly. That way users don't have to manually do it and people don't over look the documentation. Only a recommendation.

... However, it seems as though it may be getting over looked quite a bit. ...

@amacsmith , if you recommend changing phrasing in README.md to make it more clear, that unless you fix this it won't work by default, then PR's are also welcome.

Will do

I also think the line

    // Set to folder name, where PhpStorm was installed to (e.g. 'PhpStorm')
    folder_name: 'PhpStorm 2017.1.4',

should be shipped without a PhpStorm version hardcoded. So the end-user knows they need to update it. An example could be like this:

    // Set to folder name, where PhpStorm was installed to (e.g. 'PhpStorm')
    folder_name: <PhpStorm folder where the phpstorm.exe is located>,

I can create a PR for that as well.

PR #35 was created. I've reviewed it.