Run key change script in InstallController
parent
eb05364542
commit
16dc60b90a
|
@ -119,6 +119,7 @@ namespace LANCommander.PlaynitePlugin
|
||||||
|
|
||||||
RunInstallScript(installDirectory);
|
RunInstallScript(installDirectory);
|
||||||
RunNameChangeScript(installDirectory);
|
RunNameChangeScript(installDirectory);
|
||||||
|
RunKeyChangeScript(installDirectory);
|
||||||
|
|
||||||
InvokeOnInstalled(new GameInstalledEventArgs(installInfo));
|
InvokeOnInstalled(new GameInstalledEventArgs(installInfo));
|
||||||
}
|
}
|
||||||
|
@ -166,5 +167,23 @@ namespace LANCommander.PlaynitePlugin
|
||||||
|
|
||||||
return script.Execute();
|
return script.Execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int RunKeyChangeScript(string installDirectory)
|
||||||
|
{
|
||||||
|
var manifest = ManifestHelper.Read(installDirectory);
|
||||||
|
var script = new PowerShellScript();
|
||||||
|
|
||||||
|
var key = Plugin.LANCommanderClient.GetAllocatedKey(manifest.Id);
|
||||||
|
|
||||||
|
script.AddVariable("InstallDirectory", installDirectory);
|
||||||
|
script.AddVariable("GameManifest", manifest);
|
||||||
|
script.AddVariable("DefaultInstallDirectory", Plugin.Settings.InstallDirectory);
|
||||||
|
script.AddVariable("ServerAddress", Plugin.Settings.ServerAddress);
|
||||||
|
script.AddVariable("AllocatedKey", key);
|
||||||
|
|
||||||
|
script.UseFile(ScriptHelper.GetScriptFilePath(installDirectory, SDK.Enums.ScriptType.KeyChange));
|
||||||
|
|
||||||
|
return script.Execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue