Code: Select all
IniRead,Current_ini,version.ini,Info,Version,N/A ;This is the desktop version.ini which will be compared with the online version.ini. It assumes that the version.ini is in the same directory unless specified otherwise.
Update_URL := "your version.ini download link" ;The URL of the online version.ini file for your script
Random,Filler,10000000,99999999
, Version_File := A_Temp . "\" . Filler . ".ini"
, Temp_Exe := A_Temp . "\" . f . "yourfilename.exe" ;replace yourfilename.exe with your desired program name.
UrlDownloadToFile,%Update_URL%,%Version_File%
IniRead,Version,%Version_File%,Info,Version,N/A
If (Version = "N/A"){
FileDelete,%Version_File%
}
If (Version > Current_ini)
{
IniRead,URL,%Version_File%,Info,URL,N/A
UrlDownloadToFile, %url%, %Temp_Exe%
Run, %Temp_Exe%
UrlDownloadToFile,%Update_URL%,version.ini ;this makes the newer version.ini replace the current version.ini on your desktop. It assumes that the version.ini is in the same directory unless specified otherwise. Make sure this matches the location of the old version.ini
exitapp
}
Else
{
IfExist, %Temp_Exe%
{
FileDelete,%Version_File%
Run, %Temp_Exe%
}
IfNotExist, %Temp_Exe%
{
Msgbox, File not found. Downloading. ;you can remove this line if you don't want the message box.
UrlDownloadToFile,%Update_URL%,%Version_File%
IniRead,URL,%Version_File%,Info,URL,N/A
UrlDownloadToFile, %url%, %Temp_Exe%
FileDelete,%Version_File%
Run, %Temp_Exe%
}
exitapp
}
exitapp
This beginner-friendly program will automatically check for updates and launch the latest version of your program. I wanted to create a simplified/modified alternative to Rseding91's self script updater(because I am too trash to actually get his working).
How to set up:
1.Upload your newest compiled program to dropbox or google drive
2.Copy the direct download link for your program.
3.Create a file called version.ini and input the following
Code: Select all
[Info]
Version=1.0
URL=Input your direct .exe download link
5.Copy my launcher script into an .AHK file and put it in the same folder as version.ini
Your folder should look like this:
6.Get the direct download link for your version.ini
7.Replace the part of the Launcher script called "your version.ini download link". Keep the download link in quotation marks.
Example:
Update_URL := "https://dl.dropboxusercontent.com/s/111 ... dinfostuff"
8.Replace "yourfilename.exe" with your desired program name. Keep the download name in quotation marks.
Example:
, Temp_Exe := A_Temp . "\" . f . "New_Program.exe"
9.You are all done. Save and compile your new launcher.
How to push out an update:
1.Drag your newly updated program into your Dropbox/Google Drive and overwrite the old version
2.Edit the version.ini in your Dropbox/Google Drive and increase the version number from Version=1.0 to Version=2.0.
3.Run the launcher program on your desktop. The program will see that the version number in your Dropbox/Google Drive is larger and automatically update.
Where does the launcher put my downloaded program?:
This script saves your New_Program.exe to the Temp folder. You can find the Temp folder by putting %temp% in your Window's search bar or run command.
How it works:
Spoiler