steamworks.js: Can't find binaries on windows + electron-forge
I am trying to work on a steam integration for our game on a M2 Mac, but due to the overlay not working (#50) I decided to use the Parallels Desktop instead. But on Windows in Parallels I am getting this error:
App threw an error during load
Error: The specified module could not be found.
\\?\C:\Users\vsobotka\workspace\landia\desktop_app\.webpack\main\native_modules\dist\win64\steamworksjs.win32-x64-msvc.node
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
at Module._extensions..node (node:internal/modules/cjs/loader:1259:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:2:1822)
at Module.load (node:internal/modules/cjs/loader:1044:32)
at Module._load (node:internal/modules/cjs/loader:885:12)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1068:19)
at require (node:internal/modules/cjs/helpers:103:18)
at ./node_modules/steamworks.js/dist/win64/steamworksjs.win32-x64-msvc.node (C:\Users\vsobotka\workspace\landia\desktop_app\.webpack\main\index.js:933:18)
at __webpack_require__ (C:\Users\vsobotka\workspace\landia\desktop_app\.webpack\main\index.js:1200:42)
We are using electron forge to wrap our app, and this is the error thrown by either electron-forge start
or by trying to execute the exe from electron-forge make
. Is it not supposed to work, or am I missing something?
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 3
- Comments: 19 (4 by maintainers)
my solution
forge.config.js
Hi guys, I think I have solved the problem. I can’t tell if it’s related to VCRUNTIME140.dll or not, all I can say is that installing the redist people wrote about didn’t solved my issue.
I solved JUST COPYING THE FILES “steam_api64.dll” and “steam_api64.lib” in the same directory where “steamworksjs.win32-x64-msvc.node” stands that is “[PROJECTNAME]\resources\app.asar.unpacked\node_modules\steamworks.js\dist\win64” I copied them from the “node_modules\steamworks.js\dist\win64”
I used this program to check what was the dependencies that was missing “https://github.com/lucasg/Dependencies” and it told me that it was “steam_api64.dll”
Hey, I was able to debug what was going on. It turns out that if you are missing the file VCRUNTIME140.dll the native module will fail to load and give this cryptic error message. See: https://stackoverflow.com/questions/41253450/error-the-specified-module-could-not-be-found
The solution was to include the latest Visual C++ Redist on the game configuration in the Steamworks admin (installation -> redistributables) so that it automatically installs when the game installs.
If you are facing this error, installing the Visual C++ redistributable should solve the problem. Otherwise it is possible this can also be solved if the file is included with steamworks.js together with the library, but given we’re publishing on Steam anyway this seems like a much cleaner way to do it, just needs to be documented somewhere.