Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice idea Custom SDK Launcher! #7

Merged
merged 2 commits into from
Dec 21, 2017
Merged

Nice idea Custom SDK Launcher! #7

merged 2 commits into from
Dec 21, 2017

Conversation

ghost
Copy link

@ghost ghost commented Dec 7, 2017

Hello Distroir, great job! - But I want give you big suggestion for Mono and UPX or VCPKG with zlib static x86.

I made mkbundle with "Custom SDK Launcher.exe" into bundled executable. "CustomSDKLauncher.exe" 20 mb and UPX to > 7 mb. And you don't need install Net Frameworks 4.x :) Because mkbundle is great bundler of net frameworks as "jit-compiler" or dotnet core.

I hope you allow me if I use mono into standalone executable. ( embedding assemblies into executable )

Keep your work!

Example bundled executable of Custom SDK Launcher.
https://mega.nz/#!xwpjxZxK!Mu_s1RTXu0dnLrzyiBzUC3_13jSZN_Ss7eNqCAKR_Gs
If you have errors than you have to install Mono Runtime whatever you would like that. Please reply me! I want listen that because I already re-compiled and re-installed mono runtime with cygwin-x86.

PS: Don't worry - it is my test. if you want show icon in bundled mono-application than you need to add icon-path after generated temp.c and add icon into temp.s ( Important because temp.s need to convert for embedding bytes from icon file like hxD or hex editor to bytes 1, 2, 3, ... )
And compile manuell from generated compile process of mkbundle. I hope you have to get bundled executable...

// EDIT:
Why do I need vcpkg?
If you use mkbundle -z --static --deps --keeptemp "Your app.exe" -o "Your generated bundled.exe" -v than you need to execute path from generated command line from generated mkbundle process "-I "Path-to-.include - zlib.h" and -L "Path to zlib.lib" or copy from vcpkg\installed\zlib-static-x86\include* and vcpkg\installed\zlib-static-x86\lib* to your output of debug or release directory of Custom SDK Launcher.exe than build again and it is standalone executable don't need install net frameworks :) Enjoy your bundled application!

If you have got errors and you make sure copy from mono-path-to-installed\include\mono-2.0* mono-path-to-installed\lib* all lib files into your debug or release of Custom SDK launcher than build again. It is really successful from compilation. And check if your executable works - If you are not sure than you need change from cl.exe line "/SUBSYSTEM:windows" to "/SUBSYSTEM:console" and generate again and check command line if it throws error example System.NullNotException or mscorlib need download errors. Please don't copy from C:\Windows\Microsoft.Net\frameworks\4.5! Copy just from "mono-path-to-installed\lib\mono\4.5*.dll to your release or debug directory just copy before "copy "C:\mono_x86\lib\mono\4.5*.dll ." - If you see before i18n assemblies couldn't found .

Remember Mono bundling is not only Net Frameworks mscorlib.dll just use mono's mscorlib.dll

// EDIT: If you have problem with wrong x64 of clang and cl from Visual Studio 2017 Community - you need build manuell.

  1. Download gedit.exe for Windows because it can load and write external large temp.s file ( bytes ... ) Don't use Notepad or Notepad++! Because both stopped of process if they can not load large temp.s ( more than 10.000 lines ) That is why I have tested with gedit for Windows can write large than 10.000 lines of text. And install gedit for Windows and open temp.s with gedit for Windows!
  2. Replace "assembly"_XXXXXXXXXXXXX to "_assembly"_XXXXXXXXXXXXXXX froM Ctrg + H and wait until all marked text "assembly" to "_assembly" than save temp.s and you see that progressbar shows. Until it is completed from saving. and Use command line:
    ""C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\ClangC2\14.10.25903\bin\HostX86\clang.exe" -c -x assembler -o temp.s.obj temp.s"
    And cl.exe in command line
    "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.exe" /MD /I "C:\Program Files\Mono\include\mono-2.0" /I "." "temp.c" "temp.s.obj" /link /SUBSYSTEM:windows /ENTRY:mainCRTStartup /NODEFAULTLIB libmono-static-sgen.lib kernel32.lib version.lib ws2_32.lib mswsock.lib psapi.lib shell32.lib oleaut32.lib ole32.lib winmm.lib user32.lib advapi32.lib ucrt.lib vcruntime.lib msvcrt.lib oldnames.lib zlib.lib /LIBPATH:"C:\Program Files\Mono\lib" /LIBPATH:"." /OUT:"CustomSDKLauncher.exe"
    Than you check generated bundled executable! If you don't see if it happens wioth mscorlib.dll or System.NullNotException errors you can use like this
    "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.exe" /MD /I "C:\Program Files\Mono\include\mono-2.0" /I "." "temp.c" "temp.s.obj" /link /SUBSYSTEM:console /ENTRY:mainCRTStartup /NODEFAULTLIB libmono-static-sgen.lib kernel32.lib version.lib ws2_32.lib mswsock.lib psapi.lib shell32.lib oleaut32.lib ole32.lib winmm.lib user32.lib advapi32.lib ucrt.lib vcruntime.lib msvcrt.lib oldnames.lib zlib.lib /LIBPATH:"C:\Program Files\Mono\lib" /LIBPATH:"." /OUT:"CustomSDKLauncher.exe"

And type in command line CustomSDKLauncher.exe
Output:

Your release or debug>

It means OK! If you see errors than you need fix. Thanks!
Sorry my bad English! Thanks!

@RadCraftplay
Copy link
Owner

RadCraftplay commented Dec 9, 2017

There are some problems with scaling on Windows 10, but it seems very interesting idea. I need to do research on this topic. I'm very positive about this idea.

Btw. Next time use "Issues" tab if you want to submit an idea. Pull requests are used for submitting code to repo.

@ghost
Copy link
Author

ghost commented Dec 10, 2017

Allright thanks you are right. :)

@RadCraftplay RadCraftplay self-assigned this Dec 11, 2017
@RadCraftplay
Copy link
Owner

Discussion on this idea will be continued here:
#8

@RadCraftplay RadCraftplay mentioned this pull request Dec 21, 2017
@RadCraftplay
Copy link
Owner

Templates:

  • Added "Day of Infamy" template (thanks joewinkler)
  • Added "Black Mesa" template (thanks cd5ssmffan)

@RadCraftplay RadCraftplay merged commit 42e8290 into master Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant