RE: COM problem .py versus .exe

Discussion in 'Python' started by Tim Golden, Jun 29, 2005.

  1. Tim Golden

    Tim Golden Guest

    [Greg Miller]
    | Unfortunately I have a "fire" to put out with a patch to the existing
    | machine code, I'll get back to looking into the problem a
    | little later.
    | Thanks very much for you assistance with this! I really didn't look
    | into the GetFileVersionInfo, can I assume that is a cytypes function?

    No, it's a function in the win32api module of the pywin32 extensions.
    (Although I imagine you could wrap it via ctypes, if you felt that
    way inclined). Did my earlier post make it through to the newsgroup/Google?
    It came through on the mailing list. Just in case, here is the code again:

    <code>
    import os, sys
    import win32api

    dll_filepath = os.path.join (sys.exec_prefix, "python24.dll")
    for k, v in win32api.GetFileVersionInfo (dll_filepath, "\\").items ():
    print k, "=>", v

    </code>

    Good luck with the firefighting.
    TJG

    ________________________________________________________________________
    This e-mail has been scanned for all viruses by Star. The
    service is powered by MessageLabs. For more information on a proactive
    anti-virus service working around the clock, around the globe, visit:
    http://www.star.net.uk
    ________________________________________________________________________
    Tim Golden, Jun 29, 2005
    #1
    1. Advertising

  2. Tim Golden

    Greg Miller Guest

    I didn't see the earlier post, thanks for the resend. The firefighting
    is just about over, I have to find the machine owner to get permission
    to try the code. Then back to the dll version battle. If I can keep
    away from dealing with the ctypes code I will. I'll see how this works
    for me. Thanks again.
    Greg Miller, Jun 29, 2005
    #2
    1. Advertising

  3. Tim Golden

    Greg Miller Guest

    I tried the code snippet using win32api.GetFileVersionInfo(), what I
    get now is the following when running on the executable machine:

    .. . . FileFlagsMask => 63
    FileType => 2
    FileVersionMS => 65536
    FileVersionLS => 1
    Signature => -17890115
    FileSubtype => 0
    FileFlags => 0
    ProductVersionLS => 1
    FileDate => None
    ProductVersionMS => 65536
    FileOS => 4
    StrucVersion => 65536

    when I used the wmib.py code on the desktop the return value was a
    string "1, 0, 0, 1".
    I then parsed through it substituting and removing spaces to come up
    with a version string of "1.0.0.1". Do those values correspond to the
    FileVersionLS, FileSubtype, FileFlags, and ProductVersionLS in the
    above output? I can't find too much on the 'net about these output
    values.
    Greg Miller, Jun 29, 2005
    #3
  4. Tim Golden

    Tim G Guest

    Greg Miller wrote:
    > I tried the code snippet using win32api.GetFileVersionInfo(), what I
    > get now is the following when running on the executable machine:
    >
    > . . . FileFlagsMask => 63
    > FileType => 2
    > FileVersionMS => 65536
    > FileVersionLS => 1
    > Signature => -17890115
    > FileSubtype => 0
    > FileFlags => 0
    > ProductVersionLS => 1
    > FileDate => None
    > ProductVersionMS => 65536
    > FileOS => 4
    > StrucVersion => 65536


    > I can't find too much on the 'net about these output values.


    >From the pywin32 help entry for GetFileVersionInfo:


    "Information to return: \\ for VS_FIXEDFILEINFO"

    Google for VS_FIXEDFILEINFO and hit "I'm Feeling Lucky". You've
    still got to work out how to piece the values together, but I'm
    sure you're just as capable of doing that as I am. (And probably
    more so).

    TJG
    Tim G, Jun 29, 2005
    #4
  5. Tim Golden

    Greg Miller Guest

    Thanks for the information, I stumbled across that page yesterday. It
    seems all the problems with this are solved. The executable works just
    like the Python version. Now I have to come up with an algorithm to
    parse through the output data to come up with the version numbers.
    Thanks for all your time. It's been a good learning experience for me.
    Now on with the project............................Greg
    Greg Miller, Jun 30, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden
    Replies:
    1
    Views:
    6,906
    Scott M.
    Oct 11, 2003
  2. Russ

    script versus code versus ?

    Russ, Jun 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,493
  3. Greg Miller

    COM problem .py versus .exe

    Greg Miller, Jun 27, 2005, in forum: Python
    Replies:
    0
    Views:
    278
    Greg Miller
    Jun 27, 2005
  4. Christoffer Sawicki
    Replies:
    5
    Views:
    249
    Christoffer Sawicki
    Sep 2, 2006
  5. Paul Butcher
    Replies:
    12
    Views:
    701
    Gary Wright
    Nov 28, 2007
Loading...

Share This Page