Tuesday, October 15, 2013

How to know what service pack is installed for AutoCAD

The easiest way to see if and what service pack is installed for AutoCAD or any vertical is to check the About dialog box. Either use the ABOUT command or select About from this dropdown at the top right of AutoCAD.

And in the About dialog box the Product Version will be seen showing in this case:
Product Version: I.108.0.0, AutoCAD 2014 SP1

To find out which service packs have been applied to your Autodesk software, you can also use the Windows control panel for uninstalling and changing programs.

  • For Windows XP, click the Windows Start menu Control Panel Add/Remove Programs Show Updates.
  • For Windows 7, click the Windows Start menu Control Panel Programs and Features View Installed Updates.
  • For Windows 8, right-click the Windows Start screen (or use the swipe up gesture from the bottom edge while on the Start screen). Click All Apps Windows System Control Panel Programs and Features Uninstall a Program View Installed Updates.
    Alternatively open File Explorer and on the Computer ribbon tab click on Uninstall or change a program followed by View installed updates.
  • For Windows 8.1, right-click on the Windows Start menu Control Panel Programs Programs and Features View installed updates.
    Alternatively open File Explorer and on the Computer ribbon tab click on Uninstall or change a program followed by View installed updates.

Another way is to use _Vernum, an undocumented system variable that has been around for long and could be used to identify the product version and if a service pack is installed or not. Programmers and CAD managers have often used this in AutoLISP code.

_Vernum for AutoCAD 2014 without SP1 is I.18.0.0 (UNICODE)

_Vernum for AutoCAD 2014 after installation is I.108.0.0 (UNICODE)

But what if having AutoCAD Architecture 2014 installed side by side? If AutoCAD 2014 SP1 is installed and AutoCAD Architecture 2014 has no SP1 installed _Vernum will show I.108.0.0 (UNICODE).

Once up on a time the _Vernum for verticals were different but because the verticals since AutoCAD 2013 are installed in the same place as vanilla AutoCAD _Vernum can not be used to reliably identify if a service pack is installed or not. For a better way read further.

Other related tips to figure out info about the installed product and finally the solution.

Command: ACADVER
ACADVER = "19.1s (LMS Tech)" (read only)

Command: UILOCALE
UILOCALE = "en-US" (read only)
The above is a new system variable in AutoCAD 2014.

(getvar 'PRODUCT)
Result: "AutoCAD"

(vla-get-caption (vlax-get-acad-object))
Result: "Autodesk AutoCAD 2014 - NOT FOR RESALE - [Drawing1.dwg]"

(vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ProductName")
Result: "AutoCAD 2014 - English"

(vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "ProductNameGlob")
Result: "AutoCAD 2014"

(vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)) "Release")
Result: "19.1.18.0"
The above will show the release number without the service pack added.

This will only work for AutoCAD 2013 or newer:

(setq reg (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)))
(setq LocaleidLen (strlen (vl-registry-read reg "Localeid")))
(setq reg (strcat (substr reg 1 (- (strlen reg) LocaleidLen 1)) "\\Service Packs"))
(setq reg (strcat reg "\\" (car (vl-registry-descendents reg))))
(setq PatchTitle (vl-registry-read reg "PatchTitle"))
(setq Release (vl-registry-read reg "Release"))
Result example for AutoCAD:
PatchTitle="AutoCAD 2014 SP1" and Release="19.1.108.0"
Result example for AutoCAD Architecture:
PatchTitle="AutoCAD Architecture 2014 SP 1" and Release="7.5.106.0"

This last example shows the programmers way to get what service pack is installed for the current AutoCAD product.

3 comments:

  1. Hi, is there any reason that this wouldn't work in Civil 3D 2019? I am getting an "; error: bad argument type: stringp nil" after the (setq reg (strcat reg "\\" (car (vl-registry-descendents reg)))) line..?
    Regards.

    ReplyDelete
  2. You might not have any service pack installed.

    ReplyDelete
  3. I found that replacing "\\Service Packs" with "\\ProductInfo" gives me something close to the PatchTitle that I could then cut down to give me the following;
    For AutoCAD="AutoCAD 2019.1.2"
    For Civil 3D="Civil 3D 2019.2 Update"

    ReplyDelete

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.