Srex Posted June 12, 2014 Share Posted June 12, 2014 (edited) Hey, I'm writing a updater to my script. Basicly I want it to read from a webhost a versioncheck.ini (or .txt i dont care) And from the version.ini (or .txt i dont care) in the scriptfolder) And if the one on the webhost <> with the one in the script folder then download and replace the new version of the .exe, changelog.txt, readme.txt and ressource folder. Also it needs to write the new version into the version file in the folder. This is what I have: expandcollapse popup#NoTrayIcon #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <File.au3> #include <IE.au3> ;Updater $VersionCheckNew = "http://www.mediafire.com/view/xxxxxxxxxx\versioncheck.ini" $VersionCheckOld = IniRead("version.ini","Version","Version","NotFound") $DownloadLink = "https://www.mediafire.com/folder/xxxxxxxx/FolderName" $newVersion = "0.0.0" $ini = InetGet($VersionCheckNew,@ScriptDir & '\versioncheck.ini') ; dl new ini if $ini = 0 Then MsgBox(0,"Error","Something went wrong while checking for updates.") Else $newVersion = IniRead(@ScriptDir & "\versioncheck.ini","Version","Version","") If $newVersion = $VersionCheckOld Then Exit Else $MsgNewUpdate = MsgBox(4,"Update Avaible","There is a new update avaible. Do you wish to automaticly download it?") if $MsgNewUpdate = 7 Then Filedelete(@ScriptDir & "\versioncheck.ini") Exit Elseif $MsgNewUpdate = 6 Then $DlHandleExe = InetGet($DownloadLink,@ScriptDir & "\MyScript.exe",1,1) ProgressOn("", "", "", -1,-1,16) $DownloadSize =InetGetSize($DownloadLink,1) While not InetGetInfo($DlHandleExe, 2) $PercentDone = (InetGetInfo($DlHandleExe,0)/$DownloadSize)*100 ProgressSet($PercentDone, $PercentDone & " percent") Sleep(1) WEnd ProgressSet(100,"Done","Update Completed") Sleep(500) ProgressOff() IniWrite(@ScriptDir & "\version.ini","Version","Version",$newVersion) InetClose($DlHandleExe) MsgBox(-1,"Success","Download Complete!") EndIf EndIf EndIf FileDelete(@ScriptDir & "\versioncheck.ini") Exit I downloads with no problems etc. but the content of the downloaded stuff looks like this: The original content of the file was: Is this because I'm doing it through mediafire? Or is it something with the code? I am not intending to use mediafire, I just wanted to get the updater working asap. I am waiting for a proper host to set my thingy up I already read all the posts I could find on this, but it was old threads and I didn't understand them properly. And I don't want to ressurect posts from the dead. Cheers! Edited June 12, 2014 by Srex Link to comment Share on other sites More sharing options...
Danyfirex Posted June 12, 2014 Share Posted June 12, 2014 I'm not soure but I think mediafire has not hotlink. You could find some txt uploader and read from it. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Srex Posted June 12, 2014 Author Share Posted June 12, 2014 I'm not soure but I think mediafire has not hotlink. You could find some txt uploader and read from it. Saludos And what is hotlinking? Link to comment Share on other sites More sharing options...
Solution Danyfirex Posted June 12, 2014 Solution Share Posted June 12, 2014 mediafire, mega. and other upload page use a method to avoid malware upload. (I think). Look at the medifire link. over the download botton right-click and click copy link direct address. that is the hotlink. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Srex Posted June 12, 2014 Author Share Posted June 12, 2014 (edited) mediafire, mega. and other upload page use a method to avoid malware upload. (I think). Look at the medifire link. over the download botton right-click and click copy link direct address. that is the hotlink. Saludos Thanks dude! Fixed it <3 Edited June 12, 2014 by Srex Link to comment Share on other sites More sharing options...
Srex Posted June 12, 2014 Author Share Posted June 12, 2014 (edited) If I wanted to not make it close the program if theres no update, or the user doesnt wish to update right now. Could I put it inside a do loop? And that should work right? Edited June 12, 2014 by Srex Link to comment Share on other sites More sharing options...
Danyfirex Posted June 12, 2014 Share Posted June 12, 2014 Only put as almost all software. when the app starts or put a button check for updates... Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Srex Posted June 12, 2014 Author Share Posted June 12, 2014 (edited) Only put as almost all software. when the app starts or put a button check for updates... Saludos Yeah I figured out how to do it correct! The links changes when I upload a new version though, so it will download the old one still. Guess I'll need to purchase mediafire then -.- Edit: Figured it out. Thanks! Edited June 12, 2014 by Srex Link to comment Share on other sites More sharing options...
Danyfirex Posted June 12, 2014 Share Posted June 12, 2014 I'm not sure about that. for that I prefer a hotlink and raw data uploader. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
guinness Posted June 12, 2014 Share Posted June 12, 2014 There is a SelfUpdater UDF in my signature. Danyfirex 1 UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Srex Posted June 12, 2014 Author Share Posted June 12, 2014 (edited) There is a SelfUpdater UDF in my signature. Yeah I already read it before posting this. I already had it working, I was 95% it was bcus of mediafire, which it was Edited June 12, 2014 by Srex Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now