|
I want to obtain, preferably via WMI, a list of all the installed applications on a given box. WMI has the classes win32_Product, win32_SoftwareFeature, and win32_SoftwareElement for this purpose but they ONLY cover apps installed via MSI. I waded thru lots of classes but have yet to find any in WMI that will give the complete set.
Question:
a) Does any one know of 1 or more WMI classes that will yield the complete set of installed apps, whether or not installed via MSI.
b) If not, does any one know an alternate method?
Thanks.
Jerry
|
|
|
|
|
They only list MSI packages because the MSI runtime (msiexec) keeps a database of installed products. The WMI provider simply queries this database.
Other setups all work differently. InstallShield (not their MSI package, which goes for everything else mentioned forthwith unless otherwise stated) works differenly from Wise and does seem to keep an internal database of components, those it doesn't seem to happen for packages (speaking in MSI terms here). An up-and-coming install by Nullsoft (makers of Winamp) is very basic and doesn't seem to do anything but keep a log of what was done so it can be uninstalled (sort of like a DB transaction).
The only thing these installation methods have in common is that they almost always (some Windows Update components don't because you can't uninstall them) write to the registry key HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall. You could browse through there and see what registry keys are useful and pretty consistent, like the DisplayName and UninstallString.
As far as querying these, there is - I believe - a WMI provider for the registry. It's been a while since I've played with WMI so I apoligize. If nothing else, registries can be queried remotely by someone with the appropriate permissions, which WMI (or the responsible provider) will most likely enforce anyway.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath,
Thanks a bunch - I figured "the registry" was going to be the answer, but wasn't sure exactly which keys would get me there - the key you pointed out looks very promising.
But I was actually hoping that WMI provided a direct abstraction for this in some class I had so far missed. You know, a direct equivalent for the above mentioned classes (product, swfeature, swelement), but only that they included everything, not just MSI installed apps. Oh well...
In any event, you are correct - there is a provider for the registry, so I can get at the key you mention using it. Looks like that is the best route.
Thanks again!
Jerry
|
|
|
|
|
That registry key IS the place that installers MUST write to if they want to appear in the Add/Remove Applications control panel applet and participate in the functionality provided for installing and uninstall applications.
There isn't an abstract way of doing this, though. Like I said, every installer uses a proprietary installation routine. When you think about it. MSI is database-driven and as a result uses databases to store package, feature, and component information. Other installers are pretty much script-based, but I can't say ALL because even using a batch file to perform an XCOPY is considered an installation routine. The point is that they're all proprietary so there's no abstract way of getting information.
The registry is the one ring that binds them together (sorry, eagerly awaiting LOTR-ROTK!).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath,
Understood. Thanks again!
Jerry
|
|
|
|
|
How to get information from a screen into file?
|
|
|
|
|
Can you be a bit more specific? If you are simply wanting a snapshot of the screen saved to a BMP file, see here and here for ideas.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi ,
Can u pls help me out with code in VC++.
I am using DirectShow filters to compress the audio I capture from Microphone.
The filter flow is as follows WaveDest->Encoder filter(Using GSM 6.10)-> Sample Grabber.
With the Sample Grabber filter I have grabbed some samples and written them into a bts file. So now I have the GSM compressed audio file in my "buff.bts" file in the form of bitstream.
Now how do I get the original file I captured from the mike to be rendered through the speaker. i.e In order to decode this Bitstream do I have to use decode filter in the playback graph but I do not know how to get the GSM 6.10 decoder filter.
Pls help me with the code
Elza
|
|
|
|
|
HI ,
I have made a procedure for sql server with visual c++ and i have test it on my computer and it is well but when i have move it to the server it could not work and it give me the following error
ODBC: Msg 0, Level 16, State 1
Cannot load the DLL sim.dll, or one of the DLLs it references. Reason: 126(The specified module could not be found.).
can any body help me
|
|
|
|
|
It seems that some dependency dll is missing - check your dll with dependency walker and you'll see what are the dlls it need.
Probably it's some msvcrt or something like that.
Hope it helps
|
|
|
|
|
Hi there,
i hope that someone can help me with this.
My application is SDI.
I wroted a class derived from CListCtrl which is created with
LVS_OWNERDRAWFIXED style.
There is a strange behaviour when i click on a different subitem on the same
selected row. It seems that it takes 800 ms till DrawItem is called.
My class implements two methods:
void OnLButtonDown(...)
{
TRACE("Start OnLButtonDown...\n");
...
CListCtrl::OnLButtonDown(nFlags, point);
TRACE("End OnLButtonDown...\n");
}
void DrawItem(...)
{
TRACE("DrawItem...\n");
...
}
When i click at different rows i see in the debug window:
Start OnLButtonDown
DrawItem
DrawItem
..
..
End OnLButtonDown
Meaning, DrawItem is called before OnLButtonDown() finishes.
However, if i click on the same row again i see in the debug window:
Start OnLButtonDown
End OnLButtonDown
DrawItem
In that case, DrawItem is called 800 ms after OnLButtonDown finishes.
Any idea?
|
|
|
|
|
Its probably due to the difference between a selection change and no change.
When you click the item for the 1st time, the control sends a message to the windows owner using SendMessage(). This causes the message loop to pump and process all the messages in the queue (otherwise the thread would block) which causes any WM_DRAWITEMs in the queue to be processed. When clicking the item the second time, the selection changing messages are not sent, as there has been no selection change, so the queue is not pumped until it returns from the LButton handler.
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
Hi Roger,
thanks for your reply.
You explanation seems very reasonable.
How would you solve that delay?
I tried to force sending selection change by calling SetSelectionMark method in OnLButtonDown,but the delay stays still.
I even called Update method or RedrawItems but the result is the same.
What cause the sole WM_DRAWITEM event to be sent after LButton handler returns?
How to solve the delay?
|
|
|
|
|
I think you would need to call:
RedrawItems(index, index);
UpdateWindow();
To move up the WM_DRAWITEM calls.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Roger,
the problem still exists.
|
|
|
|
|
i have two IDD forms (MFC) and i want to be able to click a button on one to open up the other i have added the onclick handler but just cant get the code for opening anywhere can anyone help
|
|
|
|
|
|
And if it is a CFormView you need to create a new document, like this.
POSITION templatePos = GetFirstDocTemplatePosition();
while(templatePos != NULL)
{
CDocTemplate* pTemplate = GetNextDocTemplate(templatePos);
CString strDocName;
pTemplate->GetDocString(strDocName, CDocTemplate::docName);
if(strDocName == "Form you want to open")
pTemplate->OpenDocumentFile(NULL);
}
Alfredo
|
|
|
|
|
I've created an ActiveX control using MFC ActiveX control wizard. But, when I add that control to another MFC Dialog Window, I couldnot run the application. When run in the debug mode, i couldn't include the necessary system dll files. Help me.
Shenthil.
|
|
|
|
|
Have the controls been registered?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi all,
I wanna Create a word document,and then create a table with 3 cols and 5 rows,fill the table with some text, and then insert a row at the end of the table, then fill the text"ok" in the new rows.
Could somebody give me a hand and show me some samples related to VC++ operateing the office WORD?
Thanks!
|
|
|
|
|
|
Sorry, if this seems like a stupid question, but I simple cannot figure out how to run macros in VS.Net 2003.
I have pasted some macro functions into the MyMacro module, but when I try to assign a key to the macro only the predefined macros in the Samples module appear in the listbox.
Any help is much appreciated.
|
|
|
|
|
Can u pls help me out with code in VC++.
I have got a bitstream/ compressed form of audio in a file "compresed.bts" by passing the Audio wav file through some graph filters in DirectShow.
Precisely I have used GSM 6.10 Encoder as a filter. Now how do I decode this Bitstream back to the original wav file. Please help !!!
Do I have to use decode filter in the playback graph but I do not know how to get the GSM 6.10 decoder filter.
Pls help....
|
|
|
|
|
hi,
my project is using some third party controls(crystal reports) i need to know what are all the dll depends on the project. any one help to me.
thanks in advance.
|
|
|
|