HKLM\SOFTWARE\Autodesk\AutoCAD\Rxx.x\ACAD-xxxx:xxx

HKLM\SOFTWARE\Autodesk\AutoCAD\Rxx.x\ACAD-xxxx:xxx

rkmcswain
Mentor Mentor
805 Views
7 Replies
Message 1 of 8

HKLM\SOFTWARE\Autodesk\AutoCAD\Rxx.x\ACAD-xxxx:xxx

rkmcswain
Mentor
Mentor

Greetings.

I've been using this for probably 10+ years to grab the install location for AutoCAD from the registry.

 

(vl-registry-read 
  (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) 
"ACADLOCATION"
)

 

Every version I can check today, returns the install path withOUT the trailing slash except for 2023. For some reason 2023 includes the trailing slash.  Anyone else run across this?

 

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2023\\"

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2022"

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2021"

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2020"

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2019"

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2018"

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2017"

Command: (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ACADLOCATION")
"C:\\Program Files\\Autodesk\\AutoCAD 2016"
R.K. McSwain     | CADpanacea | on twitter
0 Likes
806 Views
7 Replies
Replies (7)
Message 2 of 8

paullimapa
Mentor
Mentor

Your observations are absolutely correct.

Perhaps it's time to use this function to check instead:

(vl-filename-directory(findfile "acad.exe"))


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 8

ronjonp
Mentor
Mentor

Confirmed here too. 2022 no trailing \\ 2023.1 trailing \\.

Message 4 of 8

Jeff_M
Consultant
Consultant

@rkmcswain this is not a lisp issue, it is returning exactly what is in the Registry. The \ is now a part of that registry entry, thanks Autodesk! 🙄

2022-07-29_7-45-03.jpg2022-07-29_7-44-38.jpg

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 5 of 8

rkmcswain
Mentor
Mentor

Oh, I'm fully aware it's not an autolisp issue @Jeff_M .  I was hoping someone could figure out why the programmer made this decision?!  It's not a show stopper, I can work around it, but I always ask "WHY" when changes like this are made.

 

I will admit, I did not search the change log to see if this was documented.

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 6 of 8

Sea-Haven
Mentor
Mentor

"why the programmer made this decision"

 

We could start another post about this and not necessarily Acad, but those linked to Acad in some way. Recent experience "not working".

 

0 Likes
Message 7 of 8

Civil3DReminders_com
Mentor
Mentor

This feels like a style preference. It might be the former junior programmer was taught you always to add a slash at the end. The senior programmer told them don't include it, without an explanation. Then the senior retires or quits, and the now senior developer now has their opportunity to have that slash as their style preference indicates. 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 8 of 8

rkmcswain
Mentor
Mentor

Agreed @Civil3DReminders_com - it's just another line of code for us.

 

No worries. Just wish it was documented so we didn't find out like we did.

R.K. McSwain     | CADpanacea | on twitter
0 Likes