cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
caverna
Engaged Sweeper III
Hi guys, I'd like to suggest a little improvement.
When you go to Configuration tab, we can compare the last version.
But for lspush we need to access the server, right click and look at details.
What about just grab the version from lspush too?
2 REPLIES 2
caverna
Engaged Sweeper III
What I'm proposing is a single place to check versions.
Just look at configuration tab and update.aspx. I see no reason to include at least the lspush version that is at Lansweeper folder at server.
To get it's version, just use this piece of code:

public static string GetVersion(string path)
{
if (!File.Exists(path)) return null;

var stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
stream.Dispose();

var domain = AppDomain.CreateDomain("TemporaryDomainToLoadVersion");
var assembly = domain.Load(buffer);
var version = assembly.GetName().Version;
var result = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
AppDomain.Unload(domain);

return result;
}
Esben_D
Lansweeper Employee
Lansweeper Employee
You can already see if an old LsPush version is used to scan your assets. In the Scan time tab of your asset's page, Lansweeper will display if the LsPush version used is not the one designed for your current Lansweeper version.

lspush version

Unfortunately, there is no way to check this before LsPush scans are performed. Additionally, in some cases LsPush scans might give erros if severe changes are made to LsPush.