[C#] Office Detection Not Working

Discussion in 'Mixed Languages' started by CODYQX4, Oct 20, 2012.

  1. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #1 CODYQX4, Oct 20, 2012
    Last edited: Apr 12, 2019
    .
     
  2. BobSheep

    BobSheep MDL Guru

    Apr 19, 2010
    2,330
    1,377
    90
    #2 BobSheep, Oct 20, 2012
    Last edited: Oct 20, 2012
    In function GetOfficeName you should search in descending versions order, 14.0 first then lower. I had 2007 and installed 2010. The reg key InstallRoot is still present for 12.0. Your code will skip out when 12.0 is detected before 14.0 can be checked.

    I meant 15.0 then lower. But you understood ayway.
     
  3. Pr3acher

    Pr3acher MDL Member

    Aug 24, 2012
    143
    48
    10
    #3 Pr3acher, Oct 20, 2012
    Last edited: Oct 20, 2012
    Hi, i think the bug is that you're using return for each detection. Try to use something else than a return to get office version. Actually if many versions were installed, somes keys could have been kept in the registry and the prog will return at the first key it has detected. I dont know if what i said can help you cuz i use to code C/C++ WinApi not C#...
    You can try a bool for each version and change em to 1 if detected: 0 not detected 1: detected
     
  4. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #4 CODYQX4, Oct 20, 2012
    Last edited: Apr 12, 2019
    (OP)
    .
     
  5. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #5 CODYQX4, Oct 20, 2012
    Last edited: Apr 12, 2019
    (OP)
    .
     
  6. ThorndikePDF

    ThorndikePDF MDL Novice

    Mar 11, 2013
    2
    0
    0
    I support trying to use something else than a return to get office version, using code in c# is a little difficult, you need be patient.