Installer for AutoUpdater for Proxomitron
Thursday, 16. November 2006, 17:18:16
I have to just use IE on SL so I can host these files.
Here's the tentative code for the installer:
EXE on MediaMax: Installer
Here's the tentative code for the installer:
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.2.0.1
Author: jp10558
Version: 1.1
Script Function:
Install updater and set scheduled task.
#ce ----------------------------------------------------------------------------
local $answer, $directory, $success
$answer = FileExists("C:\Program Files\proxy\Proxomitron.exe")
If $answer Then
$directory = "C:\Program Files\proxy"
$success = _InstallProxUpdater($directory)
Else
$directory = FileSelectFolder("Cannot find Proxomitron, please browse to the install directory.", "",4)
$success = _InstallProxUpdater($directory)
EndIf
If $success Then
MsgBox(48,"Install Failed!", "The installer was unable to download the necessary files.")
Else
MsgBox(0,"Setting Scheduled Task","Enter the password for the prompted account")
RunWait(@ComSpec & " /c " & 'schtasks /create /sc WEEKLY /TN ProxUpdate /TR "' & $directory & '\ProxUpdate.exe /ST 08:00:00')
$answer = MsgBox(4,"Settings","Do you want to be prompted before an update is installed?")
If $answer = 6 Then
IniWrite($directory & "\version.ini","Version","Auto","0")
Else
IniWrite($directory & "\version.ini","Version","Auto","0")
EndIf
$answer = MsgBox(4,"Install Succeeded","Would you like to run the updater?")
If $answer = 6 Then
Run($directory & "\ProxUpdate.exe",$directory)
Else
EndIf
EndIf
Func _InstallProxUpdater($dir)
local $success, $success1
SplashTextOn("OperaMOD Proxomitron Filterset", "Downloading and Installing Updater.", 250, 40, -1, -1, 0)
$success = InetGet("http://www.mediamax.com/jp10558/Hosted/public/Update/ProxUpdate.exe",$dir & "\ProxUpdate.exe",1)
$success1 = InetGet("http://www.mediamax.com/jp10558/Hosted/public/Update/version.ini", $dir & "\version.ini",1)
SplashOff()
If $success = 0 or $success1 = 0 then
return 1
Else
return 0
EndIf
EndFunc
EXE on MediaMax: Installer







