Author Topic: Run once on numerous machines  (Read 2610 times)

0 Members and 1 Guest are viewing this topic.

Rod

  • Newt
  • Posts: 185
Run once on numerous machines
« on: January 31, 2012, 09:36:22 PM »
I am about to write a lisp that will check if there any update lisps to run and run them

For example
- add some new lisp the the appload startup suite
- check something for me and write it to a log file

I am currently thinking of having a folder \lisps\updates with files update001.lsp update002.lsp. The program will read from the registry which update lisp is current, look for it, if it is present run it, log whether it worked or not, then change the registry value to look for the next routine.

Any other ideas, on a similar way to implement this. Does anyone have anything similar already written?

Regards Rod
"All models are wrong, some models are useful" - George Box

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Run once on numerous machines
« Reply #1 on: January 31, 2012, 09:44:31 PM »
You could use setenv/getenv. Just use the same variable (eg. "CompanyName_Update") and assign the value to be the date of update implementation. If the user's (getenv "CompanyName_Update") doesn't match the date, run the update and use (setenv "CompanyName_Update" "2012.01.31") to change value so the updates won't run again.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Run once on numerous machines
« Reply #2 on: January 31, 2012, 09:45:04 PM »
I use xcopy ... See if this will help you
 www.theswamp.org/index.php?topic=39415.msg446782#msg446782

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Chris

  • Swamp Rat
  • Posts: 548
Re: Run once on numerous machines
« Reply #3 on: February 01, 2012, 08:49:38 AM »
The way I have my office set up is to all load a common lisp file from the network, it loads everything necessary (also on the network).  If I want to push an update, I add it to that file and it updates everyone the next time they open a drawing.  I even wrote in a back door routine that will allow me to update a program during a session without the need to reopen the current drawing (from that user's machine). 

I have found that it is best to avoid using the startup suite.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Run once on numerous machines
« Reply #4 on: February 01, 2012, 10:49:59 AM »
I use registry entries to keep track of my "run once" routines, one section under HKCU for those needed per user and one under HKLM for those needed per machine.  Part of the standard start-up routine is to check the contents of various Autoload folders against the registry entries and run those that are not in the registry.  Not everything needs to be run every time at startup e.g. replacing a local data file for a third-party application, those that do are handled as part of the start-up system.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Run once on numerous machines
« Reply #5 on: February 01, 2012, 11:12:21 AM »
My updates only occur when the user logs on. Checking every time a drawing opens seems a bit over the top. But I guess if you write a date to check and compare current, then it will only run once that day anyways  :-D.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Run once on numerous machines
« Reply #6 on: February 01, 2012, 02:06:15 PM »
My updates only occur when the user logs on. Checking every time a drawing opens seems a bit over the top. But I guess if you write a date to check and compare current, then it will only run once that day anyways  :-D.

I considered date-specific checking, but we have a high staff turnover plus have to deal with users at site, on holidays, etc. so keying stuff to run on a certain date looked to be too much of a hassle.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

cmwade77

  • Swamp Rat
  • Posts: 1449
Re: Run once on numerous machines
« Reply #7 on: February 01, 2012, 04:49:56 PM »
The way I have my office set up is to all load a common lisp file from the network, it loads everything necessary (also on the network).  If I want to push an update, I add it to that file and it updates everyone the next time they open a drawing.  I even wrote in a back door routine that will allow me to update a program during a session without the need to reopen the current drawing (from that user's machine). 

I have found that it is best to avoid using the startup suite.
This is how we do ours as well, although we don't have the backdoor option.

Chris

  • Swamp Rat
  • Posts: 548
Re: Run once on numerous machines
« Reply #8 on: February 02, 2012, 07:57:41 AM »
My updates only occur when the user logs on. Checking every time a drawing opens seems a bit over the top. But I guess if you write a date to check and compare current, then it will only run once that day anyways  :-D.
I dont think that it necessarily checks much of anything, we dont really have any user dependent lisp files, everybody gets the same stuff and uses it on the network, so there are no copies to be updated, there is just one set of programs that are always current and up-to-date.  There are a couple of things we have that are local, but I used vl-file-systime to determine if the network version is newer, and if so, overwrite the local file.  Our CHM help is that way, windows security wont let you run it from the network, so we have a local copy on each computer.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

Chris

  • Swamp Rat
  • Posts: 548
Re: Run once on numerous machines
« Reply #9 on: February 02, 2012, 08:00:58 AM »

This is how we do ours as well, although we don't have the backdoor option.
the backdoor option is pretty simple to implement, in the main startup program I added
(defun c:override (/)
(load "override.lsp")
)
then in the override.lsp, if there is an update that I need to introduce on the fly, I add a line
(load "myupdatedlisp.fas")

you type in override at any computer and it will reload the updated lisp.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

Clina

  • Guest
Re: Run once on numerous machines
« Reply #10 on: February 02, 2012, 09:28:47 AM »
a guess,

Why do not use acad.lsp ?

Rod

  • Newt
  • Posts: 185
Re: Run once on numerous machines
« Reply #11 on: February 02, 2012, 05:23:29 PM »
Thanks everyone I think I will use acad.lsp for the update check and HKLM and HKCU for the storing of the current update.
Regards Rod
"All models are wrong, some models are useful" - George Box