Install lisp for installing multiple files

Install lisp for installing multiple files

Sea-Haven
Mentor Mentor
493 Views
4 Replies
Message 1 of 5

Install lisp for installing multiple files

Sea-Haven
Mentor
Mentor

Having the need to provide multiple lisp, dcl, icons and menu files in a simple install method the following is a simple way around it. It uses 2 files "install.lsp" and a "ZIP" file the zip contains all the required files, in the back door of windows is a way to unzip a file to a directory. This is a windows command but it can be called from a lisp.

 

So say you send a email with the 2 files the end user just saves them some where, "Downloads etc" a simple drag and drop or a appload of the install.lsp and the install is ran including loading the menu nad setting support paths.

 

So this install makes a directory on c: drive, using getfiled you select the zip, the rest is auto completed. The zip is xxxx-AlanH-Dec-2021.zip in this example. The menu is a cuix of a POP menu other menu types could be added.

 

(defun xxxxinstall ( / *files* filename newpath oldtrust paths menu_path menu_name Group_name)
(vl-load-com)
(vl-mkdir "c:\\xxxx-CAD-TOOLS")

(setq filename (getfiled "Select the File \"xxxx-AlanH-Dec-2021\"" "" "ZIP" 16))

; unzip
(startapp (strcat "powershell -command Expand-Archive -Path '" filename "' -DestinationPath 'C:/xxxx-CAD-TOOLS'"))
(alert "programs unzipped to C:/xxxx-CAD-TOOLS")

(setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-Acad-object))))
(setq paths (vla-get-SupportPath *files*))
(if (wcmatch  paths "*xxxx*")
(princ)
(vla-put-SupportPath *files* (strcat "C:\\xxxx-CAD-TOOLS" ";" paths))
)

(if  (> (vl-string-search  "BricsCAD" (getvar 'acadver)) 0)
(princ "Bricscad") 
(progn
(setq oldtrust (getvar 'trustedpaths))
(setvar 'trustedpaths (strcat oldtrust ";" "c:\\xxxx-CAD-TOOLS"))
)
)

(alert "\nSupport paths added")

(setq Menu_Path "C:\\xxxx-CAD-TOOLS\\"); Path to Menu file
(setq Menu_Name "xxxx-CAD-TOOLS"); pop menu to load
(setq Group_Name "xxxxMENU"); groupname assigned in .mnu or .mns file

(if (menugroup menu_Name)
(command "_MENUUNLOAD" menu_Name)
)

(setq cnt (vla-get-count(vla-get-menuGroups (vlax-get-acad-object))))
(command "MENULOAD" (strcat Menu_Path Menu_Name))
(menucmd (strcat "P" (rtos cnt 2 0) "=+" menu_Name ".POP1"))

(alert "\n Menu loaded \n \n xxxx AlanH programs now installed")

)
(xxxxinstall)

 

 

0 Likes
494 Views
4 Replies
Replies (4)
Message 2 of 5

john.uhden
Mentor
Mentor

But what if I already have a support path "xxxxx-Uhden?" 😜

John F. Uhden

0 Likes
Message 3 of 5

Sea-Haven
Mentor
Mentor

Hi John it does check

(if (wcmatch  paths "*xxxx*")
(princ)

 

It was done as I could not find a suitable installer for the amount I do.

 

0 Likes
Message 4 of 5

martti.halminen
Collaborator
Collaborator

Why not just pack the whole stuff into a single .VLX file, and extract the stuff programmatically into the correct locations without the recipient needing to do anything?

0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

When doing commercial work you do what the customer wants, I knew some one would ask what about VLX, I could have made a fas/vlx and so on also. The agreement is to provide open code and it is for one customer only. BUt they have multiple sites. It is very much setup for them.  Other code I have is provided as fas or vlx as its a more commercial product and it has security built in, no phone calls "installed and not working" because they gave it to a friend, calls end very quick. 

 

The menu is in the zip, future updates would just require a unzip and load a new menu as the directory already exists.

 

Lastly I have a contract maybe not worth paper written on, but can only be used by one company. 

 

0 Likes