updater being annoying

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SkrillexAkaCraft
Posts: 119
Joined: 25 Dec 2015, 10:01

updater being annoying

26 Jun 2017, 15:10

Code: Select all

#SingleInstance Force
#NoEnv

Name = Fiesta Online Price Checker ;Script name
Currversion = 0.2 ;Current script version for the update window
version = 0.2     ;Current Script version


UrlDownloadToFile, https://raw.githubusercontent.com/SkrillexAkaCraft/FiestaOnline/master/version.ini, version.ini ;Downloads Version.ini file
FileRead, new_version, version.ini ;Reads the version.ini file to see what the new version is

if (new_version > version) ;If version is newer than current version Ask to download new Version
	{
;FileRead, NewVersion, version.ini ;Reads the New version file to announce the new version in the ask for update qui.
Gui, Update:Add, Text, x5 y10 w185 h25, A new version of %Name% is available ;Announces that there is a new version available
Gui, Update:Add, Text, x5 y40 w145 h25, Current Version: %Currversion%       ;Announces the current version the user is using.
Gui, Update:Add, Text, x5 y55 w145 h20, New Version: %new_version%            ;Reads the downloaded version.ini to tell the new version available 
Gui, Update:Add, Text, x5 y85 w125 h15, Would you like to update?         ;Text asking if the user wants to update to the newer version
Gui, Update:Add, Button, x85 y180 w43 h23 gYes, Yes                        ;If pressed it will go to the Yes sub to download the newest version available
Gui, Update:Add, Button, x135 y180 w43 h23 gHome, No                     ;Will skip the update and go to the main functions
Gui, Update:Show, w192 h204, Update?                                     ;Update window title.
}


Home:
return

Yes:
return


the updater keeps asking if i want to update the script even tough the version is already the latest version
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: updater being annoying

26 Jun 2017, 15:38

The version number at the remote file tells "2", while you compare it against "0.2" which is < 2.
So what?
SkrillexAkaCraft
Posts: 119
Joined: 25 Dec 2015, 10:01

Re: updater being annoying

26 Jun 2017, 17:17

BoBo wrote:The version number at the remote file tells "2", while you compare it against "0.2" which is < 2.
So what?
Look Version number (Clients current version = 2) version.ini is also saying version 2 wich means the client/script should ignore the update box wich it is clearly not doing so what i need is to find what i did do wrong acoirding to github my version in the ini file is 2



Image




the script itself is Version 2 and i keep getting this
Image
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: updater being annoying

26 Jun 2017, 17:34

Hint:
Spoiler
SkrillexAkaCraft
Posts: 119
Joined: 25 Dec 2015, 10:01

Re: updater being annoying

26 Jun 2017, 19:05

Xtra wrote:Hint:
Spoiler

got this now
Spoiler

evilC gave me this in the discord server but then the new updated script won't really be downloaded or the user would be spammed by "There is a new version available" even tough there is no new version

Code: Select all

new_version := "2"
so for example script is version 2 new_version := "3" even tough there is no version 3 available the user ends up being spammed by update announcers
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: updater being annoying

27 Jun 2017, 05:39

Code: Select all

#SingleInstance Force
#NoEnv

F1::                                            ; press F1 (several times) to start testing
    Random, version, 2.8,3.2                    ; let's create a fake random product version # to compare it against the offered release 
    SetFormat, float, 0.2                       ; # cosmetics
    version += 0.0
    product := "Fiesta Online Price Checker"

    UrlDownloadToFile, https://raw.githubusercontent.com/SkrillexAkaCraft/FiestaOnline/master/version.ini, version.ini
    ; FileRead, new_version, version.ini, https://raw.githubusercontent.com/SkrillexAkaCraft/FiestaOnline/master/version.ini, version, new_version

    INIRead, newVersion,% "version.ini", version, new_version ; if it's an INI-file why using FileRead instead??
    if (newVersion > version){
        Gui, Update:Add, Text,    x10   y10   wp400 h25     ,% "A new version of " product "has arrived!`n`n"
        Gui, Update:Add, Text,    xp    y40   wp-40 hp      ,% "Current version:`t" Version "`n"
        Gui, Update:Add, Text,    xp    y55   wp    hp      ,% "New version:`t" newVersion "`n"
        Gui, Update:Add, Text,    xp    y85   wp    hp      ,% "Would you like to update?"
        Gui, Update:Add, Button,  xp+170yp-6  w30   hp gYes ,% "Yes"
        Gui, Update:Add, Button,  xp+50 yp    wp    hp gUpdateGuiClose ,% "No" 
        Gui, Update:Show,                     w290  h130    ,% "Update?"
        return
        } Else { ; for testing
        SoundBeep
        ToolTip % "No update necessary!"
        Sleep 1000
        ToolTip
        }

Yes:
UpdateGuiClose:
Gui, Destroy
Return
SkrillexAkaCraft
Posts: 119
Joined: 25 Dec 2015, 10:01

Re: updater being annoying

27 Jun 2017, 06:26

BoBo wrote:

Code: Select all

#SingleInstance Force
#NoEnv

F1::                                            ; press F1 (several times) to start testing
    Random, version, 2.8,3.2                    ; let's create a fake random product version # to compare it against the offered release 
    SetFormat, float, 0.2                       ; # cosmetics
    version += 0.0
    product := "Fiesta Online Price Checker"

    UrlDownloadToFile, https://raw.githubusercontent.com/SkrillexAkaCraft/FiestaOnline/master/version.ini, version.ini
    ; FileRead, new_version, version.ini, https://raw.githubusercontent.com/SkrillexAkaCraft/FiestaOnline/master/version.ini, version, new_version

    INIRead, newVersion,% "version.ini", version, new_version ; if it's an INI-file why using FileRead instead??
    if (newVersion > version){
        Gui, Update:Add, Text,    x10   y10   wp400 h25     ,% "A new version of " product "has arrived!`n`n"
        Gui, Update:Add, Text,    xp    y40   wp-40 hp      ,% "Current version:`t" Version "`n"
        Gui, Update:Add, Text,    xp    y55   wp    hp      ,% "New version:`t" newVersion "`n"
        Gui, Update:Add, Text,    xp    y85   wp    hp      ,% "Would you like to update?"
        Gui, Update:Add, Button,  xp+170yp-6  w30   hp gYes ,% "Yes"
        Gui, Update:Add, Button,  xp+50 yp    wp    hp gUpdateGuiClose ,% "No" 
        Gui, Update:Show,                     w290  h130    ,% "Update?"
        return
        } Else { ; for testing
        SoundBeep
        ToolTip % "No update necessary!"
        Sleep 1000
        ToolTip
        }

Yes:
UpdateGuiClose:
Gui, Destroy
Return
i added this to my main script and edited out the parts that needed to be edited but now it still keeps asking to update and the new version keeps saying ERROR

Spoiler
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: updater being annoying

27 Jun 2017, 06:54

i added this to my main script ...
... and you can confirm that before you've done that, you've tested it separately and it worked fine, correct?!

What I see is that you've set version = 0.1 as a static variable. That is, if I compare it with what is provided at github (and locally at the downloaded INIfile) still < 3, hence offers an update.
... and the new version keeps saying ERROR
You have to check the downloaded ini-file!!
While opening ...
https://raw.githubusercontent.com/Skril ... ersion.ini
... within a browser it showed a single digit, something that won't work with INIRead (interestingly that has changed while I wrote this!) :?
The same content downloaded via URLDownloadToFile is showing a standard INI-file. And that worked fine.
SkrillexAkaCraft
Posts: 119
Joined: 25 Dec 2015, 10:01

Re: updater being annoying

27 Jun 2017, 10:54

BoBo wrote:
i added this to my main script ...
... and you can confirm that before you've done that, you've tested it separately and it worked fine, correct?!

What I see is that you've set version = 0.1 as a static variable. That is, if I compare it with what is provided at github (and locally at the downloaded INIfile) still < 3, hence offers an update.
... and the new version keeps saying ERROR
You have to check the downloaded ini-file!!
While opening ...
https://raw.githubusercontent.com/Skril ... ersion.ini
... within a browser it showed a single digit, something that won't work with INIRead (interestingly that has changed while I wrote this!) :?
The same content downloaded via URLDownloadToFile is showing a standard INI-file. And that worked fine.
taking a look at the time you posted this it was solved allready :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder and 248 guests