AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

Standing Alone with Acad Install


Although "ACAD Install" was primarily written to work in conjunction with "Inno Setup" - see "Custom Application Setups" -  it can also be used as a stand alone application. I find it particularly useful for configuring AutoCAD for a Network environment.

In a Network environment there is no need for a full blown installation application, as all of the support files, menu's, lisp files, etc. are already on the Network and are shared by each user. All we really require is a method of configuring AutoCAD to suit our Network paths. This is where "Acad Install" comes into play. So, let's have a look at setting up "Acad Install" to configure AutoCAD.


This is what our Network directory structure looks like :

Pretty straight forward hey? "Network_Install" is the directory folder containing all our support folders and files. You must remember that "AcadInst.exe" and "AcadInst.ini" must reside in the root folder of your Network directory structure. The files in this folder will look something like this :

As you can see from the file listing above, "AcadInst"can now be renamed so that multiple installers can coexist in same directory. The .ini file name should match .exe name (AcadInst_1.exe/AcadInst_1.ini/AcadInst_2.exe/AcadInst_2.ini,...) 

Any partial Menu must also reside in this folder as I haven't yet discovered a way to refer to a menu residing in a sub-folder.

Okay, time to have a look at the "AcadIns.ini" file :

[PRODUCT]

Name=AfraLisp 2004 Custom Menu
;This is the applications name. This value is required and AcadInst.exe
; will display an error message if it is not included.


[AUTOCAD]

Versions=R16.0
;Comma-delimited string representing the versions of AutoCAD
; for which the application can/will* be installed.
;Valid strings are any key found under 
;HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD in the registry. 
;When left empty all profiles that match the other criteria are included. 
;To avoid all versions enter NONE.
;Examples for AutoCAD are R14.0 for R14, R15.0 for 2000, 
;2000i, & 2002, and R16.0 for 2004
;Examples for LT are R5.0 for LT98, R2000 for LT 2000, 
;R7 for LT 2000i, and R8 for LT2002

AddPath=< InstallPath >\Admin|1;< InstallPath >\Lib2004|2;
               < InstallPath >\Lisp2004|3;< InstallPath >\Sym2004|4
;Semi-colon delimited list of PATH|POSITION to add to the 
;AutoCAD search path. To insert the path at the beginning use a 
;POSITION of 1. If the POSITION is not specified, the path will be 
;appended to the end. 
;If the path is already part of the search path it will not be added again.
;You can use < InstallPath > to indicate the path the user installed to.
;Using this you can also add paths relative to the path where the user 
;installed, for example
;< InstallPath >\Symbols:2 would add a sub-folder of the installed path 
;named Symbols as the second entry ;in the support paths list. 


[MENU]

MenuGroups=AFRALISP:AFRALISP:1:50
;Comma-delimited string of MENUGROUP:MENUFILE:POP:POSITION 
;(without extensions) to be added to the Menu key for the profiles. 
;The registry is searched and the first available Group number is used. 
;If POSITION ;is greater than the number of installed pop menus, 
;then it will be added to the end. To insert at the beginning 
;use 1. To insert at the end use some large number like 50. 
;If the POP and POSITION numbers are not included 
;then no drop-down menu is installed for that menu.

;Example: 
;MenuGroups=MyMainMenu:MyMenuFile:1:3,MyOtherMenu:MyMenuFile
 
;will setup MyMainMenu and MyOtherMenu from MyMenuFile to be 
;loaded when AutoCAD starts up. 
;POP1 menu from MyMainMenu will be placed as the third AutoCAD 
;menu and MyOtherMenu will not be ;placed as a POP menu.

Toolbars=AFRALISP.LAYMAN
;Comma-delimited string of MENUGROUP.TOOLBAR pairs to be 
;added to the AutoCAD GUI. If the user has previously closed one
;of the toolbars it will be forced to show itself again after
;running installer.


[APPLOAD]

StartupSuite=< InstallPath >\Lisp2004\doslib2004.arx,
                      < InstallPath >\Lisp2004\cerror.vlx
;A comma-delimited string of files (with ext) to be added to 
;AutoCAD's Startup Suite. 
;Only valid for post-R14, non-LT installations. 

History=< InstallPath >\Lisp2004\doslib2004.arx,
             < InstallPath >\Lisp2004\cerror.vlx
;A comma-delimited string of files (with ext) to be added to 
;the Appload dialog's History list. 
;Only valid for post-R14, non-LT installations. 

;For both of these keys you must use < InstallPath > to insert the user 
;specified path when appropriate. 
;See the AddPath= key for more information.


[NEWPROFILE]
Name=AfraLisp
;Name for the new profile. If it already exists, 
;the rest of the keys are skipped. 
;A profile will be created for all AutoCAD apps specified in the 
;[AUTOCAD] and [AUTOCAD LT] sections. 

Description=AfraLisp 2004 Menu Profile.
;Description of New Profile
CopyFrom=< CURRENT >
;Copy from the current profile to retain existing configurations
MakeDefault=T
;Make it the default Profile

DesktopShortcut=T
;Add a shortcut to the desktop
ShortcutName=AfraLisp 2004 Menu Profile
;Shortcut Name
ShortcutComment=AfraLisp 2004 Menu Profile
;Tooltip
ShortcutArgs=/p "AfraLisp"
;the arguments on startup
ShortcutWorkingDir=< InstallPath >\Admin
;the working directory


[<PROFILE>General]

TemplatePath=< STRING >< InstallPath >\Tplts
;Template File Path

Do you notice how we make use of <InstallPath> to indicate the path the user installed to. Using this you can also add paths relative to the path where the user installed, for example <InstallPath>\Symbols|2 would add a sub-folder of the installed path named Symbols as the second entry in the support paths list.

Right, that's everything set up and ready. Double click on "AcadInst-admin.ini" and see what happens :

Would we like to install our custom menu. Of course we would!! Press "Yes."

Now it's asking us what Profile would we like to base our new Profile on, and which of our Installed AutoCAD versions would we like to install too. Pick a Profile, any will do and then select "OK."

Mmmm, nothing really seemed to happen??
Don't worry, plenty did it's just that it all happened so fast.

Have a look at your desktop :

Ha, ha, we have a new desktop icon. Right-click on the icon and select "Properties" and then the "Shortcut" tab :

Mmm, interesting!! Our "Target" arguments have been set, and our "Start In" directory has been configured. Okay, now fire up AutoCAD.

A new Toolbar should appear looking like this :

This is getting more and more interesting. Now choose "Tools" - "Options" -"Files" and have a look at your support path :

Good, our Support Paths have been added.

And the Template File Path? Well let's have a look:

Yep, there it is. Now choose the "Profiles" tab :

Yippee, it's there. Now where has our menu gone? Check out your menu bar :

Great, our pull down menu has also been loaded.

But didn't we ask for some files to be loaded in the Startup Suite? Let's have a wee look :

Yep, there are bet are they  in our History List ?


Okay, that's our installation complete, but what happens when we want to uninstall?
To uninstall you can run it from the command line (Start->Run) passing -U as the single parameter :

Or you can do something like the following in a .bat file to uninstall :

ECHO OFF
CLS
ECHO Uninstalling from AutoCAD
PAUSE
AcadInst.exe -U
ECHO Files Uninstalled!
PAUSE

If you would like to download all the files involved in this tutorial then please feel free to click on this spot here.

 

 
The AutoLisp/Visual Lisp/VBA Resource Website

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website