wtorek, 9 kwietnia 2013

Multiple Visum licences -> Multiple COM Objects

Problem:
Well, that's kind of a problem when you have many Visum licences and you want to use them variantly via COM.
By default latest installation is available under: ("Visum.Visum") key in registry and any new installation of Visum overwrites previous keys.
When you have may licences (Uni, Commercial, Teaching, etc.) it becomes confusing.
There's an option "Register as COM server" under "Options/Options" in Visum GUI - but it doesn't work for me.
So what's the solution?:
You simply run your Visum125.exe with '/regserver' flag from the command line - that's it. Below I created a small wrapper for my multiple licences:

import os   
def register_Visum(nazwa):
    def regVisum(path):
        command = "cd " + path + "& " + "Visum125.exe /regserver"       
        print command
        os.system(command)
       
    licencedict = {"edu_GN": "C:\Program Files (x86)\PTV_Vision\VISUM125_student_GN\Exe\ " ,
            "edu_45min": "C:\Program Files (x86)\PTV_Uni\VISUM125\Exe\ ",
            "PK": "C:\Program Files\PTV_Vision\VISUM125\Exe\ "}
   
    regVisum(licencedict[nazwa])
 
register_Visum("edu_GN")
register_Visum("edu_45min")
register_Visum("PK")


It will save a lot of my time and nerves now
PS. Another issue would be to register them under different names, ie. "Visum.Visum.Uni", "Visum.Visum.Commercial" - but I believe that's compiled within dll / exe and I won't have access to this, unless PTV exposes it.

Brak komentarzy:

Prześlij komentarz