Automated deployment

Started by honkinberry, January 21, 2010, 10:17:40 AM

Previous topic - Next topic

honkinberry

We have an existing AutoCAD application, with thousands of users across the globe.
I've finally started transitioning our dialog boxes to OpenDCL (don't laugh!  I had to wait until Bricscad support was there).

Does anyone have any ideas on the most painless (and automated) way to deploy the Runtime to users?
I was thinking something along the lines, of if the (command "_OPENDCL") fails, then it could download the msi and run it automatically?  But not really sure how to tell if the OPENDCL command exists, maybe it makes more sense to look for a Registry value?  Any suggestions on this?
Thanks so much for any assistance.

--Jeremiah

owenwengerd

You could check for the existence of the registry value at HKLM\Software\OpenDCL\RootFolder (or HKLM\Software\Wow6432Node\OpenDCL\RootFolder on x64 systems).

honkinberry

It seems that's only for OpenDCL Studio.
For Runtime, it seeks HKLM + (vlax-product-key) + Applications + OpenDCL + Loader
would be more appropriate, correct?
could then grab the arx/brx filename, and check against (arx) to see if it loaded successfully.

--J

owenwengerd


honkinberry

So I ended up with this little function to automate the loading of the library, and downloading and installing of OpenDCL and our .odcl file.  If anyone wants any of the referenced functions let me know.
Code (autolisp) Select

;;; ------------------- OPENDCL -------------------------
(defun fx:OPENDCL (forcereload / arxfile destfile)
; standard call is (fx:OPENDCL t) in the beginning of a function under development
; forcereload will reload the odcl file
; once function is beyond test phase, call should be changed to (fx:OPENDCL nil)
; alternately can be placed in general startup, as (fx:OPENDCL "STARTUP")
;   in which case failure to load will not cause hard exit on error
; will download and install OpenDCL as necessary

; first, look for regkey, which will give us file to load, and proof of install
(setq arxfile (vl-registry-read
(strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key) "\\Applications\\OpenDCL") "Loader"
) ; vl-reg-read
destfile (strcat MENULOC "Administration\\OpenDCL.msi") ; in case need to dl and install
) ; setq

(if arxfile ; it's installed, but is it loaded
(progn
(setq arxfile (strcase arxfile t) ; (arx) list is lower case
arxfile (substr arxfile (1+ (strlen (vl-filename-directory arxfile)))) ; further it's only filename
) ; setq
(if (not (member arxfile (arx)))
(command "_OPENDCL")
; @@ but if that failed for whatever reason, a (type dcl_Project_Load) could be our flag
) ; if
(dcl_Project_Load "designfx" (if forcereload t nil))
) ; progn

; not loaded, let's install!
(if (c:CONFIRM_BOX #FX0466) ; an additional library is required, download it now?
(progn
; well we can be pretty certain he doesn't have the odcl file either
(if (fx:DOWNLOADFILE (strcat "designfx-" _FXLANGUAGE ".odcl") (strcat MENULOC "designfx.odcl"))
(if (fx:DOWNLOADFILE "opendcl.msi" destfile)
(startapp (strcat "msiexec /i " destfile))
; otherwise accept his error
) ; if
; otherwise accept his error
) ; if
; msiexec is out of process, so we just pop outta here
(if (/= forcereload "STARTUP") (exit))
) ; progn
; nothing to do other than bounce
(if (/= forcereload "STARTUP") (exit))
) ; if
) ; if
(princ)
) ; OPENDCL
;;; -----------------------------------------------------


BazzaCAD

Is (fx:DOWNLOADFILE) downlaoding "opendcl.msi" from your site?
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

honkinberry

Correct.
An obvious upgrade would be to query SourceForge for the latest filename and download from there, but this way was clearly more expedient.   ;)

--J

BazzaCAD

You could point it to the following URL's:

http://opendcl.com/go?runtime (Stable build)
http://opendcl.com/go?runtime&dev (Development build)

& it will download the current build for each.

But note that if your code\product is relaying on some functionality, that functionality could change in the future (hopefully not). So downloading the runtime from your site, that you know works with your code\product maybe the way to go...
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

owenwengerd

Quote from: honkinberry on January 25, 2010, 12:29:02 PM
An obvious upgrade would be to query SourceForge for the latest filename and download from there, but this way was clearly more expedient.   ;)

I think installing it from an internal network is safer, and overall a better approach in most cases.

honkinberry

This is excellent, I like the idea of not having to keep updating a cache of the most recent version, didn't know about the go?runtime link, thanks.

The routine does download it to an internal network location, and runs it from there.

Thanks so much for all the help!

--J