Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Upd GUI - GUI for creating auto updating compiled scripts


  • Please log in to reply
24 replies to this topic
corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
Upd - GUI Version (1.3) - download **Updated Version** (January 15, 2007)
- patched to restore functionality (hopefully...)
- an update with additional features and various improvements should be available soon...

Upd - GUI Version (1.2) - download (previous version - April 3, 2005)
Upd - GUI Version (1.1) - download (previous version)

- File sizes of Upd generated, compiled scripts are now only approx. 1kb larger
than standard AutoHotkey compiled scripts!!, added Help and more...


Note: Running the previous version (1.2) will give the option to upgrade to the latest version ;). Please scroll down for updates...


Here' s a script I've been playing with to allow compiled scripts to auto update when run. If an update is available the user will be asked if they would like to update to the latest version. This is done by placing a small file on a webserver that lists the available scripts and their current version numbers. The script looks up the script in the update file and prompts for an update if the version does not match. If the user decides to update the current version will be downloaded, replace the existing version and run.

There are 2 parts to creating an auto updating script with this method:

Creating/updating the update file:

Posted Image

& Creating a file for distribution:

Posted Image

note: Upd GUI uses Ahk2Exe.exe

Version 1.2/1.3 Instructions:
1.) Download the .exe file above and save to a directory of your choice
2.) Browse to that directory and run saved file (running the saved file will change the name of the file to Upd_GUI.exe and start Upd GUI)
3.) fill in the required fields in the "Create Update" tab
4.) click the "Create Update" button
5.) Upload the new .exe file to your web server

6.) click the "Edit Update File" tab
7.) Click the New button to create a new file and use the Add button or open an existing file to add/edit the names and version numbers of the programs that you would like to have auto update. (Double-click to edit an entry in the list)
8.) Upload the file you created/modified with the Upd Editor to your web server


Version 1.1 Instructions:

1.) Download the zip file above and extract to a directory of your choice.
2.) Browse to that directory and run the file: Upd_GUI.exe
3.) fill in the required fields
4.) click the "Create Update" button
5.) Upload the new .exe file to your web server

6.) run the file: UPD_Editor.exe
7.) Click the New button to create a new file and use the Add button or open an existing file to add/edit the names and version numbers of the programs that you would like to have auto update. (Double-click to edit an entry in the list)
8.) Upload the file you created/modified with the Upd Editor to your web server


Upd GUI fields:
Application Name - This should match (exactly) the name used in the Upd Editor
AHK File - Full path to your AHK script
Current Version- This should match (exactly) the version entered in the Upd Editor
Custom Icon- (optional) full path to a custom .ico file
Original Filename- file to be replaced
Passphrase- (optional) Same as when using AHK2Exe
Upd File URL- Url to the file created using Upd Editor (on webserver)
Download URL- Path where file updates are stored on webserver (no forward slash at the end)

Comments, suggestions, etc... welcome... :)

Updates:

Version 1.2
- patched to restore functionality (hopefully...)

Version 1.2
- File sizes of Upd generated, compiled scripts are now only approx. 1kb larger
than standard AutoHotkey compiled scripts!! (approx. 50% smaller than with
previous versions of Upd GUI).
- Upd temporary variables are now cleared before starting regular script
- Tested & designed for use with Ahk2Exe v1.0.30.04 -- Script to EXE converter
- Help Tab Created & a bit of help added (more to be added later...)
- Upd Editor merged into Upd GUI

Version 1.1
- fixed - update process
- fixed - long filenames were causing problems with compiler

Source not currently available but will likely be made available with the next release...

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
My apologies to anyone that downloaded Upd - version 1.0. There were a couple of bugs with the update process that prevented a file from updating properly (including Upd GUI itself) which have been fixed in version 1.1 (version 1.1 download)

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
It looks great. Thanks for sharing it.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
Thanks Chris :).

I'm currently working on a way to bring the file size down a bit. Currently the file size of an update is at least 2 x the size of a compiled script. This is because the generated compiled script is currently placed in a second compiled script that uses FileInstall to allow the original script to be overwritten then run. Once the update has completed the size is no longer an issue (since the extra bits are deleted) but the extra space is taken up on the webserver. Time to play with the compiler a bit I think :)...

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
Updated to version 1.2 (Details added to first post) :) .

AyMC
  • Guests
  • Last active:
  • Joined: --
I like this script idea alot, but cannot get it to work 100%, so, ok, I run the compiler you created, and select my AHK source file, assign it a version number, put all details in where versions are stored on my Webserver along with the .DAT file.

So, to recap:

1) Have working source AHK
2) Have a .DAT file that only contains one line - 'apprun=1.1'
3) Got the .DAT file on my webserver, like http://myserver/update.dat

All values and forms seem to be filled in..... I am slightly confused about the "EDIT UPDATE FILE" tab, but I have the 'apprun=1.1' in there.

The problem is, when I run the .EXE file, I get message: "ERROR: UPDATE NOT AVAILABLE". That is a strange message, and no mater what version i list in the .DAT file stored on the webserver, or what version apprun1.2.exe, or whatever, doesn't change that message. The app then runs just fine after clicking OK..... so I don't know..... any ideas or suggestions? I really need something like this to work, and understand in principle how this is *supposed* to work :)) Thank you so much! I feel like it is something very small that is holding me up. Thanks, %A%

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
Thanks for the interest in this script and error details :) . I'm guessing that there might be compatibility issues with source code designed for use with the current version of AHK but I'll have a look at the source and take it for a spin. It's been a while since I've done anything with this script. There didn't seem to be much interest...

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
As I suspected there are a few issues with the current code for this script that would need to be fixed. Checking for an updated version should work ok though.

The error that you are receiving is likely due to the .dat file location and/or program name. The name that you specify for the program in the Application Name section of the Create Update tab must exactly match the Applcation Name specified in the Edit Update File tab. If the names don't match and/or the .dat file could not be downloaded from the url specified in the Create Update tab then you will receive this error. These errors probably shouldn't be displayed to users but the error messages were left in to help debug the script at the time. Once the Application names match and the .dat file can be read from the url specified, the error message shouldn't be displayed.

There is currently an issue with the update process though that will prevent a script from being updated after a user clicks Ok to update to a new version, once a new version is available. The update will fail and leave the user with the same version. If I remember correctly, a fix should be possible for the current version that will allow previous versions to be updated correctly without having to ask a user to download a new version manually. I'll have a look and post an updated version soon if you're still interested :) .

l4zphi5h3n7
  • Members
  • 88 posts
  • Last active: Jan 25 2011 07:10 PM
  • Joined: 27 Dec 2006
What should this look like? It did not generate a .dat file for me
I have
Application Name: ChrtrShrtHnd
App File: C:/Filelocation/ChrtShrtHnd.ahk
Current Version: 7-1-5
Custome Icon C:/Filelocation/ChrtrShrthndCustIco.ico
Original File Name: chrtrShrtHnd.exe
UPDFileurl: http://mywebpage/CSH...hrtHnd7-1-5.exe
DownloadURL: http://mywebpage/CSH...hrtHnd7-1-5.exe
When I hit compile it generates my .exe as : ChrtShrtHnd7-1-5.exe

So how does it work? When I run that version of the .exe is this gui implanting a script to check my UPD FileUrl?

What am I doing wrong and how will it know to look for ChrtrShrtHnd7-1-8.exe?

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
Yes, it adds the functionality to compare the file's version with the version listed on the web server. If the versions do not match it asks the user if they would like to upgrade. If the user chooses to upgrade it should then update to the new version.

There is currently a bug that will prevent the update process from completing sucessfully though. An update is planned but has been temporarily delayed unfortunately.

l4zphi5h3n7
  • Members
  • 88 posts
  • Last active: Jan 25 2011 07:10 PM
  • Joined: 27 Dec 2006
Yes but what is the .dat file and why is my program only becoming .exe
And if its looking for ProgramVersion1.exe per the UPD File URL and I upload my website with ProgramVersion2.exe Is it actually looking for ProgramVersion%X%.exe Where X is > 1? Or am I way off base?

And what about Until it gets patched making it download new vers of program to same directory and prompting you with: Would you like to delete old version?

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

Yes but what is the .dat file and why is my program only becoming .exe

The .dat file gets created when you fill out the information for the update file. You then need to place the .dat file that gets created on your webserver. As this method is designed to allow someone to distribute their scripts and allow users to receive semi-automated updates, you typically won't want a user to be able to modify the script otherwise their changes would be lost if they decided to update to a new version. This is the main reason for compiling to .exe

And if its looking for ProgramVersion1.exe per the UPD File URL and I upload my website with ProgramVersion2.exe Is it actually looking for ProgramVersion%X%.exe Where X is > 1? Or am I way off base?

It only checks to see if the version on the website matches the current version installed. If the 2 versions do not match it will inform the user that another version is available, and ask them if they would like to update to the version on the website (it will mention the version number from the website).

And what about Until it gets patched making it download new vers of program to same directory and prompting you with: Would you like to delete old version?

As that would still consist of creating a patched version, I would prefer to release a new version with the intended functionality instead. The next version will be restructured internally to take advantage of many of the new features that have been added to AHK since this script was put together. Another reason for restructuring is that the code for this script is a bit of a pain to work on in its current state. There are actually a few scripts that modify themselves and merge together which then modifies itself and gets compiled to form a compiled script that can also update itself (semi automatic - it will prompt and ask). Once I restructure most of the self modifying code it will hopefully be easier to work with...

l4zphi5h3n7
  • Members
  • 88 posts
  • Last active: Jan 25 2011 07:10 PM
  • Joined: 27 Dec 2006
I get an .exe instead of a .dat, Plz see above for what I'm putting in.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

I get an .exe instead of a .dat, Plz see above for what I'm putting in.

The tab where you entered your information is for creating a .exe to distribute. The information is used to tell the program where the .dat file is, where to download updates, current version, etc... The "Edit Update File" tab can be used to create a .dat file to place on your webserver.

l4zphi5h3n7
  • Members
  • 88 posts
  • Last active: Jan 25 2011 07:10 PM
  • Joined: 27 Dec 2006

The "Edit Update File" tab can be used to create a .dat file to place on your webserver.

Your Program doesn't explain this or its usage at all. Where is this in the help file? I still have no idea how to use it. Not trying to complain just want to help you add value here, I feel like a play-by-play would be useful information to use. The help tab just says

To accomplish this an Update file needs to first be created/modified. This file can be
created/modified using the Edit Update File tab. Once the file has been
created/modified it can then be uploaded to a web server.

With no clues as to how to create it. In the SelectFile Box it just says Select new file name. Do I create a txt document and rename .dat (if so what syntax do i use). Do I browse to the .ahk or the .exe of my program? What does it want?