Author Topic: Determing AutoCAD install directory with Verticals present  (Read 6248 times)

0 Members and 1 Guest are viewing this topic.

wmtcadguy

  • Guest
Determing AutoCAD install directory with Verticals present
« on: January 08, 2009, 02:45:49 PM »
I've written an add-on in .NET to be used in plain Jane vanilla AutoCAD only.  I've also written an installer to add some entries to the registry so that my add-on loads at start up, pretty simply and straight forward.  All goes well when AutoCAD is the only application installed, but when verticals are present my application ends up being installed under whatever vertical was installed last.  Sometimes this is AutoCAD and sometimes it's not.  Is there any sure fire way to tell (by reading registry keys) where the AutoCAD application lives in the registry?

Thanks

Spike Wilbury

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #1 on: January 08, 2009, 02:54:26 PM »
Have you look into:

DynamicLinker Class ?

And read about:

ProductKey


Per ObjectARX docs...
Quote
acrxProductKey();

This function returns the registry path for the version of AutoCAD currently (or most recently) loaded.

HTH

wmtcadguy

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #2 on: January 08, 2009, 02:59:44 PM »
Yeah, that won't work for me.  Since C3D, ARCH, etc. are verticals to ACAD, which ever is loaded last is what acrxproductKey() returns.  I need to know where AutoCAD 200x is installed.  I'd like also not to have to update my installer everytime a new version of ACAD is rolled out.

sinc

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #3 on: January 08, 2009, 03:24:35 PM »
Well, the install directory is stored in HKLM\SOFTWARE\Autodesk\AutoCAD\{release}\ACAD-{version}\AcadLocation.

You still need to update your installer for each version, though (at least, if your product is designed to work with the new version), because the registry key changes with every version of every product...

Spike Wilbury

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #4 on: January 08, 2009, 03:43:32 PM »
Yeah, that won't work for me.  Since C3D, ARCH, etc. are verticals to ACAD, which ever is loaded last is what acrxproductKey() returns.  I need to know where AutoCAD 200x is installed.  I'd like also not to have to update my installer everytime a new version of ACAD is rolled out.

I see....

Here is something that might help...

http://through-the-interface.typepad.com/through_the_interface/2006/09/automatic_loadi.html

Spike Wilbury

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #5 on: January 08, 2009, 03:56:04 PM »
and this one

http://usa.autodesk.com/adsk/servlet/ps/item?siteID=123112&id=9120436&linkID=9240617

and use the above info to change the values of:

\\HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\releaseNum\
    ACAD-ProductID:LocaleID\

KewlToyZ

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #6 on: January 08, 2009, 04:08:18 PM »
%SystemDrive%\
?

wmtcadguy

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #7 on: January 08, 2009, 05:09:41 PM »
LE,
Thanks.  Wasn't exactly what I was after but it leads me to believe what I really want is not possible due to the poor structure autodesk uses for their implementation of verticals.  :-( 

Thanks for all your help.

sinc

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #8 on: January 08, 2009, 05:31:55 PM »
I'm not sure where you're getting hung up, but it seems like you should be able to do what you want...

Maybe it's the sort of thing where you need to check during your application initialization and see if "IsPureAcadProfile" == 1 in the currently-loaded Profile, and if so, start your app?  Not sure when they added "IsPureAcadProfile" to the registry entry for each profile, but it's in 2007 (the earliest I currently have installed on my machine).

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: Determing AutoCAD install directory with Verticals present
« Reply #9 on: January 08, 2009, 05:43:30 PM »
Determining what acad's are installed and the paths should be easy.
Check out:
HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R17.2
or change the last number as desired (17.0, 17.1...)for the three versions within a series.

The items in that key are constant no matter what funny business the person who installed it did.
Like, Civil 3D is ACAD-7000:409, the others have similar numbers so you should always be able to check on any settings for a given flavor of acad.
James Maeding

wmtcadguy

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #10 on: January 08, 2009, 06:35:54 PM »
Determining what acad's are installed and the paths should be easy.
Check out:
HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R17.2
or change the last number as desired (17.0, 17.1...)for the three versions within a series.

The items in that key are constant no matter what funny business the person who installed it did.
Like, Civil 3D is ACAD-7000:409, the others have similar numbers so you should always be able to check on any settings for a given flavor of acad.

The problem is basically that the .NET deployment project doesn't allow you to view all the keys under a key.  You have to know what's there already.  By looking at the value of

\HKEY_CUR_USER\SOFTWARE\Autodesk\AutoCAD\CurVer

I can get the next Key (17.1 or 17.2 in my case) by looking at the value of the CurVer key under that key I can get the latest installed vertical's key (6001:409, 7004:409, etc.).  The problem I have with this is I'm trying to write an enterprise wide solution and the enterprise I'm writing it for is not level set.  Some users have 2008 some 2009, some use english, some use spanish, etc.

The .NET deployment project is not robust enough to do manipulations on Registry keys read otherwise it'd be a quick and easy. 

Not to mention that everytime a new version of AutoCAD is put out to the enterprise somewhere I'll have to write a new installer. 

I basically agreed to some impractical requirements before I knew the whole story. 

MS and Autodesk need to come ask me about things like this before they run off and just do it.  :laugh:

KewlToyZ

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #11 on: January 09, 2009, 01:27:35 PM »
Yeah it has presented a major problem for NVIDIA CAD specific driver installations, they only work for Vanilla AutoCAD none of the verticals

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Determing AutoCAD install directory with Verticals present
« Reply #12 on: January 09, 2009, 01:34:11 PM »
Yeah it has presented a major problem for NVIDIA CAD specific driver installations, they only work for Vanilla AutoCAD none of the verticals
Odd, I just had my nVidia drivers ask me if I wanted to install the Autocad enhanced drivers for my newly installed Civil3D. They seem to work just fine....

KewlToyZ

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #13 on: January 12, 2009, 06:55:01 PM »
Maybe they updated the thing finally after a year of my whining?  :ugly:

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Determing AutoCAD install directory with Verticals present
« Reply #14 on: January 12, 2009, 07:25:12 PM »
Could be, these are the drivers dated Nov. 5, 2008

mcarson

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #15 on: January 14, 2009, 04:27:07 PM »
Yeah, that won't work for me.  Since C3D, ARCH, etc. are verticals to ACAD, which ever is loaded last is what acrxproductKey() returns.  I need to know where AutoCAD 200x is installed.  I'd like also not to have to update my installer everytime a new version of ACAD is rolled out.

Seen this a lot so far. What I have been doing recently, (as I don't have much experience with MSI) is building different installers for each product. This seems to be the best way forward, simply because any tools written in .NET are going to be targeted at the specific vertical product i.e. why install tools in AutoCAD MEP that have been spec'd for Civil3D

The ObjectArx 2008 documentation, I believe, provides documentation with regards to the registry keys you must add/edit in order to autoload or load-on-demand .NET assemblies. These keys are stored under HKEY_LOCAL_MACHINE. These keys are also the ones I update when new commands or assemblies are added/removed.

Locating the install directory, particularly when it is not the default is tricky (for me anyway), and up until now the last version ran (thanks jmaeding). If you are checking for the acad.exe, you could first check the default directory, then maybe ask the user to select the AutoCAD executable and take it from there (makes group policy installations impossible)

With the idea of not rebuilding your installer every time a new AutoCAD is released, would there not be problems with the versions of acmgd.dll ex cetera. I do develop for multiple versions of AutoCAD, and although it turns out to be more work and more documentation, the Visual Studio Solutions are separate. (any opinions would be good)

Hope I'm down the right track...

KewlToyZ

  • Guest
Re: Determing AutoCAD install directory with Verticals present
« Reply #16 on: January 20, 2009, 01:42:04 PM »
Would it help to iterate an if exists statement to go through
%UserProfile%\Application Data\Autodesk\Version Folders Here
For XP based installations?
Usually can bring up examples like:
C:\Documents and Settings\username.KTAGROUP\Application Data\Autodesk\ACD-MEP 2008
C:\Documents and Settings\username.KTAGROUP\Application Data\Autodesk\ACD-MEP 2009
C:\Documents and Settings\username.KTAGROUP\Application Data\Autodesk\AutoCAD 2007
C:\Documents and Settings\username.KTAGROUP\Application Data\Autodesk\3DSMAX
C:\Documents and Settings\username.KTAGROUP\Application Data\Autodesk\DWG TrueView 2009

I have my Vista based system at home so I don't have that direct path off the top of my head but I can run through that for the extra info to make it available for you as well?