Jump to content

search for a program installation directory location?


Burgs
 Share

Recommended Posts

Greetings,

  I have a fairly straightforward question.  Is there a way to write  script that would search for and determine the location of an installed program on any particular client machine?  For example if I wanted to determine the location of a Gstreamer program installation on a client machine (for example if it is located in C:/Gstreamer directory where it normally would be...or not) is there some code snippet or command that would accomplish that?  I thank you in advance.  Regards.

Link to comment
Share on other sites

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe

Can you read the registry and pull the path from there?

$FileLocation=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe", "Default")
 

Link to comment
Share on other sites

64 bit installed packages

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

32 bit installed packages

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Each entry has an InstallLocation associated with it. I use that on repairs of our products to know where to put the missing files during an installer repair operation.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Thank you for the replies.  I thought of checking the registry before, however was unsure if that would be 'fail proof'...not sure if all software installations display in the registry.  I suppose I could supplement that with a search using "FileListToArray" in case of failure to locate in the registry as a workable solution...thanks again to each of you!  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...