Jump to content

Could someone


Recommended Posts

ok, I was already thinking of doing this. and while I could do it in under five lines, I've decided to make it more complicated, here's what I came up with in the last 20 minutes, I'm going home, but if anyone has any other settings or options that they'd like to see in the script, let me know. the idea being that the first time you use it, it makes the INI, after that, it's silent.

;download and update latest unstable of autoit
;the first time you run it, it'll ask for your preferences.

if fileexists("update.ini") =0 Then
   $download = InputBox("AUTOIT URL", "Paste the URL for the autoitunstable url that you'd like to download." & @LF & "(include the http://)", "http://www.autoitscript.com/autoit3/files/unstable/autoit/autoit-v3.0.102.exe")
   $targetfolder = FileSelectFolder("Target directory for Autoit download","", 1)
   $installdir = FileSelectFolder("Directory to install Autoit in","",1)
   if MsgBox(4, "Overwrite previous version?", "Do you prefer to overwrite the previous version, or install fresh?" & @LF & "Yes to Overwrite and keep your settings") = 6 then
      $overwrite = 1
   Else
      $overwrite = 0
   EndIf
   IniWrite("update.ini", "PREFS","overwrite", $overwrite)
   IniWrite("update.ini", "LOCAL","installdir", $installdir)
   IniWrite("update.ini","LOCAL","folder", $targetfolder)
   IniWrite("update.ini","NET","download", $download)
   
Else
   $overwrite = IniRead("update.ini", "PREFS","overwrite")
   $installdir = IniRead("update.ini", "LOCAL","installdir")
   $targetfolder = IniRead("update.ini","LOCAL","folder")
   $download = IniRead("update.ini","NET","download")
EndIf

$filename = $targetfolder & "\" & StringTrimLeft($download, StringInStr($download,"/",0,-1))
URLDownloadToFile($download, $filename)
;I could just do a /S to do a silent install, but that sounds too easy. unless there's command line options for the setup's options, like file defualts and overwriting the current install?

"I'm not even supposed to be here today!" -Dante (Hicks)

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...