#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_icon=Logo.ico
#AutoIt3Wrapper_outfile=WiiFlow Installer v1.1.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Comment=WiiFlow Installer
#AutoIt3Wrapper_Res_Description=WiiFlow Installer
#AutoIt3Wrapper_Res_Fileversion=1.1.0.0
#AutoIt3Wrapper_Res_ProductVersion=1.1.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Copyright © 2009 - © 2012 Spayrosam (Samir.L)
#AutoIt3Wrapper_Res_Field=CompanyName|Spayrosam
#AutoIt3Wrapper_Res_Field=ProductName|WiiFlow Installer
#AutoIt3Wrapper_Res_Field=ProductVersion|1.1.0.0
#AutoIt3Wrapper_Res_Field=WiiFlow Installer|1.1.0.0
#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>
#include <GuiComboBoxEx.au3>
#include <Crypt.au3>
#include <Timers.au3>
Global $CancelBTNCancelState = 0
$Gui = GUICreate("WiiFlow MOD Installer", 750, 320, -1, -1)
GUICtrlCreateGroup("Roms folders", 5, 5, 350, 170)
$fceugxlabel = GUICtrlCreateLabel("fceugx :", 10, 20, 100, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$fceugxFolder = GUICtrlCreateButton("•••", 110, 20, 40, 20)
$fceugxFolderinput = GUICtrlCreateInput("WiiFlow\Plugins\fceugx\roms", 150, 20, 200, 20, $ES_AUTOHSCROLL)
$snes9xgxlabel = GUICtrlCreateLabel("snes9xgx :", 10, 45, 100, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$snes9xgxFolder = GUICtrlCreateButton("•••", 110, 45, 40, 20)
$snes9xgxFolderinput = GUICtrlCreateInput("WiiFlow\Plugins\snes9xgx\roms", 150, 45, 200, 20, $ES_AUTOHSCROLL)
$wii64label = GUICtrlCreateLabel("wii64 :", 10, 70, 100, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$wii64Folder = GUICtrlCreateButton("•••", 110, 70, 40, 20)
$wii64Folderinput = GUICtrlCreateInput("WiiFlow\Plugins\wii64\roms", 150, 70, 200, 20, $ES_AUTOHSCROLL)
$vbagxlabel = GUICtrlCreateLabel("vbagx :", 10, 95, 100, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$vbagxFolder = GUICtrlCreateButton("•••", 110, 95, 40, 20)
$vbagxFolderinput = GUICtrlCreateInput("WiiFlow\Plugins\vbagx\roms", 150, 95, 200, 20, $ES_AUTOHSCROLL)
$genplusgxlabel = GUICtrlCreateLabel("genplusgx :", 10, 120, 100, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$genplusgxFolder = GUICtrlCreateButton("•••", 110, 120, 40, 20)
$genplusgxFolderinput = GUICtrlCreateInput("WiiFlow\Plugins\genplusgx\roms", 150, 120, 200, 20, $ES_AUTOHSCROLL)
$scummvmlabel = GUICtrlCreateLabel("scummvm :", 10, 145, 100, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$scummvmFolder = GUICtrlCreateButton("•••", 110, 145, 40, 20)
$scummvmFolderinput = GUICtrlCreateInput("WiiFlow\Plugins\scummvm\roms", 150, 145, 200, 20, $ES_AUTOHSCROLL)
GUICtrlCreateGroup("", 360, 5, 380, 170)
GUICtrlCreateLabel("Language : ", 370, 20, 80, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$HomebrewTypeBootDOLLanguage = GUICtrlCreateCombo("", 450, 20, 65, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetData($HomebrewTypeBootDOLLanguage, "EN|FR|DE|ES|IT|NL|PT|RU|JA|KO|ZHCN|ZHTW", "EN")
GUICtrlCreateLabel("Transfered : ", 525, 20, 80, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetColor(-1, 0x000FFF)
$HomebrewListViewTransferedUnformated = GUICtrlCreateLabel("0", 605, 20, 100, 20, $SS_CENTERIMAGE)
GUICtrlSetState(-1, $GUI_HIDE)
$HomebrewListViewTransfered = GUICtrlCreateLabel("00.00 B", 605, 20, 130, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 600)
GUICtrlSetColor(-1, 0xff0000)
$WiiFlowModCurrentVersion = GUICtrlCreateLabel("Wiiflow Mod Current Version :", 370, 95, 180, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 10, 400)
GUICtrlSetColor(-1, 0x04920C)
$WiiFlowModCurrentVersionNumber = GUICtrlCreateLabel("Unknown", 550, 95, 90, 20, $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 12, 600)
GUICtrlSetColor(-1, 0x04920C)
$WiiFlowModCurrentVersionUpdate = GUICtrlCreateButton("Update", 640, 95, 90, 25)
$SavetoBTN = GUICtrlCreateButton("Save to : ", 370, 49, 60, 27)
$SavetoInput = GUICtrlCreateInput(@ScriptDir, 430, 50, 300, 25, BitOR($ES_READONLY, $ES_AUTOHSCROLL))
$DownloadBTN = GUICtrlCreateButton("Download", 370, 140, 175, 25)
GUICtrlSetFont(-1, 10, 600)
$CancelBTN = GUICtrlCreateButton("Cancel", 555, 140, 175, 25)
GUICtrlSetFont(-1, 10, 600)
$State = GUICtrlCreateLabel("State", 10, 190, 730, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$LogInput = GUICtrlCreateList("", 10, 210, 730, 100)
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $fceugxFolder
Local $path = FileSelectFolder("Choose a folder. (fceugx roms)", @DesktopDir, 1, "", $Gui)
If @[member='Error 917']<> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") <> "" Then; "Nand" Then
GUICtrlSetData($fceugxFolderinput, StringRegExpReplace($path, ".\:\\\\|.\:\\", ""))
EndIf
EndIf
Case $snes9xgxFolder
Local $path = FileSelectFolder("Choose a folder. (snes9xgx roms)", @DesktopDir, 1, "", $Gui)
If @[member='Error 917']<> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") <> "" Then; "Nand" Then
GUICtrlSetData($snes9xgxFolderinput, StringRegExpReplace($path, ".\:\\\\|.\:\\", ""))
EndIf
EndIf
Case $wii64Folder
Local $path = FileSelectFolder("Choose a folder. (wii64 roms)", @DesktopDir, 1, "", $Gui)
If @[member='Error 917']<> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") <> "" Then; "Nand" Then
GUICtrlSetData($wii64Folderinput, StringRegExpReplace($path, ".\:\\\\|.\:\\", ""))
EndIf
EndIf
Case $vbagxFolder
Local $path = FileSelectFolder("Choose a folder. (vbagx roms)", @DesktopDir, 1, "", $Gui)
If @[member='Error 917']<> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") <> "" Then; "Nand" Then
GUICtrlSetData($vbagxFolderinput, StringRegExpReplace($path, ".\:\\\\|.\:\\", ""))
EndIf
EndIf
Case $genplusgxFolder
Local $path = FileSelectFolder("Choose a folder. (genplusgx roms)", @DesktopDir, 1, "", $Gui)
If @[member='Error 917']<> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") <> "" Then; "Nand" Then
GUICtrlSetData($genplusgxFolderinput, StringRegExpReplace($path, ".\:\\\\|.\:\\", ""))
EndIf
EndIf
Case $scummvmFolder
Local $path = FileSelectFolder("Choose a folder. (scummvm roms)", @DesktopDir, 1, "", $Gui)
If @[member='Error 917']<> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") <> "" Then; "Nand" Then
GUICtrlSetData($scummvmFolderinput, StringRegExpReplace($path, ".\:\\\\|.\:\\", ""))
EndIf
EndIf
Case $DownloadBTN
GUICtrlSetState($DownloadBTN, $GUI_DISABLE)
GUICtrlSetData($HomebrewListViewTransferedUnformated, "0")
GUICtrlSetData($HomebrewListViewTransfered, "00.00 B")
$CancelBTNCancelState = 0
$ReturnedMSG = _CurrentUSBWiiflowURL(@ScriptDir, $State, 0)
MsgBox(64, "Wiiflow Mod Installer", $ReturnedMSG, -1, $Gui)
GUICtrlSetState($DownloadBTN, $GUI_ENABLE)
Case $WiiFlowModCurrentVersionUpdate
GUICtrlSetState($WiiFlowModCurrentVersionUpdate, $GUI_DISABLE)
GUICtrlSetData($HomebrewListViewTransferedUnformated, "0")
GUICtrlSetData($HomebrewListViewTransfered, "00.00 B")
$CancelBTNCancelState = 0
_CurrentUSBWiiflowURL(@ScriptDir, $State, 1, 1)
GUICtrlSetState($WiiFlowModCurrentVersionUpdate, $GUI_ENABLE)
EndSwitch
WEnd
Func _WM_COMMAND($hWnd, $nMsg, $wParam, $lParam)
Local $CancelBTNButton = GUICtrlGetHandle($CancelBTN)
Switch $lParam
Case $CancelBTNButton
$CancelBTNCancelState = 1
EndSwitch
EndFunc ;==>_WM_COMMAND
Func _CurrentUSBWiiflowURL($SaveCurrentUSBWiiflow, $CurrentUSBWiiflowState, $CurrentUSBWiiflow_ListN = -1, $CurrentUSBWiiflow_DownType = 0)
$startGeneratetime = _Timer_Init()
Local $CurrentUSBWiiflowSize = 0, $ReturnCurrentUSBWiiflowURL = ""
FileDelete(@TempDir & "\USBWiiflowupdate.xml")
Local $hDownload = InetGet("http://code.google.com/p/open-wiiflow-mod/downloads/list", @TempDir & "\USBWiiflowupdate.xml", 1, 1) ;Download Header
Do
Sleep(250)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
$GetCurrentUSBWiiflowURL = FileRead(@TempDir & "\USBWiiflowupdate.xml")
FileClose($GetCurrentUSBWiiflowURL)
FileDelete(@TempDir & "\USBWiiflowupdate.xml") ;Clean
$StringCurrentUSBWiiflowVersion = _splitInfo($GetCurrentUSBWiiflowURL, 'open\-wiiflow\-mod\.googlecode\.com\/files\/Wiiflow\_Mod([^*]*?)\.zip', 1)
$UpdateUSBWiiflowURL = "http://open-wiiflow-mod.googlecode.com/files/Wiiflow_Mod" & $StringCurrentUSBWiiflowVersion & ".zip"
FileDelete(@TempDir & "\SHA1ChecksumURL")
Local $hDownload = InetGet("http://code.google.com/p/open-wiiflow-mod/downloads/detail?name=" & StringRegExpReplace($UpdateUSBWiiflowURL, "^.*/(.*)$", "$1"), @TempDir & "\SHA1ChecksumURL", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
$GetSHA1ChecksumURL = FileRead(@TempDir & "\SHA1ChecksumURL")
FileClose($GetSHA1ChecksumURL)
FileDelete(@TempDir & "\SHA1ChecksumURL") ;Clean
$StringSHA1ChecksumURL = _splitInfo($GetSHA1ChecksumURL, "SHA1 Checksum\: ([^*]*?)What\'s this\?", 1)
$StringSHA1Checksum = _splitInfo($StringSHA1ChecksumURL, "\> ([^*]*?) \<", 1)
$UpdateUSBWiiflowRelease = StringRegExpReplace($StringCurrentUSBWiiflowVersion, "_|svn", "")
;==============Pugins
Global $GCWiiFlowPlugInsUpdate[6][3]
FileDelete(@TempDir & "\USBWiiflowupdatePlugins.xml")
Local $hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/branches/Plugins/Binaries/", @TempDir & "\USBWiiflowupdatePlugins.xml", 1, 1) ;Download Header
Do
Sleep(250)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
$GetCurrentUSBWiiflowPlugIns = FileRead(@TempDir & "\USBWiiflowupdatePlugins.xml")
FileClose($GetCurrentUSBWiiflowPlugIns)
FileDelete(@TempDir & "\USBWiiflowupdatePlugins.xml") ;Clean
$fceugxCurrentWiiflow = _splitInfo($GetCurrentUSBWiiflowPlugIns, 'fceugx([^*]*?)\"\>fceugx', 1)
$fceugxCurrentWiiflowURL = "http://open-wiiflow-mod.googlecode.com/svn/branches/Plugins/Binaries/fceugx" & $fceugxCurrentWiiflow
$GCWiiFlowPlugInsUpdate[0][0] = $fceugxCurrentWiiflowURL
$GCWiiFlowPlugInsUpdate[0][1] = "fceugx" & $fceugxCurrentWiiflow
$genplusgxCurrentWiiflow = _splitInfo($GetCurrentUSBWiiflowPlugIns, 'genplusgx([^*]*?)\"\>genplusgx', 1)
$genplusgxCurrentWiiflowURL = "http://open-wiiflow-mod.googlecode.com/svn/branches/Plugins/Binaries/genplusgx" & $genplusgxCurrentWiiflow
$GCWiiFlowPlugInsUpdate[1][0] = $genplusgxCurrentWiiflowURL
$GCWiiFlowPlugInsUpdate[1][1] = "genplusgx" & $genplusgxCurrentWiiflow
$scummvmCurrentWiiflow = _splitInfo($GetCurrentUSBWiiflowPlugIns, 'scummvm([^*]*?)\"\>scummvm', 1)
$scummvmCurrentWiiflowURL = "http://open-wiiflow-mod.googlecode.com/svn/branches/Plugins/Binaries/scummvm" & $scummvmCurrentWiiflow
$GCWiiFlowPlugInsUpdate[2][0] = $scummvmCurrentWiiflowURL
$GCWiiFlowPlugInsUpdate[2][1] = "scummvm" & $scummvmCurrentWiiflow
$snes9xgxCurrentWiiflow = _splitInfo($GetCurrentUSBWiiflowPlugIns, 'snes9xgx([^*]*?)\"\>snes9xgx', 1)
$snes9xgxCurrentWiiflowURL = "http://open-wiiflow-mod.googlecode.com/svn/branches/Plugins/Binaries/snes9xgx" & $snes9xgxCurrentWiiflow
$GCWiiFlowPlugInsUpdate[3][0] = $snes9xgxCurrentWiiflowURL
$GCWiiFlowPlugInsUpdate[3][1] = "snes9xgx" & $snes9xgxCurrentWiiflow
$vbagxCurrentWiiflow = _splitInfo($GetCurrentUSBWiiflowPlugIns, 'vbagx([^*]*?)\"\>vbagx', 1)
$vbagxCurrentWiiflowURL = "http://open-wiiflow-mod.googlecode.com/svn/branches/Plugins/Binaries/vbagx" & $vbagxCurrentWiiflow
$GCWiiFlowPlugInsUpdate[4][0] = $vbagxCurrentWiiflowURL
$GCWiiFlowPlugInsUpdate[4][1] = "vbagx" & $vbagxCurrentWiiflow
$wii64CurrentWiiflow = _splitInfo($GetCurrentUSBWiiflowPlugIns, 'wii64([^*]*?)\"\>wii64', 1)
$wii64CurrentWiiflowURL = "http://open-wiiflow-mod.googlecode.com/svn/branches/Plugins/Binaries/wii64" & $wii64CurrentWiiflow
$GCWiiFlowPlugInsUpdate[5][0] = $wii64CurrentWiiflowURL
$GCWiiFlowPlugInsUpdate[5][1] = "wii64" & $wii64CurrentWiiflow
;===========End
ConsoleWrite(@LF & _
"- Release : " & $UpdateUSBWiiflowRelease & @LF & _
"- URL : " & $UpdateUSBWiiflowURL & @LF & _
"- USBWiiflow SHA1 Checksum : " & $StringSHA1Checksum & @LF)
GUICtrlSetData($LogInput, "- Release : " & $UpdateUSBWiiflowRelease)
GUICtrlSetData($LogInput, "- URL : " & $UpdateUSBWiiflowURL)
GUICtrlSetData($LogInput, "- USBWiiflow SHA1 Checksum : " & $StringSHA1Checksum)
GUICtrlSetData($WiiFlowModCurrentVersionNumber, $UpdateUSBWiiflowRelease)
If $CurrentUSBWiiflow_DownType > 0 Then Return
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\Languages")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\boxcovers")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\covers")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\trailers")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\fanart")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\help")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\settings")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\themes")
DirCreate($SaveCurrentUSBWiiflow & "\Wiiflow\plugins")
DirCreate($SaveCurrentUSBWiiflow & GUICtrlRead($fceugxFolderinput))
DirCreate($SaveCurrentUSBWiiflow & GUICtrlRead($snes9xgxFolderinput))
DirCreate($SaveCurrentUSBWiiflow & GUICtrlRead($wii64Folderinput))
DirCreate($SaveCurrentUSBWiiflow & GUICtrlRead($vbagxFolderinput))
DirCreate($SaveCurrentUSBWiiflow & GUICtrlRead($genplusgxFolderinput))
DirCreate($SaveCurrentUSBWiiflow & GUICtrlRead($scummvmFolderinput))
DirCreate($SaveCurrentUSBWiiflow & "\wad")
$SplitCurrentUSBWiiflow = StringSplit("arab.ini|brazilian.ini|chinese_s.ini|chinese_t.ini|danish.ini|dutch.ini|english.ini|finnish.ini|" & _
"french.ini|gallego.ini|german.ini|hungarian.ini|italian.ini|japanese.ini|norwegian.ini|" & _
"polish.ini|portuguese.ini|russian.ini|spanish.ini|swedish.ini|tagalog.ini|turkish.ini", "|")
For $ilWiiflow = 1 To $SplitCurrentUSBWiiflow[0]
Local $hDownloadSize = InetGetSize("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/Languages/" & $SplitCurrentUSBWiiflow[$ilWiiflow], 3)
Local $hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/Languages/" & $SplitCurrentUSBWiiflow[$ilWiiflow], _
$SaveCurrentUSBWiiflow & "\Wiiflow\Languages\" & $SplitCurrentUSBWiiflow[$ilWiiflow], 1, 1)
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " " & $SplitCurrentUSBWiiflow[$ilWiiflow] & " | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " " & $SplitCurrentUSBWiiflow[$ilWiiflow] & " Successfully Downloaded")
$CurrentUSBWiiflowSize += FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\Languages\" & $SplitCurrentUSBWiiflow[$ilWiiflow])
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\Languages\" & $SplitCurrentUSBWiiflow[$ilWiiflow]))
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
Next
$hDownloadSize = InetGetSize("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/fanart/GAMEID.ini")
$hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/fanart/GAMEID.ini", _
$SaveCurrentUSBWiiflow & "\Wiiflow\fanart\GAMEID.ini", 1, 1)
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (fanart : GAMEID.ini) | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (fanart : GAMEID.ini) Successfully Downloaded")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\fanart\GAMEID.ini"))
$CurrentUSBWiiflowSize += FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\fanart\GAMEID.ini")
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
$hDownloadSize = InetGetSize("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/help/english.txt")
$hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/help/english.txt", _
$SaveCurrentUSBWiiflow & "\Wiiflow\help\english.txt", 1, 1)
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (help : english.txt) | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (help : english.txt) Successfully Downloaded")
InetClose($hDownload)
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\help\english.txt"))
$CurrentUSBWiiflowSize += FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\help\english.txt")
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
$hDownloadSize = InetGetSize("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/settings/gameconfig1.ini")
$hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/settings/gameconfig1.ini", _
$SaveCurrentUSBWiiflow & "\Wiiflow\settings\gameconfig1.ini", 1, 1)
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (settings : gameconfig1.ini) | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (settings : gameconfig1.ini) Successfully Downloaded")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\settings\gameconfig1.ini"))
$CurrentUSBWiiflowSize += FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\settings\gameconfig1.ini")
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
$hDownloadSize = InetGetSize("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/settings/gameconfig2.ini")
$hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/settings/gameconfig2.ini", _
$SaveCurrentUSBWiiflow & "\Wiiflow\settings\gameconfig2.ini", 1, 1)
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (settings : gameconfig2.ini) | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (settings : gameconfig2.ini) Successfully Downloaded")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\settings\gameconfig2.ini"))
$CurrentUSBWiiflowSize += FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\settings\gameconfig2.ini")
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
$hDownloadSize = InetGetSize("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/themes/default.ini")
$hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow/themes/default.ini", _
$SaveCurrentUSBWiiflow & "\Wiiflow\themes\default.ini", 1, 1)
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (themes : default.ini) | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (themes : default.ini) Successfully Downloaded")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\themes\default.ini"))
$CurrentUSBWiiflowSize += FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\themes\default.ini")
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
$SplitTitleCurrentUSBWiiflow = StringSplit("EN|FR|DE|ES|IT|NL|PT|RU|JA|KO|ZHCN|ZHTW", "|")
For $iTWiiflow = 1 To $SplitTitleCurrentUSBWiiflow[0]
$hDownloadSize = InetGetSize("http://www.gametdb.com/titles.txt?LANG=" & $SplitTitleCurrentUSBWiiflow[$iTWiiflow])
$hDownload = InetGet("http://www.gametdb.com/titles.txt?LANG=" & $SplitTitleCurrentUSBWiiflow[$iTWiiflow], _
$SaveCurrentUSBWiiflow & "\Wiiflow\settings\" & $SplitTitleCurrentUSBWiiflow[$iTWiiflow] & "custom_titles.ini", 1, 1)
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " " & $SplitTitleCurrentUSBWiiflow[$iTWiiflow] & "custom_titles.ini | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " " & $SplitTitleCurrentUSBWiiflow[$iTWiiflow] & "custom_titles.ini Successfully Downloaded")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\settings\" & $SplitTitleCurrentUSBWiiflow[$iTWiiflow] & "custom_titles.ini"))
$CurrentUSBWiiflowSize += FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\settings\" & $SplitTitleCurrentUSBWiiflow[$iTWiiflow] & "custom_titles.ini")
If $SplitTitleCurrentUSBWiiflow[$iTWiiflow] = GUICtrlRead($HomebrewTypeBootDOLLanguage) Then _
FileCopy($SaveCurrentUSBWiiflow & "\Wiiflow\settings\" & $SplitTitleCurrentUSBWiiflow[$iTWiiflow] & "custom_titles.ini", $SaveCurrentUSBWiiflow & "\Wiiflow\settings\custom_titles.ini", 9)
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
Next
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " Boot.dol | " & $UpdateUSBWiiflowURL)
$DownloadCurrentUSBWiiflowSize = InetGetSize($UpdateUSBWiiflowURL)
$DownloadCurrentUSBWiiflow = InetGet($UpdateUSBWiiflowURL, $SaveCurrentUSBWiiflow & "\" & StringRegExpReplace($UpdateUSBWiiflowURL, "^.*/(.*)$", "$1"), 1, 1)
$CurrentUSBWiiflowSize += $DownloadCurrentUSBWiiflowSize
Do
$aInfo = InetGetInfo($DownloadCurrentUSBWiiflow)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $DownloadCurrentUSBWiiflowSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
Sleep(250)
Until $aInfo[2]
InetClose($DownloadCurrentUSBWiiflow)
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\" & StringRegExpReplace($UpdateUSBWiiflowURL, "^.*/(.*)$", "$1")))
GUICtrlSetData($CurrentUSBWiiflowState, "Successfully Downloaded | SHA1 Checksum: " & $StringSHA1Checksum)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (Archiv) Successfully Downloaded")
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
Local $sReadSHA1 = $SaveCurrentUSBWiiflow & "\" & StringRegExpReplace($UpdateUSBWiiflowURL, "^.*/(.*)$", "$1")
If StringStripWS($sReadSHA1, 8) <> "" And FileExists($sReadSHA1) Then
Local $bHash = _Crypt_HashFile($sReadSHA1, $CALG_SHA1)
ConsoleWrite("- Found USBWiiflow SHA1 Checksum: " & $bHash & @CRLF & "- Inter USBWiiflow SHA1 Checksum: 0x" & $StringSHA1Checksum)
GUICtrlSetData($LogInput, "- Found USBWiiflow SHA1 Checksum: " & $bHash)
GUICtrlSetData($LogInput, "- Inter USBWiiflow SHA1 Checksum: 0x" & $StringSHA1Checksum)
If $bHash = "0x" & $StringSHA1Checksum Then
$ReturnCurrentUSBWiiflowURL = "Wiiflow Mod " & $UpdateUSBWiiflowRelease & " Successfully Downloaded and verified | SHA1 Checksum: " & $StringSHA1Checksum & " | " & _
StringFormat("%.2f", Round(_Timer_Diff($startGeneratetime) / 1000, 2)) & " Seconds"
GUICtrlSetData($CurrentUSBWiiflowState, $ReturnCurrentUSBWiiflowURL)
Else
$ReturnCurrentUSBWiiflowURL = "Wiiflow Mod " & $UpdateUSBWiiflowRelease & " already exists but it failed SHA1 verification. | SHA1 Checksum: " & $StringSHA1Checksum
GUICtrlSetData($CurrentUSBWiiflowState, $ReturnCurrentUSBWiiflowURL)
EndIf
Else
$ReturnCurrentUSBWiiflowURL = "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " Failed ! | SHA1 Checksum: " & $StringSHA1Checksum
GUICtrlSetData($CurrentUSBWiiflowState, $ReturnCurrentUSBWiiflowURL)
EndIf
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
;==============> download Plugins
For $iDowPlugin = 0 To 5
$hDownloadSize = InetGetSize($GCWiiFlowPlugInsUpdate[$iDowPlugin][0])
$hDownload = InetGet($GCWiiFlowPlugInsUpdate[$iDowPlugin][0], $SaveCurrentUSBWiiflow & "\Wiiflow\plugins\" & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1], 1, 1)
$CurrentUSBWiiflowSize += $hDownloadSize
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " Plugins (" & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & ") | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " Plugins (" & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & ") Successfully Downloaded")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\Wiiflow\plugins\" & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1]))
If StringInStr($GCWiiFlowPlugInsUpdate[$iDowPlugin][1], "fceugx") <> 0 Then
$CurrentPluginFile = FileOpen($SaveCurrentUSBWiiflow & "\Wiiflow\plugins\fceugx.ini", 2)
FileWrite($CurrentPluginFile, '[PLUGIN]' & @CRLF & _
'magic=46434555' & @CRLF & _
'coverColor=ff0000' & @CRLF & _
'coverFolder=fceugx' & @CRLF & _
'fileTypes=.nes|.fds|.nsf|.unf|.nez|.unif|.zip|.7z' & @CRLF & _
'romDir=' & GUICtrlRead($fceugxFolderinput) & @CRLF & _
'dolFile=' & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & @CRLF & _
'bannerSound=nes.ogg' & @CRLF & _
'displayname=FCEUltraGX' & @CRLF & _
'ReturnLoader=yes')
FileClose($CurrentPluginFile)
ElseIf StringInStr($GCWiiFlowPlugInsUpdate[$iDowPlugin][1], "genplusgx") <> 0 Then
$CurrentPluginFile = FileOpen($SaveCurrentUSBWiiflow & "\Wiiflow\plugins\genplus-gx.ini", 2)
FileWrite($CurrentPluginFile, '[PLUGIN]' & @CRLF & _
'magic=53454741' & @CRLF & _
'coverColor=000000' & @CRLF & _
'coverFolder=genplusgx' & @CRLF & _
'fileTypes=.gen|.md|.zip' & @CRLF & _
'romDir=' & GUICtrlRead($genplusgxFolderinput) & @CRLF & _
'dolFile=' & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & @CRLF & _
'bannerSound=sega.ogg' & @CRLF & _
'displayname=GenPlusGX' & @CRLF & _
'ReturnLoader=yes')
FileClose($CurrentPluginFile)
ElseIf StringInStr($GCWiiFlowPlugInsUpdate[$iDowPlugin][1], "scummvm") <> 0 Then
$CurrentPluginFile = FileOpen($SaveCurrentUSBWiiflow & "\Wiiflow\plugins\scummvm_plugin.ini", 2)
FileWrite($CurrentPluginFile, '[PLUGIN]' & @CRLF & _
'magic=5343564D' & @CRLF & _
'coverColor=fcff00' & @CRLF & _
'coverFolder=scummvm' & @CRLF & _
'fileTypes=' & @CRLF & _
'romDir=scummvm.ini' & @CRLF & _
'dolFile=' & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & @CRLF & _
'bannerSound=' & @CRLF & _
'displayname=ScummVM' & @CRLF & _
'ReturnLoader=yes')
FileClose($CurrentPluginFile)
ElseIf StringInStr($GCWiiFlowPlugInsUpdate[$iDowPlugin][1], "snes9x") <> 0 Then
$CurrentPluginFile = FileOpen($SaveCurrentUSBWiiflow & "\Wiiflow\plugins\snes9x-gx.ini", 2)
FileWrite($CurrentPluginFile, '[PLUGIN]' & @CRLF & _
'magic=534e4553' & @CRLF & _
'coverColor=01a300' & @CRLF & _
'coverFolder=snes9xgx' & @CRLF & _
'fileTypes=.smc|.fig|.sfc|.swc|.zip|.7z' & @CRLF & _
'romDir=' & GUICtrlRead($snes9xgxFolderinput) & @CRLF & _
'dolFile=' & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & @CRLF & _
'bannerSound=snes.ogg' & @CRLF & _
'displayname=SNES9xGX' & @CRLF & _
'ReturnLoader=yes')
FileClose($CurrentPluginFile)
ElseIf StringInStr($GCWiiFlowPlugInsUpdate[$iDowPlugin][1], "vbagx") <> 0 Then
$CurrentPluginFile = FileOpen($SaveCurrentUSBWiiflow & "\Wiiflow\plugins\vbagx.ini", 2)
FileWrite($CurrentPluginFile, '[PLUGIN]' & @CRLF & _
'magic=56424158' & @CRLF & _
'coverColor=fcff00' & @CRLF & _
'coverFolder=vbagx' & @CRLF & _
'fileTypes=.agb|.gba|.bin|.elf|.mb|.dmg|.gb|.gbc|.cgb|.sgb|.zip|.7z' & @CRLF & _
'romDir=' & GUICtrlRead($vbagxFolderinput) & @CRLF & _
'dolFile=' & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & @CRLF & _
'bannerSound=gba.ogg' & @CRLF & _
'displayname=VbaGX' & @CRLF & _
'ReturnLoader=yes')
FileClose($CurrentPluginFile)
ElseIf StringInStr($GCWiiFlowPlugInsUpdate[$iDowPlugin][1], "wii64") <> 0 Then
$CurrentPluginFile = FileOpen($SaveCurrentUSBWiiflow & "\Wiiflow\plugins\wii64.ini", 2)
FileWrite($CurrentPluginFile, '[PLUGIN]' & @CRLF & _
'magic=57493634' & @CRLF & _
'coverColor=ffffff' & @CRLF & _
'coverFolder=wii64' & @CRLF & _
'fileTypes=.n64|.v64|.z64|.zip' & @CRLF & _
'romDir=' & GUICtrlRead($wii64Folderinput) & @CRLF & _
'dolFile=' & $GCWiiFlowPlugInsUpdate[$iDowPlugin][1] & @CRLF & _
'bannerSound=n64.ogg' & @CRLF & _
'displayname=Wii64' & @CRLF & _
'ReturnLoader=yes')
FileClose($CurrentPluginFile)
EndIf
If $CancelBTNCancelState = 1 Then
GUICtrlSetData($LogInput, "Operation cancelled by user")
GUICtrlSetData($CurrentUSBWiiflowState, "Operation cancelled by user")
Return "Operation cancelled by user"
EndIf
Next
$hDownloadSize = InetGetSize("http://open-wiiflow-mod.googlecode.com/svn/branches/WiiFLowLoader/WiiFlowLoaderChannel - WIIH.wad")
$hDownload = InetGet("http://open-wiiflow-mod.googlecode.com/svn/branches/WiiFLowLoader/WiiFlowLoaderChannel - WIIH.wad", $SaveCurrentUSBWiiflow & "\wad\WiiFlowLoaderChannel - WIIH.wad", 1, 1)
$CurrentUSBWiiflowSize += $hDownloadSize
Do
$aInfo = InetGetInfo($hDownload)
$iPercent = StringFormat("%.2f", Round($aInfo[0] / $hDownloadSize * 100, 2))
GUICtrlSetData($CurrentUSBWiiflowState, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " Plugins (WiiFlowLoaderChannel - WIIH.wad) | Size: " & _FormatFileSize($aInfo[1]) & " | Downloaded: " & _
_FormatFileSize($aInfo[0]) & " / " & _FormatFileSize($aInfo[1]) & " | Percent: " & $iPercent & "% ")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransfered, _FormatFileSize(GUICtrlRead($HomebrewListViewTransferedUnformated) + $aInfo[0]))
Sleep(250)
Until $aInfo[2]
InetClose($hDownload)
GUICtrlSetData($LogInput, "Download : Wiiflow Mod " & $UpdateUSBWiiflowRelease & " Plugins (WiiFlowLoaderChannel - WIIH.wad) Successfully Downloaded")
If $CurrentUSBWiiflow_ListN > -1 Then GUICtrlSetData($HomebrewListViewTransferedUnformated, GUICtrlRead($HomebrewListViewTransferedUnformated) + FileGetSize($SaveCurrentUSBWiiflow & "\wad\WiiFlowLoaderChannel - WIIH.wad"))
;<============== download Plugins
$ReturnCurrentUSBWiiflowURL = "Wiiflow Mod " & $UpdateUSBWiiflowRelease & " (Mega Pack) Successfully Downloaded and verified | " & _
StringFormat("%.2f", Round(_Timer_Diff($startGeneratetime) / 1000, 2)) & " Seconds"
GUICtrlSetData($CurrentUSBWiiflowState, $ReturnCurrentUSBWiiflowURL)
GUICtrlSetData($LogInput, $ReturnCurrentUSBWiiflowURL)
Return $ReturnCurrentUSBWiiflowURL
EndFunc ;==>_CurrentUSBWiiflowURL
Func _splitInfo($Mainstring, $Childstring, $ReturnT = 0)
$Arraystring = StringRegExp($Mainstring, $Childstring, 3)
If IsArray($Arraystring) Then
If $ReturnT = 0 Then
Return $Arraystring
Else
Return StringRegExpReplace($Arraystring[0], ' ', '')
EndIf
Else
Return ""
EndIf
EndFunc ;==>_splitInfo
Func _FormatFileSize($sFunc_Size = 0)
Local $sFS = ""
If $sFunc_Size < 1000 Then
$sFS = $sFunc_Size & " B"
ElseIf $sFunc_Size > 1000000000 Then
$sFS = StringFormat("%.2f", Round($sFunc_Size / 1000000000, 2)) & " Gb"
ElseIf $sFunc_Size > 1000000 Then
$sFS = StringFormat("%.2f", Round($sFunc_Size / 1000000, 2)) & " Mb"
ElseIf $sFunc_Size > 1000 Then
$sFS = StringFormat("%.2f", Round($sFunc_Size / 1000, 2)) & " Kb"
EndIf
Return $sFS
EndFunc ;==>_FormatFileSize