Jump to content

Automated no-click reload of application after compile


Ron

Recommended Posts

Hi all,

I finally was able to figure out how to automate compilation, so that after I hit Ctrl-F9 to compile a new version of the Unigui application,
I can just sit back and relax, as I have two post-build events:

1. Copy the application file to the deploy directory, where the Hyperserver looks for a new file
2. Bring the browser window to front, it is just a VLC program which runs the Windows BringWindowToTop function, using FindWindow and the title:

BringWindowToTop(FindWindow( nil,'Your App Title - Opera'));

In about 10 seconds the new application is automatically loaded in the browser:

1. There is a timer in the main form, which searches for the deployed file, and shows a "Restarting now"-window, starting countdown
2. There is another timer which counts the number of files in the application directory, as the Hyperserver creates a backup file when loading the deployed file
3. When the deployed file is loaded (as the count is increased), the function uniapplication.restart is run, and the new application loads

So what do I save?

1. No need to switch to the browser using Alt-Tab
2. No need to hit F5 to reload the application
3. No need to figure out when to hit F5 to reload the application, as I would have to monitor the directory manually otherwise

Now I only need to figure out how the writing of the code may be automated, and then I can take a long vacation.

If doing 2-300 compilations a day, you may save quite a bit of time, which may then be spent by looking at the birds and smelling the flowers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...