summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2024-01-11 15:31:18 -0300
committerFrederico Linhares <fred@linhares.blue>2024-01-11 15:31:18 -0300
commit62d9c646dd411f1cc067de804880751b9aaa0a77 (patch)
tree9c6d042471557b360597771fedc306e504b25a75
parente2581a8209c549fd3f88be671c9bcd6447ec1dac (diff)
fixt Fix several bugs in the Windows installation
* Rakefile: Link against winsock2 * ruby_build_config.rb: Add sockets to the engine for on-line gaming. * src/core.cpp: Windows needs to read mrb files as binaries. * windows_installer.nsi: write uninstaller before listing files seems to cause bugs.
-rw-r--r--Rakefile3
-rw-r--r--ruby_build_config.rb3
-rw-r--r--src/core.cpp2
-rw-r--r--windows_installer.nsi6
4 files changed, 8 insertions, 6 deletions
diff --git a/Rakefile b/Rakefile
index eeab51a..f7f0aa4 100644
--- a/Rakefile
+++ b/Rakefile
@@ -55,7 +55,8 @@ LIBRARIES = [
'SDL2',
'SDL2_mixer',
'freetype',
- 'm'
+ 'm',
+ 'ws2_32'
] + OS_LIBRARIES
PKG_CONFIG = [
diff --git a/ruby_build_config.rb b/ruby_build_config.rb
index 5992059..cb495f1 100644
--- a/ruby_build_config.rb
+++ b/ruby_build_config.rb
@@ -1,7 +1,8 @@
MRuby::Build.new do |conf|
conf.toolchain
- conf.gem "#{Dir.pwd}/mrbgems/mruby-struct"
+ conf.gem core: "mruby-struct"
+ conf.gem core: "mruby-socket"
conf.gembox "math"
conf.gembox "metaprog"
conf.gembox "stdlib"
diff --git a/src/core.cpp b/src/core.cpp
index d47127b..ec79fa0 100644
--- a/src/core.cpp
+++ b/src/core.cpp
@@ -135,7 +135,7 @@ load_game(void *obj)
cg_graphic_init_config(cg_core.mrb);
- fp = fopen(cg_core.game_file.c_str(), "r");
+ fp = fopen(cg_core.game_file.c_str(), "rb");
mrb_load_irep_file(cg_core.mrb, fp);
fclose(fp);
if (cg_core.mrb->exc)
diff --git a/windows_installer.nsi b/windows_installer.nsi
index 31a39c5..cbe11a8 100644
--- a/windows_installer.nsi
+++ b/windows_installer.nsi
@@ -28,8 +28,6 @@ Page instfiles
UninstPage instfiles
Section
- WriteUninstaller $INSTDIR\${UNINSTNAME}.exe
-
SetOutPath "$INSTDIR"
File candy_gear.exe
File "$%DLL_PATH%\\libbrotlicommon.dll"
@@ -60,13 +58,15 @@ Section
SetOutPath "$INSTDIR\lib"
File /r lib\*.rb
+ WriteUninstaller $INSTDIR\${UNINSTNAME}.exe
+
WriteRegStr ${REGHKEY} "${REGPATH}\${REGAPPKEY}" "InstallLocation" \
"$INSTDIR"
WriteRegStr ${REGHKEY} "${REGPATH_WINUNINST}\${REGAPPKEY}" "DisplayName" \
"CandyGear"
WriteRegStr ${REGHKEY} "${REGPATH_WINUNINST}\${REGAPPKEY}" \
- "UninstallString" '"$INSTDIR\${UNINSTNAME}.exe"'
+ "UninstallString" "$INSTDIR\${UNINSTNAME}.exe"
WriteRegStr ${REGHKEY} "${REGPATH_WINUNINST}\${REGAPPKEY}" \
"InstallLocation" "$INSTDIR"
SectionEnd