Sign in to follow this  
Followers 0
vortexed

Suggestions Needed - Self Updating Application

3 posts in this topic

I created a self updating application that has a bunch of other random code in it. It's a compiled script that only keeps getting bigger and bigger. I have ran into two instances where I have made a mistake and I have caused the application to crash twice. I have about 600 machines that I'd eventually have this compiled script running on and mistakes are bound to occur, thus crashing the app on 600 machines just seems like a disaster. I think my mistake is that I tried to keep it simple by just having all the code in one compiled script and placed it in the start-up directory in windows so that I could ensure my code would remain running after a reboot etc...I thought that it'd be a good idea to just have the self updating function running the entire time since this doesn't change much so it won't crash on me and have the portion of the code that changes a lot on a separate exe. Is there another approach I could take? I was wondering if anyone has done this before and wanted to see if anyone would like to share some thoughts and or ideas with me.

While 1

Sleep(Rand(60000, 120000, 1)) ;Don't want to boggle the CPU sleeping between 60 to 120 seconds

_SelfUpdate()

;I want to check for updates on an interval and the only way I can keep my application running is in a while loop like this one

$ExperimentalAppThatCrashesAlot = "Path\path\appname.exe"

Run($ExperimentalAppThatCrashesAlot, "Path\path", @SW_HIDE)

WEnd

Func _SelfUpdate()

......

EndFunc

Thanks to the forums, AutoIT and to people reading this post.

Share this post


Link to post
Share on other sites



I personally would first look at why the application is crashing, and what I was doing for error handling. You can do a lot with error handling in AutoIt, to both catch errors and deal with them as well as writing to a log file or alerting an Admin. As it seems you'll be using this in a production environment, my personal focus would be more toward graceful error handling than running two scripts banking on one of them to sometimes crash. Just my 2 cents :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Just to say did you search the Forum for a _SelfUpdate function or this page here?


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0