AutoHotkey Community

It is currently May 25th, 2012, 3:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: April 17th, 2007, 4:14 pm 
I have an executable written in AHK sitting on a network drive...I have multiple users that run this executable from that network drive. Now, when I make enhancements/fix bugs with the program and try to put the updated version into that network folder, it wont' let me b/c the program is currently running. Is there a way to suspend the program and throw my updated version out there, then reload the script without the users ever knowing?

Any suggestions would be greatly appreciated.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 4:56 pm 
I have seen exactly the same question some time ago...
Perhaps it is worth searching the forum, although finding the right keywords can be hard...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 5:07 pm 
[unlock file]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 6:08 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8647
Location: Salem, MA
I have done something like this at work, and have a hack that works for me. I basically have the program checking for a trigger on the network drive (which is another script that is compiled), then the program exits on everyone's computer, and runs the trigger script, which waits for a second trigger (which is a second compiled script) that tells it to run the main program again.

It shounds messy, but is in fact quite easy. I can post the code if needed.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 6:14 pm 
I checked the other link that uses some type of 3rd party unlocking software, but I'd prefer to use strictly AHK to do this. Enguneer, if you could point me in the right direction, that would be helpful.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 6:25 pm 
Quote:
I have an executable written in AHK sitting on a network drive
You could set the exe to use AHK's OnExit to write the clients 'offline' status to a log hosted at the same place as the executable.
Another script watches out (reads the log) till all clients are stated as offline, to replace the executable once that happened.

JM2€C's. Good luck. 8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 6:46 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8647
Location: Salem, MA
I will state again that this is not particularly elegant, but it works for me.

;*** marks things you need to change for your environment

main script
Code:
;autoexecute section
Loop,
{
   IfNotExist, TurnOff.exe
   {
      IfNotExist, TurnOn.exe
      {
         break          ;don't start until the trigger files are deleted
      }

   }
   sleep, 5000
}

SetTimer, UpdateAll, 30000    ;Run every N milliseconds

;your code can go here

Return

UpdateAll:
;Check for reloader
IfExist, TurnOff.exe
{
Run, TurnOff.exe
ExitApp
}

Return




TurnOff.ahk
Code:
;Instructions
;Compile TurnOff.ahk
;wait for ready message
;Compile main script.ahk
;Compile TurnOn.ahk
;wait a few seconds
;delete turnoff.exe

;*** put the name of your program here to notify users that the program is reloading
MsgBox, MAIN SCRIPT is being updated to a new version. It will start again automatically in 2-3 minutes.

Sleep, 60000

EnvGet, username, USERNAME
IfEqual, username, YOURUSERNAME                      ;*** put your user name here to be notified when all scripts should be closed
   MsgBox, Try it now - compile the main script`nwait a few seconds`ncompile TurnOn`nwait a few seconds`ndelete Turnoff.exe`nwait a few seconds`ndelete Turnon.exe
  ;You can also cause TurnOff.exe to compile your main script, but I did not do this.

Loop,
;Check for reloader
{
   IfExist, TurnOn.exe
   {
      Run, TurnOn.exe
      ExitApp
   }
Sleep, 5000
}


TurnOn.ahk
Code:
Run, main script.exe          ;*** change to name of your compiled script
ExitApp

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 6:50 pm 
thank you very much....don't worry about the elegance, you haven't seen some of my code. thanks again and I'll give this a try.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 10:47 pm 
THANKS! It worked perfectly...I changed it up a little bit, to send the user a msgbox when it was updated.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 4th, 2007, 3:14 pm 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
Very interesting solution! I am tagging this for future reference.

_________________
[Join IRC!]
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 26th, 2009, 9:43 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3825
Location: Louisville KY USA
i know this is a particularly old thread but happened upon it
I use a web server to deploy scripts to a local desktop to run the scripts first line deletes itself
the web site is a trusted source so no active x prompts

if anyone is interested i might create a small template to demonstrate the technique

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 26th, 2009, 11:03 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
It is an interesting idea, though I have no use for it personally. Isn't this why IT updates are usually scheduled during system down time (i.e. the wee hours of the morning)?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2009, 3:17 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3825
Location: Louisville KY USA
IT updates are typically scheduled during off peak hours to avoid large impacts if the updatesbreak something and allow minimum impact to trigger rollback
many development teams use something know as cvs CODE Versioning Store

this allows for instance JAVA developers to mercge changes when going live

My method of deploying applications made with ahk ensures the files are always fresh and never running from the server or network share so edits can be done freely. Wise developers push updates live at carefully scheduled times

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2009, 4:46 am 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
tank wrote:
if anyone is interested i might create a small template to demonstrate the technique

That'd be welcome.

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 28th, 2009, 3:02 am 
Offline

Joined: February 17th, 2008, 8:52 pm
Posts: 309
tank wrote:
My method of deploying applications made with ahk ensures the files are always fresh and never running from the server or network share so edits can be done freely. Wise developers push updates live at carefully scheduled times


I would like to hear more about how you do this. I work with a 20 man helpdesk and would love to find a way to synch helpdesk hotkey list.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cephei1, Google Feedfetcher, Leef_me, Yahoo [Bot] and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group