Jump to content

Suggestions Needed - Self Updating Application


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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 :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

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 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: 22/04/2018

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...