Netsurf installer: Ready to use!

git-svn-id: svn://kolibrios.org@6905 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
ashmew2 2017-05-25 11:57:57 +00:00
parent 3258646683
commit 17b4bf3701

View File

@ -50,7 +50,7 @@ proc get_file_over_http targeturl, targetfilename
mov [write_to_file.bufptr], eax
DEBUGF 1, "---- HTTP : Getting %s\n", [targeturl]
invoke HTTP_get, [targeturl], 0, FLAG_KEEPALIVE, 0
invoke HTTP_get, [targeturl], 0, FLAG_KEEPALIVE or FLAG_BLOCK, 0
cmp eax, 0
je .http_error
mov [httpstruct], eax
@ -63,11 +63,12 @@ proc get_file_over_http targeturl, targetfilename
.http_receive_loop:
DEBUGF 1, "---- Receiving over http.\n"
DEBUGF 1, "---- Invoking http receive.\n"
invoke HTTP_receive, [httpstruct]
cmp eax, 0
je .http_transfer_done
mov ebp, [httpstruct]
DEBUGF 1, "---- http flags = 0x%x.\n", [ebp + http_msg.flags]
test [ebp + http_msg.flags], 0xffff0000
@ -165,18 +166,22 @@ proc make_new_folder newfolder
endp
START:
mcall 68, 11 ; init heap so we can allocate memory dynamically
mcall 68, 11 ; init heap
; load libraries
stdcall dll.Load, @IMPORT
test eax, eax
jnz .all_files_done_error
DEBUGF 2, "-------------------------\n"
DEBUGF 2, "NETSURF INSTALLER.\n"
stdcall make_new_folder, dirname_res
stdcall make_new_folder, dirname_res_pointers
stdcall make_new_folder, dirname_res_throbber
stdcall make_new_folder, dirname_res_icons
.get_next_file:
mov edi, current_url
mov esi, url
@ -219,14 +224,16 @@ START:
;; current_filename is now set to the name of the file
;; current_url is now set to the name of the file we will get after download
DEBUGF 2, "-------- [START] Fetching : %s\n", current_url
DEBUGF 2, "Fetching : %s", current_filename
stdcall get_file_over_http, current_url, current_filename
DEBUGF 2, "-------- [END] Fetching : %s\n", current_url
DEBUGF 2, "...DONE!\n"
jmp .get_next_file
.all_files_done:
DEBUGF 1, "-------------------------\n"
DEBUGF 1, "NETSURF INSTALLED. Enjoy!\n"
DEBUGF 2, "-------------------------\n"
DEBUGF 2, "NETSURF INSTALLED. Enjoy!\n"
DEBUGF 2, "-------------------------\n"
mcall -1
;; Inform user that all files are done
.all_files_done_error:
@ -311,9 +318,7 @@ filelist db 'nskolibrios', 0
db 'res/icons/reload.png', 0
db 0
current_url rb URLMAXLEN
filelistoffset dd filelist
current_filename rb FILENAMEMAXLEN
httpstruct dd 0
create_new_file dd 2, 0, 0, 0, 0
@ -331,4 +336,7 @@ write_to_file dd 3
db 0
dd current_filename
socketdata rb 4096
current_url rb URLMAXLEN
current_filename rb FILENAMEMAXLEN
I_END: