scripts
scripts copied to clipboard
SteamScript: make sure Steam is closed after installation
Currently, it is possible that a user runs Steam after it is installed. However, the SteamScript will not continue before Steam is closed.
Find a way to ensure that Steam is closed. If that's not possible, change the setup wizard to show a hint.
Would wine.kill() do the trick?
The problem is not to close Steam. That's easily possible with:
wine.runInsidePrefix(wine.getProgramFiles() + "/Steam/Steam.exe", "-shutdown");
But you have to know when you can do that (i.e. when the installation is finished). As it is right now, wine.wait() does not return after Steam has been installed but only after Steam has been closed after the installation.
Then you could easily check the manifest file
Just to clarify: this issue is not about the installation of a game via Steam (this works already). It is about the installation of Steam itself.
The steamapps folder is created at first startup (after the Steam update). So this could be checked. But we then we need to figure out if the setup has finished already.
The core problem is that the process builder looks at the wine process and not at the SteamSetup process. Therefore, the Steam process is blocking the waitFor().
I have an idea: wine script:
that.isRunning = function () {
if(that._process) {
try {
that._process.exitValue();
return false;
} catch (err) {
return true;
}
}
return false;
};
SteamScript:
while (wine.isRunning())
{
java.lang.Thread.sleep(1000);
if (fileExists(wine.prefixDirectory + "/drive_c/" + wine.getProgramFiles() + "/Steam/steamapps")) {
wine.runInsidePrefix(wine.getProgramFiles() + "/Steam/Steam.exe", "-shutdown");
}
}
But the isRunning() does not work. It immediately returns 0.
Hum, we need to implement a real process manager bean in java that takes this need into account.
Basically you need an event triggered when the process is stopped. This can be done without active waiting
Yes. But I think that can be delayed.
For now, we should get the required verbs finished so that people can start rewriting their scripts. If the scripts are done, PoL 5 is already pretty much usable.
Agreed on that