Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #AutoIt3Wrapper_Compression=4
- #AutoIt3Wrapper_UseUpx=y
- #AutoIt3Wrapper_Res_Fileversion=0.0.0.14
- #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
- #AutoIt3Wrapper_Res_LegalCopyright=2016 @ Tarumes
- #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
- #AutoIt3Wrapper_Run_Tidy=y
- #Tidy_Parameters=/tc 1 /gd /rel
- #AutoIt3Wrapper_Tidy_Stop_OnError=n
- #Au3Stripper_Parameters=/rm
- ;*****************************************
- ;Launcher by Tarumes
- ;https://creativecommons.org/licenses/by/2.0/
- ;2016-08-31 12:34
- ;*****************************************
- #include <StaticConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <GuiButton.au3>
- #include <InetConstants.au3>
- #include-once
- DirCreate('locales')
- FileInstall('C:\7za.exe', @ScriptDir & '\7za.exe', 0)
- FileInstall('C:\7zip_license.txt', @ScriptDir & '\7za.exe', 0)
- FileInstall('C:\nwjs\snapshot_blob.bin', @ScriptDir & '\snapshot_blob.bin', 0)
- FileInstall('C:\nwjs\credits.html', @ScriptDir & '\credits.html', 0)
- FileInstall('C:\nwjs\d3dcompiler_47.dll', @ScriptDir & '\d3dcompiler_47.dll', 0)
- FileInstall('C:\nwjs\ffmpeg.dll', @ScriptDir & '\ffmpeg.dll', 0)
- FileInstall('C:\nwjs\Game.exe', @ScriptDir & '\Game.exe', 0)
- FileInstall('C:\nwjs\icudtl.dat', @ScriptDir & '\icudtl.dat', 0)
- FileInstall('C:\nwjs\libEGL.dll', @ScriptDir & '\libEGL.dll', 0)
- FileInstall('C:\nwjs\libGLESv2.dll', @ScriptDir & '\libGLESv2.dll', 0)
- FileInstall('C:\nwjs\natives_blob.bin', @ScriptDir & '\natives_blob.bin', 0)
- FileInstall('C:\nwjs\node.dll', @ScriptDir & '\node.dll', 0)
- FileInstall('C:\nwjs\nw.dll', @ScriptDir & '\nw.dll', 0)
- FileInstall('C:\nwjs\nw_100_percent.pak', @ScriptDir & '\nw_100_percent.pak', 0)
- FileInstall('C:\nwjs\nw_200_percent.pak', @ScriptDir & '\nw_200_percent.pak', 0)
- FileInstall('C:\nwjs\nw_elf.dll', @ScriptDir & '\nw_elf.dll', 0)
- FileInstall('C:\nwjs\nw_material_100_percent.pak', @ScriptDir & '\nw_material_100_percent.pak', 0)
- FileInstall('C:\nwjs\nw_material_200_percent.pak', @ScriptDir & '\nw_material_200_percent.pak', 0)
- FileInstall('C:\nwjs\resources.pak', @ScriptDir & '\resources.pak', 0)
- FileInstall('C:\nwjs\locales\en-US.pak', @ScriptDir & '\locales\en-US.pak', 0)
- ;IniRead
- Local $inifile = 'launcher.ini'
- Local $vurl = IniRead($inifile, 'settings', 'url', '0')
- Local $vlver = IniRead($inifile, 'settings', 'version', '0')
- Local $vappid = IniRead($inifile, 'settings', 'appid', '0')
- Local $vGuiName = IniRead($inifile, 'settings', 'gamename', '0')
- ;END IniRead
- $GUI = GUICreate($vGuiName, 300, 200, -1, -1, -1, -1)
- $BGimage = GUICtrlCreatePic("C:\Users\Manuel\Desktop\ISN AutoIt Studio\Projects\Launcher\launcher.jpg", 0, 0, 300, 200, $WS_CLIPSIBLINGS)
- GUICtrlSetState(-1, $GUI_DISABLE)
- $start = GUICtrlCreateButton("Start Game", 100, 160, 100, 30, -1, -1)
- $prgbar = GUICtrlCreateProgress(50, 130, 200, 20, -1, -1)
- GUISetState(@SW_SHOW, $GUI)
- GUICtrlSetState($start, $GUI_DISABLE)
- Local $vPing = Ping($vurl, 4000)
- If $vPing > 0 Then
- InetGet('http://' & $vurl & '/' & $vappid & '/' & '/temp.ini', 'temp.dat', 1, 0)
- Local $aArray = IniReadSectionNames('temp.dat')
- If Not @error Then
- For $i = 1 To $aArray[0]
- If $aArray[$i] > $vlver Then
- GUICtrlSetData($prgbar, '0')
- Local $vSize = InetGetSize('http://' & $vurl & '/' & $vappid & '/' & $aArray[$i] & '.zip', 1)
- ConsoleWrite($vSize)
- Local $viGet = InetGet('http://' & $vurl & '/' & $vappid & '/' & $aArray[$i] & '.zip', $aArray[$i] & '.zip', 1, 1)
- While Not InetGetInfo($viGet, 2)
- Sleep(10)
- $BytesReceived = InetGetInfo($viGet, 0)
- Local $Pct = Int($BytesReceived / $vSize * 100)
- GUICtrlSetData($prgbar, $Pct)
- WEnd
- ShellExecuteWait('7za.exe', 'x ' & $aArray[$i] & '.zip' & ' -o.\temp\ -y', '', '', @SW_HIDE)
- FileDelete($aArray[$i] & '.zip')
- EndIf
- ShellExecuteWait('7za.exe', 'a -tzip package.nw .\temp\*', '', '', @SW_HIDE)
- DirRemove('temp', 1)
- IniWrite($inifile, 'settings', 'version', $aArray[$i])
- Next
- EndIf
- EndIf
- GUICtrlSetData($prgbar, '100')
- GUICtrlSetState($prgbar, $GUI_HIDE)
- GUICtrlSetState($start, $GUI_ENABLE)
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $start
- GUISetState(@SW_HIDE, $GUI)
- RunWait("Game.exe")
- Exit
- EndSwitch
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment