-
Save
greenwtf.ps1
(included in the gist below) to a directory of your choosing. -
Copy
steam_api.dll
to that directory, from the Steamworks SDK 1.34 (that exact version) -
Create a
steam_appid.txt
file in that directory, containing an app ID that you own. -
Launch Steam, logged in as your developer account.
-
Run the script like this:
powershell -ExecutionPolicy Bypass -File greenwtf.ps1
-
nw.js will start; the UI will say, "SteamAPI Init: true" to indicate that everything's working so far.
-
Click the "overlay" button. The app will crash.
Don't trust the script? You can read it and reproduce the effect yourself.
-
Download and extract http://dl.nwjs.io/v0.12.1/nwjs-v0.12.1-win-ia32.zip
-
Download and extract https://github.com/greenheartgames/greenworks/releases/download/0.5.1/greenworks-v0.5.1-nw-0.12.1.zip
-
Copy greenworks.js into the nwjs directory containing nw.exe
-
Copy steam_api.dll into the greenworks lib directory
-
Copy the greenworks lib directory into the nwjs directory containing nw.exe
-
Copy steam_appid.txt next to nw.exe
-
Create this index.html file next to nw.exe
<html>
<head>
<meta charset="utf-8">
<title>Hello Greenworks</title>
</head>
<body>
<h1>Greenworks Test</h1>
SteamAPI Init:
<script>
var greenworks = require('./greenworks');
document.write(greenworks.initAPI());
</script>
<button id="overlay">overlay</button>
<script>
var overlay = document.getElementById("overlay");
overlay.onclick = function() {
greenworks.activateGameOverlayToWebPage("http://store.steampowered.com/")
}
</script>
</body>
- Create this package.json next to nw.exe.
{
"name": "greenworks-nw-demo",
"main": "index.html",
"chromium-args": "--in-process-gpu --disable-transparency"
}
-
Launch nw.exe; the UI will say, "SteamAPI Init: true" to indicate that everything's working so far.
-
Click the overlay button; the app will crash.