Compile Script while .exe is running Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hymal7
Posts: 66
Joined: 14 Sep 2016, 05:37

Compile Script while .exe is running

22 Jan 2019, 10:18

Hi all,

I have an .exe program that runs a GUI. The file is located in a shared folder and a user runs it throughout the day.
I sometimes have to update the script and would like to compile it after I have made the changes.
The problem is that everytime I update something, I have to walk all the way to the user's PC and close the program, and then get back to my PC to complile the script.
I have been updating the script/program many times a day.

Is there a way around to be able to close the program on the (other) user's PC when I need to compile the script?

many thanks.
eelrod
Posts: 65
Joined: 10 Apr 2018, 11:17

Re: Compile Script while .exe is running  Topic is solved

22 Jan 2019, 10:43

I ran into this same issue before. I made a database search program that many users in my company would use. But when I needed to update it, I would have to check with all the users to make sure they had closed it (many would just leave it open and forget about it).

My suggestion is to make an "installer" that copies the server version to their local machine, so that they are always running it locally. Then make a simple separate program that checks the local version against the server version and will end the process and replace with newer if detected. You may want to also make your main program update the separate program in a similar fashion so that you can update either without depending on the user to close programs.
hymal7
Posts: 66
Joined: 14 Sep 2016, 05:37

Re: Compile Script while .exe is running

22 Jan 2019, 11:17

eelrod wrote:
22 Jan 2019, 10:43
I ran into this same issue before. I made a database search program that many users in my company would use. But when I needed to update it, I would have to check with all the users to make sure they had closed it (many would just leave it open and forget about it).

My suggestion is to make an "installer" that copies the server version to their local machine, so that they are always running it locally. Then make a simple separate program that checks the local version against the server version and will end the process and replace with newer if detected. You may want to also make your main program update the separate program in a similar fashion so that you can update either without depending on the user to close programs.
Thanks for the Tip @eelrod.
FYI, I was currently doing this:

I would send an email to the user with a specific email subject.
The user's Outlook would trigger an application - An AHK .exe file that would close the running GUI program, and then email me back confirming the action.
I would then complile the script.
My Outlook would then automatically respond with an email template with another subject.
The user's Outlook would again trigger another application - An AHK .exe file that would run the GUI program.

The problem with this was that the user's PC would be locked. So Outlook couldn't execute the trigger.
Ahk_fan
Posts: 237
Joined: 31 Aug 2018, 14:34
Contact:

Re: Compile Script while .exe is running

22 Jan 2019, 16:08

hi, here an other suggestion:

I've solved it otherwise:
- My compiled script looks with

Code: Select all

#Persistent
gosub, WatchEnd    ; if programm started chekc if exit.txt exist
SetTimer, WatchEnd, 60000
return
--> every 60 Sec watch if file exit.txt exist

Code: Select all

WatchEnd:
IfExist, \\servername\fileprogramxx\exit.txt
	{
	ctime =
	formattime, ctime, , HH:mm:ss  dd.MM.yyyy
	FileAppend, `n%UserNNN%`;%ctime%`;v%aktVers%`;exit, \\servername\fileprogramxx\log.csv
	MsgBox, 64, Message Programm, Hello`nProgram will exit `nof service-reason in 30 seconds!`nPlease try to restart after 2 minutes, 30
	ExitApp
	}
return
so if needed I create file exit.txt , and wait 1-2 Minutes, then i look into log.csv if all user exit. and recompile new version. Then delete exit.txt or rename to _exit.txt

Problem is, if Users are not logged in its not possible to exit automatically. So ive found a other solution. I've create a START.bat with path to the actual Programm_v1.exe and every user starts only this START.bat on a networkserver. If I change version, i compile new Programm_v2.exe and change START.bat with new Programmefile. My Progamm_v1.exe checks every 2 Minutes if there is a change in START.bat. If necessery it starts a subprogramm to reload, but with an MSGBOX where User could cancel reload-Sub, because of finish some input.
regards,
AHK_fan :)
https://hr-anwendungen.de

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 237 guests