TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: civil.eng on April 22, 2020, 01:39:08 AM

Title: autocad location
Post by: civil.eng on April 22, 2020, 01:39:08 AM
Hi all,
in a project with inno setup I need to get Acad.exe installed location. I tried with FileSearch but it doesn't work, I know we can find the path with windows registry, does anyone have information about it?
Title: Re: autocad location
Post by: BIGAL on April 22, 2020, 01:50:18 AM
Just look at the toolbar icon properties on the desktop for the location.
Title: Re: autocad location
Post by: civil.eng on April 22, 2020, 05:00:43 AM
Your way work only on my system, What about the other systems? I need to find location with any version of autocad and windows in inno setup.
Title: Re: autocad location
Post by: Dlanor on April 22, 2020, 07:04:51 AM
Try

Code - Auto/Visual Lisp: [Select]
  1. (findfile "acad.exe")
Title: Re: autocad location
Post by: roy_043 on April 22, 2020, 01:05:11 PM
Start digging from here:
HKEY_CLASSES_ROOT\.dwg
Title: Re: autocad location
Post by: civil.eng on April 22, 2020, 06:37:28 PM
Try

Code - Auto/Visual Lisp: [Select]
  1. (findfile "acad.exe")

This is not a logical solution,because FindFile method will search all file of system, while I think we can extract it from registry windows easily,
Title: Re: autocad location
Post by: Dlanor on April 22, 2020, 07:06:51 PM
Try

Code - Auto/Visual Lisp: [Select]
  1. (findfile "acad.exe")

This is not a logical solution,because FindFile method will search all file of system, while I think we can extract it from registry windows easily,

It's perfectly logical. AutoCAD knows where it is installed, and findfile will only search in the current AutoCAD search paths, one of which will be where it is installed.
Title: Re: autocad location
Post by: dgorsman on April 22, 2020, 08:17:05 PM
There is a registry key under HKLM which has the install location, you just need to look for it.
Title: Re: autocad location
Post by: snownut2 on April 22, 2020, 09:04:13 PM
EmiCad has a utility that runs from Innosetup, and ask user which instance on CAD to install for.  Works for both A AD and BricsCad.  I can get you details tomorrow, I use it very successfully.
Title: Re: autocad location
Post by: MP on April 22, 2020, 09:44:30 PM
It's perfectly logical.

^ this
Title: Re: autocad location
Post by: JohnK on April 22, 2020, 10:08:48 PM
Please note that amir0914 is using inno setup; not AutoCAD/Autolisp.
Title: Re: autocad location
Post by: MickD on April 22, 2020, 11:18:15 PM
For use in Inno Setup you will need to get it using some Pascal code in your installation script, the search below should have more than a few examples:

https://www.google.com/search?sxsrf=ALeKk03xnat1tX91QdpajD6ASPmiAs34FA%3A1587611629292&ei=7QehXpu7EYmO4-EP5MilkAQ&q=pascal+get+registry+value+inno+setup&oq=pascal+get+registry+value+inno&gs_lcp=CgZwc3ktYWIQARgAMggIIRAWEB0QHjoECAAQRzoGCAAQFhAeOgUIIRCgAVDTX1jpZ2CGdmgAcAJ4AIAB8gGIAboHkgEFMC40LjGYAQCgAQGqAQdnd3Mtd2l6&sclient=psy-ab

hope that helps
Title: Re: autocad location
Post by: MP on April 23, 2020, 09:43:44 AM
Please note that amir0914 is using inno setup; not AutoCAD/Autolisp.

Ahhh. Apologies to Amir. Findfile is the wrong tool outside AutoCAD; inside AutoCAD it would be totally legit.
Title: Re: autocad location
Post by: Dlanor on April 23, 2020, 01:42:07 PM
Please note that amir0914 is using inno setup; not AutoCAD/Autolisp.

Oops. My apologies. :opps: