Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBC Can't Handle Program Files Space... #234

Open
P0pzi opened this issue Oct 28, 2023 · 4 comments
Open

IBC Can't Handle Program Files Space... #234

P0pzi opened this issue Oct 28, 2023 · 4 comments

Comments

@P0pzi
Copy link

P0pzi commented Oct 28, 2023

What a nightmare.

StartTWS.bat

set TWS_MAJOR_VRSN=1025
set CONFIG=%USERPROFILE%\Documents\IBC\config.ini
set TRADING_MODE=
set TWOFA_TIMEOUT_ACTION=exit
set IBC_PATH=%PROGRAMFILES%\Interactive Brokers\IBC
set TWS_PATH=%PROGRAMFILES%\Interactive Brokers\twsOffline
set TWS_SETTINGS_PATH=
set LOG_PATH=%IBC_PATH%\Logs
set TWSUSERID=
set TWSPASSWORD=
set JAVA_PATH=C:\Program Files\Common Files\i4j_jres\Oda-jK0QgTEmVssfllLP\1.8.0_202\bin
set HIDE=

I had to manually specify the JAVA_PATH because IBC couldn't find it on it's own........
The java version is the "hidden version" packaged up by TWS.

This is the output of the log file I'm getting

Arguments:

TWS version = 1025
Program = TWS
Entry point = ibcalpha.ibc.IbcTws
/TwsPath = C:\Program Files\Interactive Brokers\twsOffline
/TwsSettingsPath = 
/IbcPath = C:\Program Files\Interactive Brokers\IBC
/Config = C:\Users\Popzi\Documents\IBC\config.ini
/Mode = 
/JavaPath = C:\Program Files\Common Files\i4j_jres\Oda-jK0QgTEmVssfllLP\1.8.0_202\bin
/User =
/PW =
/FIXUser =
/FIXPW =

=================================

Generating the classpath
Classpath=C:\Program;Files\Interactive;C:\Program Files\Interactive Brokers\twsOffline\1025\.install4j\i4jruntime.jar;C:\Program Files\Interactive Brokers\IBC\IBC.jar

Generating the JAVA VM options
The system cannot find the file C:\Program.
Java VM Options= -Dtwslaunch.autoupdate.serviceImpl=com.ib.tws.twslaunch.install4j.Install4jAutoUpdateService -Dchannel=latest -Dexe4j.isInstall4j=true -Dinstall4jType=standalone -DjtsConfigDir=C:\Program Files\Interactive Brokers\twsOffline

Finding autorestart file
ERROR: The system cannot find the file specified.

autorestart file not found

Determining the location of java.exe 
Location of java.exe=C:\Program Files\Common Files\i4j_jres\Oda-jK0QgTEmVssfllLP\1.8.0_202\bin

Starting IBC with this command:
"C:\Program Files\Common Files\i4j_jres\Oda-jK0QgTEmVssfllLP\1.8.0_202\bin\java.exe" -cp  "C:\Program;Files\Interactive;C:\Program Files\Interactive Brokers\twsOffline\1025\.install4j\i4jruntime.jar;C:\Program Files\Interactive Brokers\IBC\IBC.jar"  -Dtwslaunch.autoupdate.serviceImpl=com.ib.tws.twslaunch.install4j.Install4jAutoUpdateService -Dchannel=latest -Dexe4j.isInstall4j=true -Dinstall4jType=standalone -DjtsConfigDir=C:\Program Files\Interactive Brokers\twsOffline  ibcalpha.ibc.IbcTws "C:\Users\Popzi\Documents\IBC\config.ini"  

Error: Could not find or load main class Files\Interactive
Program has exited
Error level is 1
Check for 2FA dialog timed out
Check for login dialog display timeout
Check for restart
call :GetAutoRestartOption
Finding autorestart file
ERROR: The system cannot find the file specified.

autorestart file not found
Normal exit

TWS finished at 28/10/2023 13:09:05.12

IBC running TWS 1025 has finished at 28/10/2023 13:09:05.13```

Seemingly IBC can't handle spaces in system path strings?
Installation has been rather painful, what else am "I" doing wrong?

And no, I'm not moving TWS to It's default and messy installation path of C:\jts

@P0pzi P0pzi changed the title ICB Can't Handle Program Files Space... IBC Can't Handle Program Files Space... Oct 28, 2023
@rlktradewright
Copy link
Member

If you follow the instructions usinf the defaults, installation is very quick and totally painless, so the nightmare is partly of your own making.

Having said that, there's a handful of places in the .bat scripts files where variables need surrounding quotes to prevent problems when some paths contain spaces. Once they're fixed it works fine. I was hoping to get corrected files to you tonight, but I've just got one more such issue to correct, and it's getting rather late here in the UK, so I'll leave that for tomorrow.

While I understand your desire to comply with the 'standard' locations for program files etc on Windows, there are good reasons whiy I didn't use C:\Program Files as the default location. The difficulties you've encountered getting it installed (quite apart from the script faults) are exactly those reasons. The fact is that IBKR's installers are not geared for installing in that location, and doing it myself today to mirror your setup was a good reminder of the problems.

Since the IBKR installer and IBC defaults make it trivial to install everything, and since i don't want to spend my time explaning to people how to do it the 'proper' way, which would simply generate a huge support load for me, I've never bothered with working through all this before, hence the undiscovered bugs.

So I will finish fixing these script errors and let you have them as soon as they're done, probably tomorrow.

In the meantime, I would seriously suggest you do the easy thing and just follow the instructions in the User Guide without changing any locations, so that at least you have a working system. All you have to do is:

  1. Install TWS in the default location.
  2. Unzip the IBC zip file into C:\IBC.
  3. Copy config.ini into your app data.
  4. Edit TWS_MAJOR_VRSN if need be.
  5. Adjust the settings in config.ini as required.
  6. Done!

Whe you get the corrected scripts, it'll be easy enough to switch over to your desired configuration.

@rlktradewright
Copy link
Member

I've attached a zip containing updated StartIBC.bat and DisplayBannerAndLaunch.bat files.

Put these in the scripts subfolder. Hopefully all should work well now (it does for me with the same folder structures as you).

I'll include these in the next release, and I'll also push them to the repository.

windowsscripts.zip

@choperlizer
Copy link

choperlizer commented Jul 25, 2024

I've attached a zip containing updated StartIBC.bat and DisplayBannerAndLaunch.bat files.

Put these in the scripts subfolder. Hopefully all should work well now (it does for me with the same folder structures as you).

I'll include these in the next release, and I'll also push them to the repository.

windowsscripts.zip

Close, but still not working.
This was really not written for non default install locations.

Only way i found was renaming the TWS folder to version number minus dot.
[somepath]/tws -> [somepath]/1028
Making a link from tws to 1028 or viceversa didnt work via old mklink.

Power Shell as admin cmd:
New-Item -Path -ItemType SymbolicLink -Value

This might work.

@rlktradewright
Copy link
Member

You say Close, but still not working.

Can you provide some evidence of this? In particular, attach your IBC log file so I can see what's happening.

I just tested it by moving the Jts and IBC folders to C:\Program Files, and changing the StartTWS.bat file settings like this:

set TWS_MAJOR_VRSN=1019
set CONFIG=%USERPROFILE%\Documents\IBC\config.ini
set TRADING_MODE=
set TWOFA_TIMEOUT_ACTION=exit
set IBC_PATH=C:\Program Files\IBC
set TWS_PATH=C:\Program Files\Jts
set TWS_SETTINGS_PATH=
set LOG_PATH=C:\IBC\Logs
set TWSUSERID=
set TWSPASSWORD=
set JAVA_PATH=
set HIDE=

So both TWS and IBC run from C:\Program Files. It worked fine, as far as displayig the TWS login form: I couldn't complete the login because both my live and paper accounts are in use on another machine.

Note that you have to run StartTWS.bat from an elevated command prompt or Powershell, because both programs need write access to the directory they're running from.

I cannot make any sense at all of most of your post. There's absolutely no need to make any links or 'rename the TWS folder' (whatever that is supposed to mean).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants