zenith391 / OCEmu

OpenComputers Emulator in Lua
53 stars 22 forks source link

Wget.lua - Add dlls to compilator #9

Open tt-thoma opened 3 years ago

tt-thoma commented 3 years ago

I'm trying to download a file from github using wget (wget -f https://raw.githubusercontent.com/IgorTimofeev/MineOS/master/Installer/BIOS.lua /tmp/bios.lua) but wget say Connection refused I tried to allow the emulator on my firewall, but still the same error What can I do ?

Edit: pastebin works normally

zenith391 commented 3 years ago

Well to fix this I would need to know what's the precise error in the first place, if you can send that

tt-thoma commented 3 years ago

GitHub refuse any connection from the function internet.request()

zenith391 commented 3 years ago

On my computer, wget -f https://raw.githubusercontent.com/IgorTimofeev/MineOS/master/Installer/BIOS.lua /tmp/bios.lua works correctly alongside using internet.request() for GitHub. Can you open https://raw.githubusercontent.com/IgorTimofeev/MineOS/master/Installer/BIOS.lua in your browser or does it only not work using internet.request() in OCEmu ?

tt-thoma commented 3 years ago

Have you tried to do the command in the emulator ?

zenith391 commented 3 years ago

Yes, by on my computer I meant in OCEmu using OpenOS.

tt-thoma commented 3 years ago

Can I have your version of OCEmu ? Your README.md is saying that you haven't compiled the current version yet

misiuji commented 3 years ago

I have the same issue on OCEmu. I think it's a windows issue, because zenith uses linux I think

image

also removing the -f option

image

tt-thoma commented 3 years ago

It's because @zenith391 have the last version

tt-thoma commented 3 years ago

After compiling it says "unsupported protocol"

misiuji commented 3 years ago

change https:// to http://

tt-thoma commented 3 years ago

Maybe github refuse connection just because it wants https but there is no https protocol in \src\extras\socket

misiuji commented 3 years ago

maybe, here is the wget command in a normal terminal image

first request gets 301 Moved Permanently pointing to https url secound request gets 200 ok

tt-thoma commented 3 years ago

@zenith391 Can you add an https addon ?

tt-thoma commented 3 years ago

image Opencomputers ^ OCemu V image The real Openos support https protocol.

misiuji commented 3 years ago

seems like the install script doesn't install luasec correctly this would explain why this happens only on windows

tt-thoma commented 3 years ago

image

misiuji commented 3 years ago

well if you look in /src/extras/ssl there is https.lua that's where it shoud be image

tt-thoma commented 3 years ago

image I moved it and i'll try to recompilate

misiuji commented 3 years ago

image this is how internet.lua gets https, but it doesn't find it

tt-thoma commented 3 years ago

Here we go again...

misiuji commented 3 years ago

I moved it and i'll try to recompilate

recompiling will on do anything since the OCEmu.exe just calls boot.lua

misiuji commented 3 years ago

if you launch OCEmu via mingw then it works image image

tt-thoma commented 3 years ago

Ok

misiuji commented 3 years ago

I think it's not stripping the ssl core correctly, but I can be entirely wrong

misiuji commented 3 years ago

after requiring ssl at boot:

image at the bottom: "cannot find specified module"

manual boot from console works

tt-thoma commented 3 years ago

ffi file is missing What is it ?

misiuji commented 3 years ago

it's a lua library https://luajit.org/ext_ffi.html

tt-thoma commented 3 years ago

Pls have you a tutorial to install I am stuck I have windows 64 bits I try following the readme nothing work I'm tired of solving problems

misiuji commented 3 years ago

for windows all you have to do is (once you installed msys2) run the script msys2_setup_ocemu.sh with mingw64.exe and hit enter a coupple of times, it should make a file OCEmu.exe in src dir

misiuji commented 3 years ago

there are no libeay32.dll and ssleay32.dll in any of the the bin folders i think that the issue as per this stackoverflow thread

tt-thoma commented 3 years ago

YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEES

Thank you so munch

tt-thoma commented 3 years ago

How to do:

  1. Download and install MSYS2
  2. Follow the steps
  3. Go to https://www.dll-files.com/ and search for libeay32.dll and ssleay32.dll
  4. Download both
  5. Extract both
  6. Place both in C:\msys64\usr\bin. Use the custom path if you set one.
  7. Type MinGW in the windows search bar, then launch it
  8. In any folder you want, run: git clone https://github.com/zenith391/OCEmu
  9. Go to the newly created OCEmu folder.
  10. Run ./msys2_setup_ocemu.sh. Sometimes you'll need to press enter

After that (considering that there is no error(s) while compiling), go to src, and you'll find the file OCEmu.exe

misiuji commented 3 years ago

now how to put this into the setup script @zenith391? just download it from dll-files as a work around or some other way?

fixator10 commented 3 years ago

So, after some digging in it with process hacker: image ssl.dll by itself, most likely (based on its size), does nothing other than just loading and, probably, mapping SSL libs. The libraries itself are looked in PATH, and since MingW sets path to its own bin folder - its works in MingW. Doing set PATH=%PATH%;C:\msys64\mingw64\bin (assuming msys is installed to C:\msys64) before starting OCEmu fixes issue with HTTPS.

So basically, for standalone SSL support in OCEmu you need to: add folder with required libs to PATH or copy SSL libraries to PATH (or in folder with ocemu.exe, which is, basically, first place, where OS looking for files/libraries before looking for them in PATH)

Example of SSL after copying libcrypto-1_1-x64.dll and libssl-1_1-x64.dll to folder with OCEmu.exe: image