.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Convert [InstallDir] to directory

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
BrentBurgess1980
804 Views, 4 Replies

Convert [InstallDir] to directory

Hi All,
Is there a way I can convert the [InstallDir] to a proper directory path (C:\Program Files\Autodesk\Autocad <Year>)?

I know RoamableRootPrefix is found as a system variable, but can't find anything for installdir.

Cheers,
Brent
4 REPLIES 4
Message 2 of 5
kdub_nz
in reply to: BrentBurgess1980

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

For me Returns:

"C:\\Program Files\\Autodesk\\AutoCAD 2019"

 

This matches :

Command: (findfile "ACAD.exe")
"C:\\Program Files\\Autodesk\\AutoCAD 2019\\ACAD.exe"

 

Hope this helps

Regards,


// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Message 3 of 5
moogalm
in reply to: BrentBurgess1980

@kdub_nz gave two lisp variants to fetch you ACAD install dir.

 

 

If this is what you want in >NET

 

ACADLOCATION

 

 

Message 4 of 5
kdub_nz
in reply to: moogalm

Either of these options work

return (string)rk.GetValue("AcadLocation");

OR

return (string)rk.GetValue("Location");

The shorter parameter was added for AutoCAD 2000 or AutoCAD 2002 if memory serves.

The code posted by Gilles should work well for your requirements without AutoCAD running.

 

I'm not sure of the value held by 'CurVer'. Check to ensure if works as expected if the last version run is not the latest installed. 

 madhukar may be able to assist with that query.

 

Regards,

 


// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Message 5 of 5
kdub_nz
in reply to: kdub_nz

 

I have just checked the value of 'CurVer' after opening differing builds of AutoCAD.

 

The value held represents the Version of the most recent build opened, NOT the version of the latest install.

 

I'd be interested in knowing the value held immediately after a new install, before that build is run.

I'd guess that the value would be the version of the last build opened.

 

Regards,


// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report