Running multiple Toolkit versions

Discussion in 'C-Bus Toolkit and C-Gate Software' started by more-solutions, Jan 22, 2013.

  1. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    Is it possible to have multiple Toolkit versions installed on one PC?

    Installing to different directories seems to get me close but not quite there (1.11.6 seems to be starting up 1.12.5's C-Gate)
     
    more-solutions, Jan 22, 2013
    #1
  2. more-solutions

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    770
    Likes Received:
    21
    Location:
    Adelaide
    I'm afraid that's not supported out of the box but it can be done.

    STEPS

    1. Install the software versions you want. Ensure you select new and unique Toolkit and C-Gate directories for each version. Also make sure to de-select the C-Gate as a Service option.

    2. In each Toolkit directory, create a text file called setcgatepath.reg that contains the path for the corresponding C-Gate:

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Clipsal Integrated Systems\C-Gate\CurrentVersion]
    "PathToCGate"="C:\\Clipsal\\C-Gate2"
    
    3. Also in each Toolkit directory, create a CBusToolkit.bat file:
    Code:
    regedit /s cgatepath.reg
    CBusToolkit.exe
    
    4. Configure Toolkit preferences to always shut down C-Gate.

    Now all you have to do is remember to launch the batch file instead of the exe and use only one Toolkit at a time. If you have installed the matching S+, PICED etc versions as well, you can subsequently launch these too.

    With a little work on the scripts you can also set this up with C-Gate as a Service, by using the cgate.exe -stop" and "cgate.exe -start" parameters documented in the release notes.
     
    Last edited by a moderator: Jan 23, 2013
    daniel, Jan 23, 2013
    #2
  3. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    I don't mind messy!

    However, having followed your steps I'm not having much success. I have installed (in this order) 1.11.6 in C:\Clipsal\111\ and 1.12.5 in C:\Clipsal\112

    I have the registry files and batch files set up but I cannot get 1.11.6 to work. Trying to diagnose it, if I go into the C:\Clipsal\111\C-Gate2 directory and run cgate.exe manually, it starts C-Gate v2.9.5 (ie the one from 1.12.5). This is with the registry value correct, (checked with regedit, although I assume that only affects Toolkit, not C-Gate, anyway?). The file dates on my cgate.exe and cgate.jar look OK (16/04/10 and 28/04/11 respectively). cgate.lock and event logs get updated in C:\Clipsal\112\C-Gate2.

    It's definitely not installed as a service (in as much as it's not listed in Control Panel -> Services). I've uninstalled and reinstalled several times so if I'm doing something wrong I'm doing it consistently!

    It's as if Windows or Java is caching the 1.12.5 version and assuming that's what I want, although that sounds like nonsense to me. I'm testing on Win7 64-bit. I'm checking that java.exe is not showing in task manager between tests. When I run it from 111 task manager shows the image path name for java.exe as "C:\Windows\SysWOW64\java.exe", and when run from 112 it shows "C:\Clipsal\C-gate2\jre6\bin\java.exe"

    Suggestions? I'm beyond confused!
     
    more-solutions, Jan 23, 2013
    #3
  4. more-solutions

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    770
    Likes Received:
    21
    Location:
    Adelaide
    Ugh, sorry about that :( I overlooked that we had fixed cgate.exe in Toolkit 1.12 to launch the cgate.jar found in the same directory (before that, it would use the registry key). So the instructions only work for TK 1.12.x or later.

    For TK 1.11.x or earlier, I think you will need to bypass cgate.exe and explicitly launch the jar before running Toolkit so Toolkit does not try to start it:

    CBusToolkit.bat file:
    Code:
    cd C:\Clipsal\C-Gate2\
    start java -jar cgate.jar
    cd /d %~dp0
    start CBusToolkit.exe
    
    Hope that helps, if I've made any other errors please let me know!
     
    Last edited by a moderator: Jan 25, 2013
    daniel, Jan 25, 2013
    #4
  5. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    I'll admit to being confused by this paragraph; I don't understand why cgate.exe in the 111 directory would start cgate.jar in the 112 directory? I can't even get my head around why it would even know that it existed!

    However, I can confirm that:
    .. works perfectly, with the sole exception that java wasn't in my path so I had to specify the path to it (I used the one supplied by TK1.12).

    As far as I can tell, this method should also work reliably for starting TK1.12, which has the advantage of bypassing the RegEdit AUC "do you want to allow the following program to make changes to this computer" prompt.

    Incidentally, with 1.12 I get the UAC prompt on starting cgate, and cgate isn't shutdown when TK exists even though it's configured to do so. Neither was a problem with 1.11.
     
    more-solutions, Jan 25, 2013
    #5
  6. more-solutions

    ICS-GS

    Joined:
    Nov 1, 2004
    Messages:
    347
    Likes Received:
    0
    Location:
    SE Melbourne
    what about using a VM or XP mode? far easier...
     
    ICS-GS, Jan 29, 2013
    #6
  7. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    I do use VMs for lots of things, but when multiple versions co-exist happily (or almost happily, as is the case here now I have it working) I find that easier than creating a new VM each time a new version comes out. Particularly with something like C-Gate/TK where I need it to work over a PCI on a USB-serial interface. (Yes I know all that works in a VM, it's just not quite as simple.) It's also messier to manage backups on VMs than just backing up C:\Clipsal...

    And anyway, sometimes the hard way is just more fun :)
     
    more-solutions, Jan 29, 2013
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.