Where to Start (C#)

Don
Joined
5 Oct 2005
Posts
11,239
Location
Liverpool
My employer has just asked me to do a website that will log all the software that is on a persons computer... any ideas where to start with this? I dont know if this is possible in C#.... I was thinking a web application... but I dont know what to do or where to start...

Thanks in advance

Stelly
 
Hi,

To be honest, most people use SMS reporting or software such as BigFix to report and identify software on users machines (id'ing exe's etc.)

That said, there is some fairly simple scripting that can be used to return a list + info on installed software. Take a peek:

List All Installed Software

EDIT: Changed link to working one! ;)

Fairly easy to incorporate into a website or translate into C/VB

Cheers,
Jamie.
 
Last edited:
What do you mean by 'all the software that is on a persons computer...'?
Do you want a list of every .exe file? Everything that has put entries in the registry? Everything present in the add/remove programs list?

This would be the first place to start.

Also, if you did this as a website would you have the correct permissions to get access to a users hard drive?
 
Haircut said:
Also, if you did this as a website would you have the correct permissions to get access to a users hard drive?

Agreed, may be better to run something like this within a login script - saving the information to the network - then create a webpage that displays the data.
 
Hi Guys....

I was being lazy after reading through the msdn lib and some trial and error this is what I did... (bit of a cheat but it should do..)



Response.Write("<b>Current Account: ");
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
Response.Write("</b><br>");
string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(uninstallKey))
{
foreach (string skName in rk.GetSubKeyNames())
{
using (Microsoft.Win32.RegistryKey sk = rk.OpenSubKey(skName))
{
Response.Write(sk.GetValue("DisplayName"));
Response.Write("<br>");
}
}
}

Thanks anyway :)

Stelly
 
Surely thats only going to work as a Windows application running on a client machine, otherwise its just going to return whats installed on your web server?
 
Stelly,

What exactly are you trying to achieve?Are you just trying to get a list of installed apps and display it on a webpage for the user of that machine? Are you trying to collate all the installed apps on your users machines and display the results? Or are you trying to connect to one users machine and do a report on what apps they have installed displayed as a webpage?

Cheers,
Jamie.
 
purejamie said:
Stelly,

What exactly are you trying to achieve?Are you just trying to get a list of installed apps and display it on a webpage for the user of that machine? Are you trying to collate all the installed apps on your users machines and display the results? Or are you trying to connect to one users machine and do a report on what apps they have installed displayed as a webpage?

Cheers,
Jamie.


Hi Jamie... trying to do the last one... I think that reading the reg is going to be the best bet..

roboffer said:
Surely thats only going to work as a Windows application running on a client machine, otherwise its just going to return whats installed on your web server.

You were right mate... any ideas??

Stelly
 
To be honest I dont see this as a particular problem that can be solved via a simple web application. Im not sure what you can achieve via Java or Active X controls, but I would be suprised if it could gain an overview of everything that is installed on a machine.

From my point of view this is only available from a Windows application. I could be wrong, but Im not aware of another way of solving this issue.

The most likely solution to this is that you could build a client/server Windows application that harvests the information, this could be a simple executable available via the web and reports the information back.

The other option is to allwo the users to fill in the appropriate data manually, which isnt ideal and will no doubt cause huge headaches once people miss things out on purpose or by accident.
 
It is also possible to compelte a remote registry read for the 'installed programs' part of the reg; you would have to have admin priviledges on the machine you are connecting to however.

As an example you could use the script linked in my first post and change the 'strcomputer' variable for the name of the machine you wish to connect to, then display the results within the webpage.
 
cheers for the help so far... and I have got...

Response.Write("<b>Current Account: ");
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
Response.Write("</b><br>");
string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,"sr445h32j"))
{
foreach (string skName in rk.GetSubKeyNames())
{
using (Microsoft.Win32.RegistryKey sk = rk.OpenSubKey(skName))
{
Response.Write(sk.GetValue("DisplayName"));
Response.Write("<br>");
}
}
}

but due to the fact that I dont have access on the computers it will not let me run this... but all the computers that I want to run this on have the same local admin user and pass... anyone have any ideas how I can implement that into this??

Stelly
 
Back
Top Bottom